11-08-2012 01:31 AM
We have a requirement to convert an xml data into sas dataset. The values are stored within attributes of the elements. We can only parse the element values and convert into dataset. Is there any solution to convert attribute values into dataset columns?
11-08-2012 08:34 AM
Sounds like you have XML stored in datasets (rather than in-line with the program).
If your data is actually in a database server like Oracle then using their built in tools to create a view would probably be the best.
Otherwise it is possible to write the data to text file and use SAS's XML engine to read it as a dataset. Will probably take some time to figure out how to generate the proper map to read it. Also SAS much prefers that the XML is nice a simple, but if it was that simple then you probably would have just stored it as variables to begin with.
filename xmlfile temp;
file xmlfile ;
put xmlvar ;
libname xmlfile xml ;
data want ;
set xmlfile.table1 ;