rows to column

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
shwetha.st
Participant
Posts: 5
Joined: Tue Mar 27, 2007 10:56 pm
Location: Bangalore

rows to column

Post by shwetha.st »

Hi all

I rows something like this A B C D and i want it like
A
B
C
D

iam trying to use a pivot but i am getting the output same as that of the input.
I am not able to see any options in Pivot so that i can change.
It is having just the STAGE,INPUT and OUTPUT.Where can i set the things which will work can anyone help me out.

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

Post by ray.wurlod »

Read the manual for the Pivot stage (pivot.pdf).
You may need to create an artificial pivot key column upstream of the Pivot stage, and discard it afterwards.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Columns to rows, actually. As an alternative, check this post.
-craig

"You can never have too many knives" -- Logan Nine Fingers
baglasumit21
Participant
Posts: 132
Joined: Wed Mar 01, 2006 11:12 pm
Location: Pune

Re: rows to column

Post by baglasumit21 »

shwetha.st wrote:Hi all

I rows something like this A B C D and i want it like
A
B
C
D

iam trying to use a pivot but i am getting the output same as that of the input.
I am not able to see any options in Pivot so that i can change.
It is having just the STAGE,INPUT and OUTPUT.Where can i set the things which will work can anyone help me out.

Thanks in advance
Try This using stage variable if u r writing a file
stage Derivation
variable
name

stg1 inputlink (say A B C D)
stg2 char(10)


now outputlink.colname derivation will be

ereplace(stg1," " , stg2)
SMB
rafik2k
Participant
Posts: 182
Joined: Wed Nov 23, 2005 1:36 am
Location: Sydney

Re: rows to column

Post by rafik2k »

baglasumit21 wrote:
shwetha.st wrote:Hi all

I rows something like this A B C D and i want it like
A
B
C
D

iam trying to use a pivot but i am getting the output same as that of the input.
I am not able to see any options in Pivot so that i can change.
It is having just the STAGE,INPUT and OUTPUT.Where can i set the things which will work can anyone help me out.

Thanks in advance
Try This using stage variable if u r writing a file
stage Derivation
variable
name

stg1 inputlink (say A B C D)
stg2 char(10)


now outputlink.colname derivation will be

ereplace(stg1," " , stg2)
Have you tested your logic?
This will work perfectly if source column1 ="A B C D", that is for a single string.

But here Data shows there are four columns, so in this case it won't work.
U have to duplicate this logic for every input column.
Post Reply