Page 1 of 1

Scenario in Datastage

Posted: Wed Nov 18, 2015 10:14 am
by SagarMelam
Hi ,

I have below scenario.

we receive data from a file as below

Record
col1
col2
col3
col4
col5
Record
col1
col2
col3
col4
col5
The same pattern continues ..and it should be loaded into table as below
Record col1 col2 col3 col4 col5.
Please advice me

Posted: Wed Nov 18, 2015 11:39 am
by Thomas.B
You can do that transformation using a looping transformer :

Create 6 stages variables as below

Code: Select all

SvRecord : If @ITERATION = 0 Then Ln_Input.InputCol Else SvRecord
SvCol1   : If @ITERATION = 1 Then Ln_Input.InputCol Else SvCol1
Etc...
Then loop while @ITERATION < 6, create 6 fields ( Record,col1,col2,col3,col4 and col5) and use the associated stage variable as derivation.

Posted: Wed Nov 18, 2015 3:57 pm
by ray.wurlod
Pivot stage (rows to columns).