XML output problem

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
visgtm
Participant
Posts: 6
Joined: Wed Jan 02, 2008 2:36 am
Location: Pune India
Contact:

XML output problem

Post by visgtm »

Hi,
I have to convert a sequential file into a xml file. I am using Seq file -> XML output stage. The input seq file format is like:

"1231","19:30","2008-09-28","2008-09-28","NY","Free Flowing Text","RuleSet","24534264224"
"1235","19:30","2008-09-28","2008-09-28","NY","Free Flowing Text","RuleSet","98795733525"
"1232","19:30","2008-09-28","2008-09-28","NY","Free Flowing Text","RuleSet1","GT644224445"
"1236","19:30","2008-09-28","2008-09-28","NY","Free Flowing Text","RuleSet","AE232354566
"1237","19:30","2008-09-28","2008-09-28","NY","Free Flowing Text","RuleSet","24526278776"
"1230","19:30","2008-09-28","2008-09-28","NY","Free Flowing Text","RuleSet","T4569673234"
"1232","19:30","2008-09-28","2008-09-28","NY","Free Flowing Text","RuleSet1","HT653345244"

I want the output xml file to contain the securityid's of a particular ruleset
inside one RuleSet tag like below:


<RuleSetContainer ruleSetName="RuleSet">
<SecurityID type="ID">AE232354566</SecurityID>
<SecurityID type="ID">24534264224</SecurityID>
<SecurityID type="ID">24526278776</SecurityID>
<SecurityID type="ID">98795733525</SecurityID>
<SecurityID type="ID">T4569673234</SecurityID>
</RuleSetContainer>


<RuleSetContainer ruleSetName="RuleSet1">
<SecurityID type="ID">GT644224445</SecurityID>
<SecurityID type="ID">HT653345244</SecurityID>
</RuleSetContainer>

But i am getting separate RuleSet tag for each securityid's. Please help me solving the problem.

Thanks in advance.
shaonli
Participant
Posts: 80
Joined: Tue Nov 28, 2006 6:52 am

Post by shaonli »

Please check the box Repeatation element required and Set Security_Level_Id as key.
shaonli
Participant
Posts: 80
Joined: Tue Nov 28, 2006 6:52 am

Post by shaonli »

Please check the box Repeatation element required in XML Output stage and Set SecurityId as key.
It will work.

Thanks
Shaonli
visgtm
Participant
Posts: 6
Joined: Wed Jan 02, 2008 2:36 am
Location: Pune India
Contact:

Post by visgtm »

Thanks for the reply..

but already i have made the chk on Aggregate all rows, and the securityid is the key column.

what i am getting is 3 securityids inside one ruleset tag, then other 2 securityids inside other ruleset tag, then again remaining 2 securityids inside one ruleset tag. How we can club securityids of one ruleset type together.
csri
Participant
Posts: 99
Joined: Wed Jul 11, 2007 8:02 am

Post by csri »

From the input sequential file sort the data using ruleset as sort key and then pass it through the XMLOutput stage. It worked for me. It should work for you.
csri
Participant
Posts: 99
Joined: Wed Jul 11, 2007 8:02 am

Post by csri »

SeqFileStage--->SortStage---->XMLOutputStage
(sort by ruleset)
shaonli
Participant
Posts: 80
Joined: Tue Nov 28, 2006 6:52 am

Post by shaonli »

Yes sorting is required because grouping will done as records appears to that stage.By sorting data it will work.It worked in my job.
Thakns
Shaonli
visgtm
Participant
Posts: 6
Joined: Wed Jan 02, 2008 2:36 am
Location: Pune India
Contact:

Post by visgtm »

Thanks all,
Its working for me.
Post Reply