XML File Generation

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
Thripura
Participant
Posts: 26
Joined: Wed Jan 27, 2010 5:56 am

XML File Generation

Post by Thripura »

Hi,
I need to create an xml output from multiple datasets.

<Body>
<Profile>
<EmpId>123</EmpId>
<Addresses>
<address>
<AddrType>Main</AddrType>
<City>ABC</City>
</address>
<address>
<AddrType>Secondary</AddrType>
<City>XYZ</City>
</address>
</Addresses>
</profile>
</Body>

Address is repeating element , I have selected AddrType as Key but I am getting two records in the xml ie., First address info in the first record and second address info in the second record.

Job Flow:

[Addr Dataset]----------->[Addr xml o/p]--->

Join the above Addr Xml output with the [Employee Datset] and generate the final xml.

Please suggest me what to do to get the correct output.

Thanks,
Thripura
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

Can you explain your problem in more detail? It's not exactly clear what the issue is......

We assume that the xml you pasted is what you "want"..... please paste what you are getting that needs to be different.

Thanks.

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
Thripura
Participant
Posts: 26
Joined: Wed Jan 27, 2010 5:56 am

Xml File Generation

Post by Thripura »

Output i am getting is below:

<Body>
<profile>
<EmpId>123</EmpId>
<Addresses>
<address>
<AddrType>Main</AddrType>
<City>ABC</City>
</address>
</Addresses>
</profile>
<profile>
<EmpId>123</EmpId>
<Addresses>
<address>
<AddrType>Secondary</AddrType>
<City>XYZ</City>
</address>
</Addresses>
</profile>
</Body>

Please let me know what to do..

Thanks,
Thripura
myukassign
Premium Member
Premium Member
Posts: 238
Joined: Fri Jul 25, 2008 8:55 am

Re: Xml File Generation

Post by myukassign »

In the XML output stage you must have mentiond a trigger column i.e.adresstype / city or anything.

Either you can change that to an emp id... or group as whole...

are you getting these address from multiple datasets ? if that is the case, then you need to create XML chunks and join with the key column of your emp id.
Thripura
Participant
Posts: 26
Joined: Wed Jan 27, 2010 5:56 am

Re: Xml File Generation

Post by Thripura »

Hi,

No i have not mentioned trigger column..
I get mutiple address from a dataset , from this dataset i have generated a xml output and this xml i am trying to join with the employee dataset and generate the xml with emp and address information.

If i use Table instead of dataset its working :)..any idea y is it so???

2Node config. file and no partition while creating the dataset.
Post Reply