I'll have a go at this. Seems like you might have a messy .xml file. If this is the case, you will have to specify the XMLMAP
. I don't know what tags you have or the layout of your tags from your description. But you can try the simple libname statement with the xml engine first if the .xml file is not too messy.
libname my xml 'C:\sasdata\sample.xml';
data work.sample2;
set my.sample;
run;
On the other hand, if you have SAS 9.1.3 or newer, there might be a XMLMAP
program in your version which you can make XML maps which outlines the boundaries of the currently imported .xml file.
"Very" rough sketch of XMLMAP
:
filename my 'C:\sasdata\sample.xml';
filename map 'C:\sasdata\sample.map';
libname my xlm xmlmap=map;
Alternatively, you can also try to open your .xlm file in Excel. Then save it as an Excel file and use proc import
to import it into SAS. You might need to download the Excel XMLTools add-in though.