BookmarkSubscribeRSS Feed
shl007
Obsidian | Level 7

Hi,

 

I'm using the following code to import XML. I get ERROR: The creation of the XML Mapper file failed. I am on sas 9.4. Any ideas on how to work around? I googled this error and saw encoding mentioned; putting an encoding option on my filename statement does not seem to work. Any tips appreciated.

 

filename myxml '/mypath/import.xml'; 
filename mymap '/mypath/generate.map'; 

libname myxml xmlv2 automap=replace xmlmap=mymap; 
2 REPLIES 2
shl007
Obsidian | Level 7

Correction: I am using SAS Enterprise Guide, 7.15

ChrisNZ
Tourmaline | Level 20

Try this code

filename MYXML '/tmp/import.xml';
filename MYMAP '/tmp/generate.map';

ods xml file=MYXML;
proc print data=SASHELP.CLASS; run;
ods xml close;

libname MYXML xmlv2 automap=replace xmlmap=MYMAP;

to see if you get this log:

 4          filename MYXML '/tmp/import.xml';
 5          filename MYMAP '/tmp/generate.map';
 6          
 7          ods xml file=MYXML;
 NOTE: Writing XML Body file: MYXML
 8          proc print data=SASHELP.CLASS; run;
 
 NOTE: There were 19 observations read from the data set SASHELP.CLASS.
 NOTE: The PROCEDURE PRINT printed page 1.
 NOTE: PROCEDURE PRINT used (Total process time):
       real time           0.04 seconds
       cpu time            0.04 seconds
       
 
 9          ods xml close;
 10         
 11         libname MYXML xmlv2 automap=replace xmlmap=MYMAP;
 NOTE: Processing XMLMap version 2.1.
 NOTE: Libref MYXML was successfully assigned as follows: 
       Engine:        XMLV2 
       Physical Name: /tmp/import.xml

 

 

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 2 replies
  • 1112 views
  • 0 likes
  • 2 in conversation