Scenario in Datastage

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

Post Reply
SagarMelam
Participant
Posts: 26
Joined: Mon Apr 21, 2008 4:03 am
Location: Amalapuram

Scenario in Datastage

Post 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
Sagar
Thomas.B
Participant
Posts: 63
Joined: Thu Apr 09, 2015 6:40 am
Location: France - Nantes

Post 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.
BI Consultant
DSXConsult
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Pivot stage (rows to columns).
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