converting multiple rows to single row!!

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
G.K.K
Participant
Posts: 61
Joined: Tue May 13, 2008 6:54 am

converting multiple rows to single row!!

Post by G.K.K »

hi,

please help in solving this problem....

1.The input file contains the following records,

column1, column2 , column3 , column4
1 , _ , _ , _
_ , 2 , _ , _
_ , _, 3 , _
_ , _ , _ , 4

*here underscore( _ ) indicates null value..

2.The output file must contain all the values of input file in a single row as shown below,

column1, column2 , column3 , column4
1 , 2 , 3 , 4


To achieve this what is the condition that i have to implement in transformer or whether i have write a stage variable?

Thanks in advance and greatful to them ,if any one help me in solving this problem :)
Cr.Cezon
Participant
Posts: 101
Joined: Mon Mar 05, 2007 4:59 am
Location: Madrid

Post by Cr.Cezon »

Hi,

you can use an agregator stage.
if not required values are null, then you can use Max(col)

regards,
Cristina.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Always four? Stage variables can solve this rather easily if that's the case.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply