Repetetive XML tags

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
debasisp
Premium Member
Premium Member
Posts: 34
Joined: Wed Feb 01, 2006 1:53 am

Repetetive XML tags

Post by debasisp »

Hi,
I am reading a dataset and creating output XML.

Here is the XML output I am getting.

<Message>
<Main>
<Col1>18108</Col1>
<Col1>18108</Col1>
<Col1>18108</Col1>
<Col2>U00009473</Col2>
...............
</Main>
</Message>

First Column is repeting 3 times as the I have 3 rows present for that same key field.

I had used the key field that is specified in the dataset as the Trigger Column.

Can anyone please help me to get one row as Col1 in the XML output irrespective of duplicate rows.

Cheers
Debasis
dsnovice
Participant
Posts: 38
Joined: Thu Jul 22, 2004 11:56 pm
Location: Mclean, VA
Contact:

Post by dsnovice »

Hello Debasis,

Try removing duplicate rows and send only the one record and keep the same trigger column Col1 in your XML output stage.

Else you will have to change your Trigger column to some other unique tag this way the aggregation will happen at a different level, like if you choose <main> as a tag you will have only one <col1>. So you will have to search for a unique column.

hth,
a novice
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Can't check right now but there's an option in the XML Output stage to "group" your data from what I recall. How is that set?
-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 »

There may be more to this than what we can see here, as we don't have lots of detail about your source, but here are a few things to try:

a) for your simple example above (create a test with only those two columns) make Col2 your "key" and choose Aggregate option in the xml output stage.

b) for a second and separate test, add a few more columns at the col2 level (just dummy columns for test purposes, added in an upstream transformer)...I've seen some odd things happen with aggregation when there are 4 or fewer cols........

Ernie
Ernie Ostic

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