XML import with Mapper

Reply
Occasional Contributor
Posts: 19

XML import with Mapper

Hi all,

When I try to use the XML mapper, create a map file and try to import the XML file into SAS, it isn't importing any observations.  In addition, when I try to open the table, SAS says "object reference not set to an instance of an object."  Then when I click the table again, it opens up with no observations.  Does anyone have an idea of what is going on?

Thanks!

Super User
Posts: 17,771

Re: XML import with Mapper

I've never had luck with the XML Mapper...

The auto map has worked for me though, the first argument is a path to your XML file, the second filename statement will be created by default.

Then check the contents using proc contents, as you may have to merge tables.

If this doesn't work you may want to work with tech support or at least post an example of your XML file and/or code that isn't working.

filename myxml "Path to XML.xml";

filename mymap "Path to create map file.map";

libname myxml xmlv2 automap=replace xmlmap=mymap;

proc contents data=myxml._all_;

run;

data si;

    set myxml.t;

run;

libname myxml;

filename myxml clear;

filename mymap clear;

Occasional Contributor
Posts: 19

Re: XML import with Mapper

Thanks Reeza.  I still can't see any of my observations.  It is running though the proc contents though.  The code is running fine, it just isn't reading observations.

Capture.PNG


Super User
Posts: 17,771

Re: XML import with Mapper

Can you post a sample?

Ask a Question
Discussion stats
  • 3 replies
  • 236 views
  • 0 likes
  • 2 in conversation