XML OUTPUT

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

karry450
Participant
Posts: 201
Joined: Wed Nov 14, 2007 11:31 pm
Location: HYD

XML OUTPUT

Post by karry450 »

Hi Friends,

My source is a flat file and output is xml output stage.

targeted output is :
<fileUpdate version="1" program="2" vendor="1" createDate="2010-12-07 06:52:14" serviceType="2">
0000000000000000001.
<fileList>
<file preReqFile="" id="1086734.10251.0.Z" sum="3574437120">
<store ncpdp="1086734"></store>
</file>
<file preReqFile="" id="1614608.10250.0.Z" sum="879672064">
<store ncpdp="1614608"></store>
</file>
</fileList>
</fileUpdate>




My output:
<fileUpdate version="1" program="2" vendor="1" createDate="2010-12-07 06:52:14" serviceType="2">
0000000000000000001.
<fileList>
<file preReqFile="" id="1086734.10251.0.Z" sum="3574437120">
<store ncpdp="1086734"></store>
</file>
</fileList>
</fileUpdate>
<fileUpdate version="1" program="2" vendor="1" createDate="2010-12-07 06:52:14" serviceType="2">
0000000000000000001.
<fileList>
<file preReqFile="" id="1614608.10250.0.Z" sum="879672064">
<store ncpdp="1614608"></store>
</file>
</fileList>
</fileUpdate>


Can any one help me how to acheive this.

Just to make it easy my targetted output is writing one header and one footer for whole lot of records.
But when I run my ds job my output is writing one header and one footer for each and every record.

Thanks
samyamkrishna
Premium Member
Premium Member
Posts: 258
Joined: Tue Jul 04, 2006 10:35 pm
Location: Toronto

Re: XML OUTPUT

Post by samyamkrishna »

Hi,

go through the xmlbestpractices.zip which is located at the site http://Duke-Consulting.com
karry450
Participant
Posts: 201
Joined: Wed Nov 14, 2007 11:31 pm
Location: HYD

Re: XML OUTPUT

Post by karry450 »

Hi Friends,

Im getting this message on top of my xml file,
<?xml version="1.0" encoding="ISO-8859-1"?>
Can anyone help me/suggest how to remove this message from the file

regards
goutam
Vignesh Shanmugam
Participant
Posts: 10
Joined: Mon Feb 22, 2010 1:58 am
Location: Chennai

Re: XML OUTPUT

Post by Vignesh Shanmugam »

In XML Output Stage Go to
1).Output tab
2).Click on Comment Tab
3).check in the Include Check box.

This will remove the header


-Vignesh
karry450
Participant
Posts: 201
Joined: Wed Nov 14, 2007 11:31 pm
Location: HYD

Re: XML OUTPUT

Post by karry450 »

Hi Vignesh,

I have tried this , This is xml output stage , i have checked comment in stage tab --->document settings tab but doesnt remove the header
can you please suggest if there is any other way.

Thanks
samyamkrishna
Premium Member
Premium Member
Posts: 258
Joined: Tue Jul 04, 2006 10:35 pm
Location: Toronto

Re: XML OUTPUT

Post by samyamkrishna »

How many XML Output stages do you have.

You have unchek the Include comment in all the XML output stages.
karry450
Participant
Posts: 201
Joined: Wed Nov 14, 2007 11:31 pm
Location: HYD

Re: XML OUTPUT

Post by karry450 »

Hi krishna,

I have only one output stage, I have unchecked and checked doesnt may any difference. Still showing the header

Any other options to do please help

Thanks
Goutam
samyamkrishna
Premium Member
Premium Member
Posts: 258
Joined: Tue Jul 04, 2006 10:35 pm
Location: Toronto

Re: XML OUTPUT

Post by samyamkrishna »

Can you post the xml here. I would like to have a look.
karry450
Participant
Posts: 201
Joined: Wed Nov 14, 2007 11:31 pm
Location: HYD

Re: XML OUTPUT

Post by karry450 »

Hi Krishna,

<?xml version="1.0" encoding="ISO-8859-1"?>
<fileUpdate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1" program="XXXX" vendor="XXXXX" createDate="2010-12-10 01:50:11" serviceType="2">
<fileList>
<file sum="3574437120" preReqFile="" id="100000.00000.0.Z">
<store ncpdp="000000"/>
</file>
</fileList>
</fileUpdate>

The one in bold I want to remove that and I want to add the below as header.

<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>

Can you please suggest how can I achieve this.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Ereplace() in a downstream Transformer stage.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
karry450
Participant
Posts: 201
Joined: Wed Nov 14, 2007 11:31 pm
Location: HYD

Post by karry450 »

Hi Ray,

This is no the input column this header is generated in xml oupt stage which is my target as

<?xml version="1.0" encoding="ISO-8859-1"?> where as I want it to be as

<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>

which I can add in the header tab if I can remove the default header
<?xml version="1.0" encoding="ISO-8859-1"?>

thanks
samyamkrishna
Premium Member
Premium Member
Posts: 258
Joined: Tue Jul 04, 2006 10:35 pm
Location: Toronto

Post by samyamkrishna »

You can remove it by checking generate XML chunk

Try it out
karry450
Participant
Posts: 201
Joined: Wed Nov 14, 2007 11:31 pm
Location: HYD

Post by karry450 »

Hi Krishna,

I can remove it by checking generate XML chunk but I can add my own header, The header tab diappears when we check box for generate xml chunk.
samyamkrishna
Premium Member
Premium Member
Posts: 258
Joined: Tue Jul 04, 2006 10:35 pm
Location: Toronto

Post by samyamkrishna »

I guess the only way to do it add another column before the XML Output stage and hardcode it with your value.

<?xml version="1.0" encoding="ISO-8859-1"?>
samyamkrishna
Premium Member
Premium Member
Posts: 258
Joined: Tue Jul 04, 2006 10:35 pm
Location: Toronto

Post by samyamkrishna »

You might hav eto wait for eostics reply on this post.
Post Reply