BookmarkSubscribeRSS Feed
filgueira
Calcite | Level 5

Hy! Is it possible, using SAS with XML Mapper generate a XML with arrays. For example:

 

I have a table like that:

John, Chicago, receiptA, value1

John, Chicago, receiptB, value2

John, Chicago, receiptC, value3

Mary, Boston, receiptX, value8

Mary, Boston, receiptY, value9.

 

and I want a XML like that.

<name>John</name>

<city>Chicago</city>

<receipts>

    <receipt>receiptA</receipt> <value>value1</value>

    <receipt>receiptB</receipt> <value>value2</value>

    <receipt>receiptC</receipt> <value>value3</value>

</receipts>

<name>Mary</name>

<city>Boston</city>

<receipts>

    <receipt>receiptX</receipt> <value>value8</value>

    <receipt>receiptY</receipt> <value>value9</value>

  </receipts>

.....

 

Any help about that. 

 

tks

Filgueira

 

 

1 REPLY 1
ChrisNZ
Tourmaline | Level 20

There might be a way, but you should just write a data step for such simple output if you get no replies, rather than dealing with XML Mapper.

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!

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
  • 1 reply
  • 408 views
  • 0 likes
  • 2 in conversation