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

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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