Placing different XML contexts in a single row

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
suneyes
Participant
Posts: 82
Joined: Mon Jul 21, 2008 8:42 am

Placing different XML contexts in a single row

Post by suneyes »

Hi all,

I am working on XML input stage where I am facing problem with XML contexts.

I am having a context like this

<tId>
<trId context="SUN/trId/0"> 59876543</trId>
<trId context="SUN/transId/0">12345678</trId>
<trId context="QUN/tradeId/0">1546382</trId>
</tId>

when I am selecting the columns for the XML input stage,I had selected both context and text of tId.

Now my requirement is to keep all the texts(59876543,12345678,1546382)
in a single row of a file.
There are some 1450 tId tags in my input XML file.
when I am redirecting the output from 'XML input' stage to a sequential firl,
I am getting 4350 columns.(1450*3).
This is because the system is creating a column for each context.
But I want all the 3 contexts in one row.


Any help regarding my problem is highly appreciated.

_________________
sun
throbinson
Charter Member
Charter Member
Posts: 299
Joined: Wed Nov 13, 2002 5:38 pm
Location: USA

Post by throbinson »

I believe you are breaking on trId. TrId is your key column and your repetitive element. This would explain the 4350 rows.
Define a key column with .../tId as the description. this makes the column the repetitive element. This will break once per tId and put all the TrIDs within a tId in a single line.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

And make sure you "Aggregate all rows".
-craig

"You can never have too many knives" -- Logan Nine Fingers
throbinson
Charter Member
Charter Member
Posts: 299
Joined: Wed Nov 13, 2002 5:38 pm
Location: USA

Post by throbinson »

Aggregate all rows on the XML Input stage? Where?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

XML Input? D'oh. Thought we was talking output. :oops:
-craig

"You can never have too many knives" -- Logan Nine Fingers
suneyes
Participant
Posts: 82
Joined: Mon Jul 21, 2008 8:42 am

Post by suneyes »

Thank you very much Mr. Robinson.
your inputs helped me in resolving my issue.
Thank you very much.

And thanks to you hulett.Thanks for your active participation
sun
Post Reply