You will want to read about the SAS XML Libname Engine. If you have very "regular" or rectangular XML, then you can use the simple form of the XML Libname engine. For example, if you have this file stored in:
<?xml version="1.0" ?>
<NAME> alan </NAME>
<AGE> 15 </AGE>
<NAME> bob </NAME>
<AGE> 16 </AGE>
<NAME> carla </NAME>
<AGE> 15 </AGE>
<NAME> dave </NAME>
<AGE> 14 </AGE>
Then this code will read the MYDATA.XML file using the SAS XML Libname Engine (SXLE):
libname xmlin xml 'c:\temp\mydata.xml';
data somevars(keep=name id a d);
libname xmlin clear;
proc print data=work.allvars;
title 'From SXLE -- get all variables';
proc print data=work.somevars;
title 'From SXLE -- get only some variables';
For more complicated XML data or for XML data files with more hierarchical levels of tags, In order to import these kinds of XML file into SAS, you have 2 choices:
1) transform the XML file into a more standard form XML, as needed by SAS, using a 3rd party XML tool, such as XMLSpy, or an XSL transform, as described here: http://support.sas.com/rnd/base/xmlengine/sxle82/prod82/index.html
2) build an XMLMAP file that tells the SAS XML Libname Engine how to traverse the hierarchical XML tags in order to extract the data for a SAS dataset.
In my example, I did a misleading thing. Sorry about that. Notice that my data file is called "MYDATA.XML" and that -inside- the file, under the <TABLE> tag, my tag that delimits every row is the <MYDATA> tag.
If this had been the <WOMBAT> tag, then my SET statement would have been:
and -not- XMLIN.MYDATA.
SAS expects the data to be VERY regular. There must be a clear delimiter tag around every row that you want to turn into an observation. I suspect your ERROR message is because of a problem with either the LIBNAME statement or the SET statement.
I suggest you open a track with Tech Support on this issue, as they can look at your XML data file and your SAS code and help you with a resolution.
The problem with posting XML onto the forum is the the < and the > symbols around every tag sometimes cause the posting editor program to truncate a posting.
Again, if you have nonstandard XML -- in other words, if your XML is not regular, like my XML example, then you have to use the XMLMapper to "map" the XML tags to SAS columns.