DATA Step, Macro, Functions and more

Import Xml file into SAS dataset (v9.1.3)

Reply
Contributor
Posts: 30

Import Xml file into SAS dataset (v9.1.3)

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

Super Contributor
Posts: 474

Re: Import Xml file into SAS dataset (v9.1.3)

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

Contributor
Posts: 30

Re: Import Xml file into SAS dataset (v9.1.3)

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

Super Contributor
Posts: 474

Re: Import Xml file into SAS dataset (v9.1.3)

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.

Contributor
Posts: 30

Re: Import Xml file into SAS dataset (v9.1.3)

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

Regards,

Violaine

Ask a Question
Discussion stats
  • 4 replies
  • 746 views
  • 3 likes
  • 2 in conversation