Record Formation

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
pavan_test
Premium Member
Premium Member
Posts: 263
Joined: Fri Sep 23, 2005 6:49 am

Record Formation

Post by pavan_test »

Hi All,

Can someone please tell me how do I accomplish the following in datastage 8.1 version.

incoming record:

colA COLB ColD
1 2 3

expected output:

COL E:
1
2
3


incoming record:

colA COLB ColD
1 1 1

expected output:

COL E:
1

incoming record:

colA COLB ColD
1 1 2

expected output:

COL E:
1
2

incoming record:

colA COLB ColD
2 1 1

expected output:

COL E:
2
1

incoming record:

colA COLB ColD
1 2 1

expected output:

COL E:

1
2

Thanks
Pavan
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

So... what are your thoughts on this? What have you tried so far?

To me it looks like a normal horizontal pivot with an extra check for repeated values that should be constrained out of the flow. All except for the last one where it makes it look like you need to sort the output before the duplicate check is done. But that would mess up the next-to-last example.

Are your examples 100% correct?
-craig

"You can never have too many knives" -- Logan Nine Fingers
pavan_test
Premium Member
Premium Member
Posts: 263
Joined: Fri Sep 23, 2005 6:49 am

Record Formation

Post by pavan_test »

I am new to datastage. I did not write any code for horizontal pivot in the past. Looking for thoughts.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

It looks like your expected output could be achieved with 2 stages:

1. As Craig already mentioned, do a simple horizontal pivot
2. Perform a unique sort on your resultant data on the output Col E

If you start with the horizontal pivot stage and get that to function as you expect then you can decide how to approach the second part where you filter out the duplicates. If order isn't important then the unique sort will solve your issues, if not then we'll have to use a different approach.
Post Reply