BookmarkSubscribeRSS Feed
hetuvio
Calcite | Level 5

Dear all,

I'd like to import an xml file into a SAS dataset. I have the corresponding XSL stylesheet. How can I proceed (I'm working on SAS v9.1.3) ?

I have already tried the 2 following options which do not work :

option A : giftxml xml "C:\myxmlfile.odm.xml"; --> I got an error.

option B :

proc xsl in = "C:\myxmlfile.odm.xml"

          xsl="C:\myxslfile.xsl"

          out="C:\myoutfile.xml";

run;

Does anyone could help me to solve this issue please ?

Thanks a lot in advance,

Best regards,

Violaine

4 REPLIES 4
DanielSantos
Barite | Level 11

Hello.

Since the XSL procedure is at an experimental stage on 9.1.3, you have to be more precise about the error.

If by any means you manage to setup your own xmlmap, it's pretty much like this:

http://support.sas.com/documentation/cdl/en/engxml/62845/HTML/default/viewer.htm#a002484891.htm

Cheers from Portugal.

Daniel Santos @ www.cgd.pt

hetuvio
Calcite | Level 5

Hi Daniel,

Thanks a lot for your answer.

This is the issue I get : "ERROR : XML describe error : XML data is not in a format supported natively by the XML libname engine. Files of this type usually require an XMLMap to be input properly"

I'll loot at the link you provided. I'm afraid that there are no other way to import XML file into SAS datasets, except : coding my own map file, am I right ? I'll have to look deep inside the coding of the .map file.

Thanks a lot,

Regards,

Violaine

DanielSantos
Barite | Level 11

It's actually pretty easy to do, no need for coding if you have the XMLMapper tool.

Available here (at no cost, btw):

http://support.sas.com/demosdownloads/setupcat.jsp?cat=Base+SAS+Software

Cheers from Portugal.

Daniel Santos @ www.cgd.pt

Note: You can download and install de 9.2 version, It's a standalone tool and you'll be fine with that. That's the one we're using here to create the maps with the SAS 9.1.3. realease.

hetuvio
Calcite | Level 5

Thanks ! That's a great help! I thought that the SAS XMLMapper tool was available only since v9.2.

Regards,

Violaine

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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