BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Marius07
Calcite | Level 5

Hi all,

 

I am currently having a problem with importing a XML file into SAS. I created a mapping file using the SAS XML Mapper. However, I always get the following error message:

 

NOTE: Processing XMLMap version 2.1.
ERROR: Xpath construct
/{http://www.xbrl.org/2003/instance}xbrl/{http://www.xbrl.org/2003/instance}ROCRA/{http://www.xbrl
.org/2003/instance}RAN for column RAN is an invalid, unrecognized, or unsupported form.

ERROR: Error in the LIBNAME statement.

 

This the code I used for importing:

 

/********************************************************************************
* Generated by XML Mapper, 903000.0.0.20110518190000_v930
********************************************************************************/

/*
* Environment
*/
filename SPNAMEYY 'M:\Marius\Rating_Data\SP-Corporate-2022-06-01\SP-NAME-YY100116091-Discovery-Communications-LLC-2022-06-01-ISSUER.xml';
filename SXLEMAP 'M:\Marius\Rating_Data\exmple_map.map';
libname SPNAMEYY xmlv2 xmlmap=SXLEMAP access=READONLY;

/*
* Catalog
*/

proc datasets lib=SPNAMEYY; run;

/*
* Contents
*/

proc contents data=SPNAMEYY.xbrl varnum; run;
proc contents data=SPNAMEYY.schemaRef varnum; run;
proc contents data=SPNAMEYY.context varnum; run;
proc contents data=SPNAMEYY.entity varnum; run;
proc contents data=SPNAMEYY.identifier varnum; run;
proc contents data=SPNAMEYY.period varnum; run;
proc contents data=SPNAMEYY.ROCRA varnum; run;
proc contents data=SPNAMEYY.RAN varnum; run;
proc contents data=SPNAMEYY.FCD varnum; run;
proc contents data=SPNAMEYY.ISD varnum; run;
proc contents data=SPNAMEYY.SSC varnum; run;
proc contents data=SPNAMEYY.ISSNAME varnum; run;
proc contents data=SPNAMEYY.LEI varnum; run;
proc contents data=SPNAMEYY.IND varnum; run;
proc contents data=SPNAMEYY.OBT varnum; run;
proc contents data=SPNAMEYY.INSTNAME varnum; run;
proc contents data=SPNAMEYY.INI varnum; run;
proc contents data=SPNAMEYY.INIS varnum; run;
proc contents data=SPNAMEYY.INRD varnum; run;
proc contents data=SPNAMEYY.IP varnum; run;
proc contents data=SPNAMEYY.R varnum; run;
proc contents data=SPNAMEYY.RAD varnum; run;
proc contents data=SPNAMEYY.OAN varnum; run;
proc contents data=SPNAMEYY.RT varnum; run;
proc contents data=SPNAMEYY.RST varnum; run;
proc contents data=SPNAMEYY.RTT varnum; run;
proc contents data=SPNAMEYY.RAC varnum; run;
proc contents data=SPNAMEYY.WST varnum; run;
proc contents data=SPNAMEYY.ROL varnum; run;
proc contents data=SPNAMEYY.CUSIP varnum; run;

/*
* Printing
*/

title 'Table xbrl';
proc print data=SPNAMEYY.xbrl; run;
title;

title 'Table schemaRef';
proc print data=SPNAMEYY.schemaRef; run;
title;

title 'Table context';
proc print data=SPNAMEYY.context; run;
title;

title 'Table entity';
proc print data=SPNAMEYY.entity; run;
title;

title 'Table identifier';
proc print data=SPNAMEYY.identifier; run;
title;

title 'Table period';
proc print data=SPNAMEYY.period; run;
title;

title 'Table ROCRA';
proc print data=SPNAMEYY.ROCRA; run;
title;

title 'Table RAN';
proc print data=SPNAMEYY.RAN; run;
title;

title 'Table FCD';
proc print data=SPNAMEYY.FCD; run;
title;

title 'Table ISD';
proc print data=SPNAMEYY.ISD; run;
title;

title 'Table SSC';
proc print data=SPNAMEYY.SSC; run;
title;

title 'Table ISSNAME';
proc print data=SPNAMEYY.ISSNAME; run;
title;

title 'Table LEI';
proc print data=SPNAMEYY.LEI; run;
title;

title 'Table IND';
proc print data=SPNAMEYY.IND; run;
title;

title 'Table OBT';
proc print data=SPNAMEYY.OBT; run;
title;

title 'Table INSTNAME';
proc print data=SPNAMEYY.INSTNAME; run;
title;

title 'Table INI';
proc print data=SPNAMEYY.INI; run;
title;

title 'Table INIS';
proc print data=SPNAMEYY.INIS; run;
title;

