Pivot stage issue

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
shaonli
Participant
Posts: 80
Joined: Tue Nov 28, 2006 6:52 am

Pivot stage issue

Post by shaonli »

Hi My I/p is
Id name sal
1 A 1000
2 B 2000
3 C 3000

O/p is
VAL
1
A
1000
2
B
2000
3
C
3000

since I Don't have any key on which basis I can do pivoting.SO how will I configure pivot stage.
Please suggest.

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

Post by ray.wurlod »

Code: Select all

source ---> Transformer ---> Sequential File
In the Transformer stage create a single output VarChar as

Code: Select all

Id : svLF : name : svLF : sal
Stage variable svLF is initialized to Char(10) and is not assigned a value for each row processed.

The sequential file will have three rows for each row that you write to it.

An alternative approach would be to create a pivot key in an upstream Column Generator stage.
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