XML Input 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
ag_ram
Premium Member
Premium Member
Posts: 524
Joined: Wed Feb 28, 2007 3:51 am

XML Input Stage

Post by ag_ram »

Hi,

I have an XML as follows

<dept>
<sector value="Delete">
<User Name = "xx112"/>
<User Name = "xx113"/>
</sector>
<sector value="Create">
<User Name = "xx114"/>
<User Name = "xx115"/>
</sector>
</dept>

My requirement is to get Users under Sector Value = delete in one file and the users under Sector Value = create under one file.
My flow is like

Seq file stage ---> XML input stage----->Seq/Dataset

Output link of XML input stage is showing 4 records(2 under delete+2 under create) but those records are not seen in the output textfile, i tried using Seq file stage to write to a text file and also a Dataset stage to write to a dataet file, i am getting 4 empty lines created in both the cases.
pls let me know if its possible to get the sector users in 2 different files, please help.
PS:i am using description /dept in input column of XML input stage and /dept/sector/user/text() in output column with user as key.
ag_ram
Premium Member
Premium Member
Posts: 524
Joined: Wed Feb 28, 2007 3:51 am

Post by ag_ram »

Hi,

I got a way to do it. i am using two output columns in XML input stage.

/dept/sector/@value
/dept/sector/user/@Name

then i am using a filter to split into diff files.

Thanks!
Post Reply