title 'Table INRD';
proc print data=SPNAMEYY.INRD; run;
title;

title 'Table IP';
proc print data=SPNAMEYY.IP; run;
title;

title 'Table R';
proc print data=SPNAMEYY.R; run;
title;

title 'Table RAD';
proc print data=SPNAMEYY.RAD; run;
title;

title 'Table OAN';
proc print data=SPNAMEYY.OAN; run;
title;

title 'Table RT';
proc print data=SPNAMEYY.RT; run;
title;

title 'Table RST';
proc print data=SPNAMEYY.RST; run;
title;

title 'Table RTT';
proc print data=SPNAMEYY.RTT; run;
title;

title 'Table RAC';
proc print data=SPNAMEYY.RAC; run;
title;

title 'Table WST';
proc print data=SPNAMEYY.WST; run;
title;

title 'Table ROL';
proc print data=SPNAMEYY.ROL; run;
title;

title 'Table CUSIP';
proc print data=SPNAMEYY.CUSIP; run;
title;


/*
* Local Extraction
*/

DATA xbrl; SET SPNAMEYY.xbrl; run;
DATA schemaRef; SET SPNAMEYY.schemaRef; run;
DATA context; SET SPNAMEYY.context; run;
DATA entity; SET SPNAMEYY.entity; run;
DATA identifier; SET SPNAMEYY.identifier; run;
DATA period; SET SPNAMEYY.period; run;
DATA ROCRA; SET SPNAMEYY.ROCRA; run;
DATA RAN; SET SPNAMEYY.RAN; run;
DATA FCD; SET SPNAMEYY.FCD; run;
DATA ISD; SET SPNAMEYY.ISD; run;
DATA SSC; SET SPNAMEYY.SSC; run;
DATA ISSNAME; SET SPNAMEYY.ISSNAME; run;
DATA LEI; SET SPNAMEYY.LEI; run;
DATA IND; SET SPNAMEYY.IND; run;
DATA OBT; SET SPNAMEYY.OBT; run;
DATA INSTNAME; SET SPNAMEYY.INSTNAME; run;
DATA INI; SET SPNAMEYY.INI; run;
DATA INIS; SET SPNAMEYY.INIS; run;
DATA INRD; SET SPNAMEYY.INRD; run;
DATA IP; SET SPNAMEYY.IP; run;
DATA R; SET SPNAMEYY.R; run;
DATA RAD; SET SPNAMEYY.RAD; run;
DATA OAN; SET SPNAMEYY.OAN; run;
DATA RT; SET SPNAMEYY.RT; run;
DATA RST; SET SPNAMEYY.RST; run;
DATA RTT; SET SPNAMEYY.RTT; run;
DATA RAC; SET SPNAMEYY.RAC; run;
DATA WST; SET SPNAMEYY.WST; run;
DATA ROL; SET SPNAMEYY.ROL; run;
DATA CUSIP; SET SPNAMEYY.CUSIP; run;

 

I attached the XML file and the map (the code of the map is attached as a docs, because I couldn't upload .map files here). Do you have an idea why I keep receiving this error message and how I can solve it?

 

Thank you in advance and kind regards,

Marius

 

1 ACCEPTED SOLUTION

Accepted Solutions
jklaverstijn
Rhodochrosite | Level 12

Not quite sure what went wrong but I reran the XML Mapper on your XML and got a working map with the auto-map function. I used the latest, 9.46. The new map file is different from yours in many places but differences are small. Mostly "-1" versus "1". Maybe your xmlmapper version is different?

 

I have attached my version for your convenience.

 

Hope this helps,

- Jan.

View solution in original post

4 REPLIES 4
jklaverstijn
Rhodochrosite | Level 12

Not quite sure what went wrong but I reran the XML Mapper on your XML and got a working map with the auto-map function. I used the latest, 9.46. The new map file is different from yours in many places but differences are small. Mostly "-1" versus "1". Maybe your xmlmapper version is different?

 

I have attached my version for your convenience.

 

Hope this helps,

- Jan.

jklaverstijn
Rhodochrosite | Level 12
By the way I did recreate your error message using your map file before creating my own.
- Jan.
Marius07
Calcite | Level 5

Thank you very much! Actually, I really had an older version. Thanks for your help!

Tom
Super User Tom
Super User

Note that XML files in general and the MAP files that the XMLV2 engine uses in particular are just TEXT files.  So just post them using .TXT extension.

 

I re-created a map file using AUTOMAP option.  Looks basically the same.  Some names were changed.

Main differences seem to be that a lot of -1 have been converted into 1.

Tom_0-1656371568362.png

 

 

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
  • 4 replies
  • 875 views
  • 3 likes
  • 3 in conversation