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
swathi Singamareddygari
Participant
Posts: 48
Joined: Fri Feb 29, 2008 1:09 am
Location: Bangalore

XML output Stage

Post by swathi Singamareddygari »

Hi All,

I am facing the problem with the XML output stage.

My i/p:

rowid|result
1|abc
1|xdf
3|asd

I am using rowid as a trigger column.

So for rowid 1 the corresopnding result values abc,xdf should come under a single rowid chunk

means i want the output xml like this

<DMSMessage>
<sourceSystemEventId>1</sourceSystemEventId>
<retryCount>abc</retryCount>
<retryCount>xdf</retryCount>
</DMSMessage>


but for i am getting like this

<DMSMessage>
<sourceSystemEventId>1</sourceSystemEventId>
<retryCount>abc</retryCount>
</DMSMessage>
<DMSMessage>
<sourceSystemEventId>1</sourceSystemEventId>
<retryCount>xdf</retryCount>
</DMSMessage>

To achive this do we need to set any thing in the XML output stage

can any knows please help me

Thanks for your help
Thanks&Regards
S.Swathi
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

What settings are you using in the stage? Is your 'result' column marked as a key? :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
swathi Singamareddygari
Participant
Posts: 48
Joined: Fri Feb 29, 2008 1:09 am
Location: Bangalore

Post by swathi Singamareddygari »

Hi Chuleet,

I am not using result as a key column,and i am using rowid as a trigger column.

In the transformation setting i enabled Replace NULLS with empty values,single tag for empty element style apart from this i ddin't enabled any thing.

Thanks for your help
Thanks&Regards
S.Swathi
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

The 'trigger column' option tells it to create a new output file every time that value changes. Do you have an output link from the stage somewhere or is the stage writing to an output file directly? :?
-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 »

Try wrapping the retrycount elements in a complex or "container" type of element. Add this to your xpath for the second column (make sure you match the correct spelling..):

/DMSMesage/...EventID/AllRetryCounts/RetryCount/text()

If that works, it will help tell us exactly what is happening....it also might be the easiest solution...you can zap out the extra element downstream.

If you actually only have one column, then it might just be easier to manually build the second column's xml string in an upstream transformer and pass it along and insert it.

(take a look at the xml best practices document that is described in many places in the forum)


Ernie
Ernie Ostic

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