Data wrriting to xml file (using 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
srinivas Guduru
Premium Member
Premium Member
Posts: 38
Joined: Sat Dec 29, 2007 9:58 am

Data wrriting to xml file (using xml output stage)

Post by srinivas Guduru »

I need to generate a xml data file

Transformer stage is used before Xml output stage

Out put Xml file is generating correctly except

Starting tag is not ending with closing tag

/accList/accEntry/msgId/text()
.
.
.

/accList/accEntry/relList/relEntry/relSta/text()

<accEntry> tag is not closing with </accEntry> tag


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

Post by eostic »

Can you provide more details, or cut/paste a resulting small output example? Is it only for one particular row? for any and all of your accEntry instances? Does msgId close correctly? Does accList close correctly? Are the values null? are the values empty?

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
srinivas Guduru
Premium Member
Premium Member
Posts: 38
Joined: Sat Dec 29, 2007 9:58 am

can any one let me know the solution

Post by srinivas Guduru »

can any one let me know the solution for my problem

Thanks
srinivas Guduru
Premium Member
Premium Member
Posts: 38
Joined: Sat Dec 29, 2007 9:58 am

Re: can any one let me know the solution

Post by srinivas Guduru »

The hole record is very big that is why I am not able to send you

/accList is closing correctly at the end of the file with </accList>

<accEntry> is not closing with </accEntry> for each record

and <msgId> is closing properly for every record


Thank you

srini
srinivas Guduru
Premium Member
Premium Member
Posts: 38
Joined: Sat Dec 29, 2007 9:58 am

Re: can any one let me know the solution

Post by srinivas Guduru »

<accList><accEntry><msgId>A1111</msgId>
.
.
.
.
<relEntry>
<seqNum>1</seqNum>
.
.
.
</relEntry>
HERE <accEntry> should be closed with </accEntry>
<relEntry>
<seqNum>1</seqNum>

Thanks

Srini

Thank you

srini[/quote]
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

I have no idea. Never seen that happen directly.....but I wonder about the hierarchy you are creating....

Do you have a "perfect" example version of the whole structure that you would like to create? How do the accEntry elements relate to the relEntry elements? are they one:one ....or can a single accEntry have multiple relEntry elements? (one:many).....

...and if you are saying that accEntry should be closed...where would the "new" one be?.....right after it? If so, would it then have another msgId immediately following?

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

One more set of items worth checking...... what element do you have marked as a key? ...and are you using "aggregate"?, and then separately, what happens if you force seqnum to be unique?

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
srinivas Guduru
Premium Member
Premium Member
Posts: 38
Joined: Sat Dec 29, 2007 9:58 am

can you please lookinto this

Post by srinivas Guduru »

[<accList>
<accEntry>
<msgId>A1111</msgId>
<sysId>VGI</sysId>
<actInd>2</actInd>
<accNum>0002-09891824205</accNum>
<accDtls>
<modInd>Securities</modInd>
<custId>CIF5849794</custId>
<accTyp>16</accTyp>
<brchAcc>USA</brchAcc>
<accOpDt>12-jun-2008</accOpDt>
<accSta>01 </accSta>
<accClDt>31-dec-9999</accClDt>
<ownTyp>1</ownTyp></a
ccDtls><relList><relEntry>
<seqNum>1</seqNum>
<relTyp>50</relTyp>
<relCust>1313536716</relCust>
<relAcc>0002-09891824205</relAcc>
<relFNm></relFNm>
<relMNm></relMNm>
<relLNm>-</relLNm>
<relStDt>12-jun-2008</relStDt>
<relEnDt></relEnDt>
<relSta>01 </relSta>
</relEntry><relEntry>
<seqNum>2</seqNum>

like this SeqNum generates [depend on relAcc(0002-09891824205) repetition may be 14 or 12 or 10 times]

example relAcc(0002-09891824205) is repeated 14 times then <seqNum> generates 14 that is <seqNum>14</seqNum>

again relAcc(0003-09891824205) <seqNum> 1 starts <--- before this <seqnum> <accEntry> has to closed with </accEntry> tag

<relCust> is key
srinivas Guduru
Premium Member
Premium Member
Posts: 38
Joined: Sat Dec 29, 2007 9:58 am

Re: can you please lookinto this

Post by srinivas Guduru »

hi this is my sample output
srinivas Guduru wrote:[<accList>
<accEntry>
<msgId>A1111</msgId>
<sysId>VGI</sysId>
<actInd>2</actInd>
<accNum>0002-09891824205</accNum>
<accDtls>
<modInd>Securities</modInd>
<custId>CIF5849794</custId>
<accTyp>16</accTyp>
<brchAcc>USA</brchAcc>
<accOpDt>12-jun-2008</accOpDt>
<accSta>01 </accSta>
<accClDt>31-dec-9999</accClDt>
<ownTyp>1</ownTyp></a
ccDtls><relList><relEntry>
<seqNum>1</seqNum>
<relTyp>50</relTyp>
<relCust>1313536716</relCust>
<relAcc>0002-09891824205</relAcc>
<relFNm></relFNm>
<relMNm></relMNm>
<relLNm>-</relLNm>
<relStDt>12-jun-2008</relStDt>
<relEnDt></relEnDt>
<relSta>01 </relSta>
</relEntry><relEntry>
<seqNum>2</seqNum>

like this SeqNum generates [depend on relAcc (0002-09891824205) repetition seqnum may be 14 or 12 or 10 ]
example relAcc(0002-09891824205) is repeated 14 times then <seqNum> generates 14 that is <seqNum>14</seqNum>

again relAcc(0003-09891824205) <seqNum> 1 </seqNum> starts before this seqnum(1) starts <accEntry> has to be closed with </accEntry> tag

<relCust> is key
Can any one give me the solution

Thanks

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

Post by eostic »

Hard to say...not understanding yet what you are looking for......so far it looks like it is working just fine. relEntry is inside of relList and relList hasn't closed yet.... after ALL the relEntry elements for that relList, you should see a close of </relList> and then finally a close of </accEntry>.

Are you expecting </accEntry> to close sooner?

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
prakashdasika
Premium Member
Premium Member
Posts: 72
Joined: Mon Jul 06, 2009 9:34 pm
Location: Sydney

Post by prakashdasika »

The opening and closing of tags should be defined properly in XML path expressions that we state with each column in the XMLOutput stage. How did you define them?

Are you using a transformer to manually create the tags?
Prakash Dasika
ETL Consultant
Sydney
Australia
Post Reply