BookmarkSubscribeRSS Feed
amypandit
Calcite | Level 5

I have sas output, but no data, Is it possible to convert the SAS output to XML?

3 REPLIES 3
Reeza
Super User

What are you calling 'SAS output' and what do you mean by XML? Are you referring to the tagset version or a file that you want to open with Excel?

 

 

amypandit
Calcite | Level 5

I would like to convert SAS output (.lst) to XML?  any method is fine with me,  Is there a way?

Reeza
Super User

Not one that would have any decent structure. What is the end goal here? XML are structured output, LST files are designed for viewing/reporting.  ODS TAGSETS.EXCELXP generates a type of XML file but it looks like an Excel file. You can try that I suppose, and see if it meets your needs.

 

ods tagsets.excelxp file='demo.xml' style=meadow;

proc print data=sashelp.cars(obs=10);
run;

proc print data=sashelp.class(obs=5);
run;

ods tagsets.excelxp close;

And then if you want a data set to an XML file you can use ODS XML.

 

 libname newfile xml 'c:\_localdata\temp.xml'
           xmltype=export;
   data newfile.test;
      set sashelp.class;
   run;

   libname newfile;

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 1843 views
  • 0 likes
  • 2 in conversation