How to convert each row into a column

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

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

Post by ray.wurlod »

Harini, you're off track. You don't need to do this. The answer is encapsulated in my earlier post on this thread.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Harini
Premium Member
Premium Member
Posts: 80
Joined: Tue Mar 16, 2010 1:32 am

Post by Harini »

Oh, yes. Got it. Thanks!
spemma123
Premium Member
Premium Member
Posts: 17
Joined: Tue Feb 08, 2011 12:28 am

Post by spemma123 »

Hi Harini....thanks for the reply, i think this logic will work, but how can I split the file into two ?

I tried using @INROWNUM in stage variable like below. Created stage variables for all the first nine rows and sending it to a seperate file....but what should i mention after else condition, i just dont want to read the row if it is not the 1st one ? Iam doing this in sequential mode.

TRANSFORMER
DERIVATION STAGE VARIABLE
IF @INROWNUM=1 then LkFrm_Src_Seq_Inserts.column1 else ? col1
IF @INROWNUM=2 then LkFrm_Src_Seq_Inserts.column1 else ? col2
IF @INROWNUM=3 then LkFrm_Src_Seq_Inserts.column1 else ?col3
IF @INROWNUM=4 then LkFrm_Src_Seq_Inserts.column1 else ? col4
IF @INROWNUM=5 then LkFrm_Src_Seq_Inserts.column1 else ? col5
IF @INROWNUM=6 then LkFrm_Src_Seq_Inserts.column1 else ? col6
IF @INROWNUM=7 then LkFrm_Src_Seq_Inserts.column1 else ? col7
IF @INROWNUM=8 then LkFrm_Src_Seq_Inserts.column1 else ? col8
IF @INROWNUM=9 then LkFrm_Src_Seq_Inserts.column1 else ? col9
spemma123
Premium Member
Premium Member
Posts: 17
Joined: Tue Feb 08, 2011 12:28 am

Post by spemma123 »

Hi Ray

I tried using @INROWNUM in stage variable like below. Created stage variables for all the first nine rows....but what should i mention after else condition, i just dont want to read the row if it is not the 1st one ? Iam doing this in sequential mode.

TRANSFORMER
DERIVATION STAGE VARIABLE
IF @INROWNUM=1 then LkFrm_Src_Seq_Inserts.column1 else ? col1
IF @INROWNUM=2 then LkFrm_Src_Seq_Inserts.column1 else ? col2
IF @INROWNUM=3 then LkFrm_Src_Seq_Inserts.column1 else ? col3
IF @INROWNUM=4 then LkFrm_Src_Seq_Inserts.column1 else ? col4
IF @INROWNUM=5 then LkFrm_Src_Seq_Inserts.column1 else ? col5
IF @INROWNUM=6 then LkFrm_Src_Seq_Inserts.column1 else ? col6
IF @INROWNUM=7 then LkFrm_Src_Seq_Inserts.column1 else ? col7
IF @INROWNUM=8 then LkFrm_Src_Seq_Inserts.column1 else ? col8
IF @INROWNUM=9 then LkFrm_Src_Seq_Inserts.column1 else ? col9
spemma123
Premium Member
Premium Member
Posts: 17
Joined: Tue Feb 08, 2011 12:28 am

Post by spemma123 »

Never mind it worked with below logic in the stage var

IF @INROWNUM=1 then LkFrm_Src_Seq_Inserts.column1 else stgvar:''
Post Reply