splitting sub records!!!

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
allavivek
Premium Member
Premium Member
Posts: 211
Joined: Sat May 01, 2010 5:07 pm

splitting sub records!!!

Post by allavivek »

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
Premium Member
Posts: 37
Joined: Tue Oct 27, 2009 9:43 pm

Re: splitting sub records!!!

Post by DSShishya »

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
Premium Member
Posts: 211
Joined: Sat May 01, 2010 5:07 pm

Re: splitting sub records!!!

Post by allavivek »

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
Premium Member
Posts: 37
Joined: Tue Oct 27, 2009 9:43 pm

Re: splitting sub records!!!

Post by DSShishya »

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
Premium Member
Posts: 37
Joined: Tue Oct 27, 2009 9:43 pm

Re: splitting sub records!!!

Post by DSShishya »

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 »

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.
Post Reply