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

 

 

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1604 views
  • 0 likes
  • 2 in conversation