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
allavivek
Premium Member
Posts: 211 Joined: Sat May 01, 2010 5:07 pm
Post
by allavivek » Fri Jul 23, 2010 10:46 am
Hi All,
I was trying to split subrecords as below..
Code: Select all
result first second
1 (1,aaa,bbb,) (3,aaa,bbb)
I was using promote subrecord stage...i can only give one parent column in this stage(first) but iam having two parent columns(first and second) ....Another question is how should be the output columns given???
DSShishya
Premium Member
Posts: 37 Joined: Tue Oct 27, 2009 9:43 pm
Post
by DSShishya » Fri Jul 23, 2010 12:15 pm
Its kind of difficult to understand your requirement. Can you please elaborate more or put the records and result in a orderly manner?.
allavivek
Premium Member
Posts: 211 Joined: Sat May 01, 2010 5:07 pm
Post
by allavivek » Fri Jul 23, 2010 12:39 pm
DSShishya wrote: Its kind of difficult to understand your requirement. Can you please elaborate more or put the records and result in a orderly manner?.
i/p data is below...actually its an output data from compare stage...
Code: Select all
result first last
1 (1,aaa,bbb) (3,aaa,bbb)
1 (3,fff,ggg) (5,ffff,gggg)
o/p should be
Code: Select all
result col1 col2 col3 col4 col5 col6
1 1 aaa bbb 3 aaa bbb
1 3 fff ggg 5 ffff ggg
DSShishya
Premium Member
Posts: 37 Joined: Tue Oct 27, 2009 9:43 pm
Post
by DSShishya » Fri Jul 23, 2010 12:58 pm
Looks very simple.
Use the String function "Index" on the "first" and "last" columns of the input in order to get the desired output in col2,col3...
Refer the developer's guide for syntax on the "Index" function.
DSShishya
Premium Member
Posts: 37 Joined: Tue Oct 27, 2009 9:43 pm
Post
by DSShishya » Fri Jul 23, 2010 1:52 pm
I'm sorry, that would be the "Field" function, not the Index.
ray.wurlod
Participant
Posts: 54607 Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:
Post
by ray.wurlod » Fri Jul 23, 2010 4:00 pm
Two subrecords ---> two Promote/Split Subrecord stages.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.