XML Output stage

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
bikan
Premium Member
Premium Member
Posts: 128
Joined: Thu Jun 08, 2006 5:27 am

XML Output stage

Post by bikan »

Hi All,

I have a source metadata as
customerid,customername,add1,add2,cost1,cost2
and i have 2 occurence of add1,add2 and cost1,cost2 in my source data file.
My data file is like
101,john,abc street,cde street,abd street,dgf street,30,35,60,70

I want output XML file as
<ExternalXML>
<customerid>101</customerid>
<customername>john</customername>
<address>
<add1>abc street</add1>
<add2>cde street</add2>
</address>
<address>
<add1>abd street</add1>
<add2>dgf street</add2>
</address>
<cost>
<cost1>60</cost1>
<cost2>70</cost2>
</cost>
<cost>
<cost1>30</cost1>
<cost2>35</cost2>
</cost>
</ExternalXML>

I have got reply from ernie saying that i need to use PIVOT stage.
Pivot stage worked for address occurence and i got 2 records out of 1 in source.
but when i tried with two fields having 2 occurences then i got ambiguity in the data with PIVOT stage and output was not correct.

Please tell me what i need to do.

Thanks in advance for your help.

Murari
Post Reply