Generating XML Output thru Datastage

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
santanu84
Participant
Posts: 14
Joined: Mon May 26, 2008 7:17 am
Location: Kolkata

Generating XML Output thru Datastage

Post by santanu84 »

Hi All

I have written a parallel job in datastage where it will read one sequential input file and will generate an XML output file.
In the seqn file I have three records SKU, SellYear and RIF.
Now the scenario could be for two different SKU the SellYear and the RIF could be same in the input file.
In XML output the records will come in three different tag.
Like,
<Output>
<record>
<Sku>sku value</Sku>
<SellYear>sy value</SellYear>
<Rif>rif value</Rif>
</record>
</Output>
But when the job is generating the output XML it is merging the similar records togather.
For example,
Say I have two SKUs "S1" and "S2" for which the sellyear is "2001" and Rif is "R1" (same).
So the expected output is,

<Output>
<record>
<Sku>S1</Sku>
<SellYear>2001</SellYear>
<Rif>R1</Rif>
</record>
<record>
<Sku>S2</Sku>
<SellYear>2001</SellYear>
<Rif>R1</Rif>
</record>
</Output>

But through datastage job what I am getting as XML output is,

<Output>
<record>
<Sku>S1</Sku>
<Sku>S2</Sku>
<SellYear>2001</SellYear>
<Rif>R1</Rif>
</record>
</Output>

This is not intended.

Now I am not sure whether this is the problem in Datastage XML output stage, or XML parsing.

Can any body please suggest what I should do in XML Output Stage to get that expected format of output records.

Thanks
Hi
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Well... do not specify a Repetition Element (Key) if you have. Also use the 'Single row' Output Mode rather than 'Aggregate all rows'. One of those should fix you, I would think.
-craig

"You can never have too many knives" -- Logan Nine Fingers
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

This is going to sound really crazy, but just for kicks, add 5 or six columns [just dummy up a few] to it and try it again. Might be a useless test (I said it was "crazy")...but a long time ago I recall a scenerio like this where I had an issue and it was only when I had 4 or fewer total columns going into the xml.
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
Post Reply