Hi,
I need to get the property (content/Variables View) of *.SAS7BDAT files which consist of variable names of more than 8 characters.
when i tried the below code i'm able to get the xml from all the other sas7bdat files (where their variable names in that sas7bdat file is of maximum 8 characters only).
CODE :
ods xml file="C:\Users\sas\Desktop\text2.xml";
proc contents data='C:\\Users\\sas\\Desktop\\SAS\\cal_sample.sas7bdat' out=contents DETAILS;
run;
ods _all_ close;
In this 'cal_sample.sas7bdat' file its variable name length is of max 8 characters only, so i got the expected test2.XML as output and i proceessed it to get my output.And i can not get that expected XML for other files with more than 8 characters as its variable name.
I'm new to SAS and i knew few thing only about it. I'm in Need of help!!!
It works fine for simple test that I did.
Not sure why you would want the print-out from PROC CONTENTS as XML.
Why don't you export the dataset output by the proc as an XML file? That would not have the confused format needed to convert it to listing.
libname out xml '~/test/contents.xml';
proc contents data=sashelp.class out=out.contents noprint ;
run;
libname out clear;
It works fine for simple test that I did.
Not sure why you would want the print-out from PROC CONTENTS as XML.
Why don't you export the dataset output by the proc as an XML file? That would not have the confused format needed to convert it to listing.
libname out xml '~/test/contents.xml';
proc contents data=sashelp.class out=out.contents noprint ;
run;
libname out clear;
Hi Tom,
I'm totally new to SAS and after long R&D i tried with that code. And my hearty thanks to you. Where this is the one what exactly i'm looking for it....
Happy thanks Tom!!!
Mathan
Mathan,
Can you provide a copy of your sas log when you have this issue? Also can you provide a copy of one of the problem data sets?
Both of those would be very helpful for tracking your problem.
thx:-)
Have a look at the sashelp dictonary tables should contain information that you need to process this...
Barry
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.