SAS Enterprise Guide

Desktop productivity for business analysts and programmers
BookmarkSubscribeRSS Feed
fran_b
Fluorite | Level 6

Hi All,

 

I am using SAS xml mapper to import an xml file 

 

After running the code obtained by the XML mapper in SAS EG, I have several SAS tables 

 

After making my changes, I'd like to export back all these tables as the unique XML they're coming from, maintaining the same hierarchical structure of the original xml file

 

This is an example:

 

Original xml (just a part of it):

 

<Country>
<ID>AA597FD</ID>
<Name>A</Name>
<ShortName>A</ShortName>
<Private>no</Private>
<System>
<ID>8b8</ID>
<Name>a7</Name>
<CountryID>AA597FD</CountryID>
<CurrencyOutput>euro</CurrencyOutput>
<CurrencyParam>euro</CurrencyParam>
<ExchangeRateEuro>1</ExchangeRateEuro>
<HeadDefInc>ils</HeadDefInc>
<Private>no</Private>
<Order>2</Order>
<Year>2007</Year>
<Policy>
<ID>cc</ID>
<SystemID>8b8</SystemID>
<Name>Cat</Name>
<Type>def</Type>
<Comment><![CDATA[DEF: COTS]]></Comment>
<PrivateComment />
<Order>3</Order>
<Switch>on</Switch>
<Private />
<Function>
<ID>d79</ID>
<PolicyID>3cc</PolicyID>
<Name>Defst</Name>
<Comment><![CDATA[Min and Max Base]]></Comment>
<PrivateComment />
<Order>3</Order>
<Switch>on</Switch>


<Parameter>
...
</Parameter>
<Parameter>
...
</Parameter>
<Parameter>
...
</Parameter>
<Parameter>
...
</Parameter>
</Function>
<Function>
...
</Function>
</Policy>
</System>
</Country>

 

From the xml mapper I obtain four tables corresponding to Function, Policy, System and Country

 

I tried to merge them, but the resulting xml after exporting is not the same and if I use the map is giving me errors like:

 

ERROR: XMLMap for output table COUNTRY requested but that table did not exist in the XMLMap output section.

 

Or:

 

error.png

 

Any idea on how to do it?

 

Thanks

4 REPLIES 4
fran_b
Fluorite | Level 6

Thanks for your answer

 

I had a look, but I don't think this can solve my problem

I can perfectly import the xml in SAS, but divided in multiple SAS tables

 

My problem is that I cannot export back all these tables as an XML file keeping the hierarchical structure 

jocas
Calcite | Level 5

Use xml mapper to map the xml to a single table that contains all the information you need.
In that map add the <OUTPUT> tags and tableref that single table.

sas-innovate-white.png

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

Register now!

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

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