Transpose the table

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
rafik2k
Participant
Posts: 182
Joined: Wed Nov 23, 2005 1:36 am
Location: Sydney

Transpose the table

Post by rafik2k »

Hi,
I am in process of creating one job where I need to transponse a table i.e. row into column and column into row.

For example, input is like this

Table col1 col2 col3
row1 10 20 30
row2 15 35 45
row3 25 55 65


output would be like this:
Table col1 col2 col3
row1 10 15 25
row2 20 35 55
row3 30 45 65

Thanks in advance for any tips or links to pasts posts that might help.
Last edited by rafik2k on Tue May 08, 2007 8:25 am, edited 1 time in total.
rafik2k
Participant
Posts: 182
Joined: Wed Nov 23, 2005 1:36 am
Location: Sydney

Post by rafik2k »

Initially I thought that pivot stage would help, but having checked privot stage I found that it's for different requirement.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Search the forum for "vertical pivot". It may be easier, if your database has one, to use a table transpose function.
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