- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi - I've imported an XML successfully, but now I'm getting the following error when I try to use that imported XML into a data step. Any ideas? It says line 1 column 1.
ERROR: Expected an XML document prolog or element.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi:
I don't understand, exactly how you imported the XML successfully. If you've imported the XML into a SAS data set, then you would not be getting XML errors. Or, you could be encountering an issue such as the one described here: https://support.sas.com/kb/46/233.html . I'd recommend opening a track with Tech Support. Without seeing the ALL the code you're running and the data/file you're using, it's nearly impossible to comment.
Cynthia
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
The code I am using is below. I did submit a ticket to SAS support, and they said, "The XML Engine does not see an prolog statement or the opening XML tag on line 1." So I sent SAS support the first few lines of my XML file. I'm not sure what to correct.
Using “xml2” engine:
filename myxml '/mypath/myfile.xml' ENCODING = 'unicode';
filename mymap '/mypath/myfile_generate.map';
libname myxml xmlv2 automap=replace xmlmap=mymap compat=yes;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Just to clarify, the lines I just provided DO run successfully. It is my data step below that bombs with the aforesaid "prolog or element" error:
data test;
set myxml.billing;
run;
I can see the XML imported in my libname; it is when I try to use one of the XML tables into a data step that the error occurs.