Converting 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
chitravallivenkat
Participant
Posts: 106
Joined: Thu Jun 08, 2006 8:51 am

Converting rows to columns

Post by chitravallivenkat »

Can any one suggest me how to convert rows into column.
i have addresses field in the source with an seq_num as key column in that table. the following i have illustrate how the input is and my output should look like

INPUT
seq_num address1
1 no 291
2 I st floor
3. Nandini Apartment
4. shivajinagar
5. Bangalore


OUTPUT should be
Orgl_add1 Orgl_add2 Orgl_add3 Orgl_add4 Orgl_add5

no 291 I st floor Nandini Apartment shivajinagar Bangalore

So plz help me out in resolving the above query...
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

What you are asking about is called a "vertical pivot". Searching DSXchange will yield at least three different ways to accomplish vertical pivoting in DataStage server jobs.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chitravallivenkat
Participant
Posts: 106
Joined: Thu Jun 08, 2006 8:51 am

Post by chitravallivenkat »

First of all let me thanks u for ur rpy...
but how we implement this in vertical pivoting... I am new to datastage so plz advice me
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

As noted, search the forums for the phrase "vertical pivot". The how to implement part has been posted many times out there.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

U is one of our posters (and a reasonably common Burmese name), Ur was a city in ancient Babylon, and rpy presumably is an abbrevation for revolutions per year. Plz might be a town in the Balkans.

Please use a professional standard of English when posting on DSXchange; it makes it easier for everyone.
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