Rows to Columns

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
cherry
Participant
Posts: 108
Joined: Sun Jul 10, 2005 1:35 am

Rows to Columns

Post by cherry »

Dear All,
I have a scenario as below:

Input data:

IDNumber Code
12345 1001
12345 1006
12345 2001
67891 1003
67891 1004
67891 1006
67891 2001
67891 2004
67891 2008
13579 1001
13579 1002
13579 1007
13579 2001

This is what I want as output data:

IDNumber Code1 Code2 Code3 Code4 Code5 Code6
12345 1001 1006 2001
67891 1003 1004 1006 2001 2004 2008
13579 1001 1002 1007 2001

Does anyone have any idea how I can do this?

Thanks for your anticipated co operation

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

Post by ray.wurlod »

This is a vertical pivot.

Techniques have been discussed here ad nauseam.
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