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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

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
  • 1824 views
  • 3 likes
  • 2 in conversation