Converting from rows to Columns

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
Sandeepch19
Participant
Posts: 36
Joined: Fri May 21, 2010 12:40 am
Location: Bangalore

Converting from rows to Columns

Post by Sandeepch19 »

HI,

I need to convert from rows to column inorder to create derive columns
for eq:
ID NAME ATTR_NAME ATTR_VALUE

12521 GENERAL TEMPLATE NAME V
12521 GENERAL RF ZONE TBD

Output should be
ID TEMPLATE NAME RF ZONE
12521 V TBD
Please let me know how to do this using stage variable.. or any other method is there for this..

Thank you
Sandeep Chandrashekar
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

An exact search here for 'vertical pivot' will turn up your options. In Server, a hashed file can make this process pretty simple as well.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Sandeepch19
Participant
Posts: 36
Joined: Fri May 21, 2010 12:40 am
Location: Bangalore

Thanks , it's working

Post by Sandeepch19 »

Thanks Craig, i have used a logic which will compare current id and previous id and also i have used hash file to produce the output...it's working now..

but my concern is i have 43 derived columns like this...does this slow down the performance.. if so could you give me the tips to counter that..
Sandeep Chandrashekar
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Everything additional you do must necessarily degrade performance. Do only that which you must do.
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