COMBINE 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
PTL
Participant
Posts: 1
Joined: Thu May 07, 2009 9:36 am

COMBINE RECORDS

Post by PTL »

I have data in multiple rows that I want to combine as multiple columns in a row. While the 'combine records' worked and did combine the rows into the subrec column, I do not know how to split out this subrec to populate into multiple columns in a row.

Here is an example of my input data before 'combine record':

key data
1 aaaa
1 bbbb
1 cccc
1 dddd

After 'combine record' the view from the dataset looks like this:

key subrec
1 [() () () ()]

What stage do I use to name each section of the subrec? I've tried 'split vector', 'split subrecord' and transform without success.

p.s. I do not see a 'Vertical' option on the PIVOT stage. It is only for horizontal pivot.

Any suggestion that would make this work would be appreciated.

PTL
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Welcome aboard.

Please post the record schema of your output link. Are you using runtime column propagation?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
nirdesh2
Participant
Posts: 56
Joined: Thu Nov 20, 2008 12:18 pm
Location: Noida

Post by nirdesh2 »

You can use stage vaaiables in Transforme to implement this logic. Compare the currect record with previous record and concate the value in one column till keys are same and then you can use Column import and remove duplicate stage to remove duplicate record and retain the last record..
Nirdesh Kumar
rameshrr3
Premium Member
Premium Member
Posts: 609
Joined: Mon May 10, 2004 3:32 am
Location: BRENTWOOD, TN

Post by rameshrr3 »

Sorry for replying to such an old post . But I've verified if you define the nested level columns ( level 02 columns of sub rec) in the combine subrecords stage , it works perfectly , and would be pretty useful to do vertical pivoting in conjunction with a column export stage - especially with older versions of datastage ( < v8.5) . The key is to define metadata correctly - especially the vector occurs property ( I tested with variable length vectors) . The Col Export stage is fussy about specifying the vector prefix for a variable length vector field.
Post Reply