Problem with Pivot stage

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
mydsworld
Participant
Posts: 321
Joined: Thu Sep 07, 2006 3:55 am

Problem with Pivot stage

Post by mydsworld »

I have the following input :

sr_no
1
2
3

I would like my output to become like this :

sr_no1 sr_no2 sr_no3
1 2 3

How shd I do that. Is it with Pivot ? I tried to use Pivot stage like this :

Row Generator -> Pivot -> Data set

Row generator is geneating those 3 rows.Then my output file was defined with 3 columns.But the jobs runs but I see no data in output.

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

Post by ray.wurlod »

A Pivot stage goes the other way (columns to rows). What you are attempting to achieve is called a "vertical pivot" (rows to columns). There are several ways to achieve a vertical pivot in DataStage - a Search of DSXchange will reveal them.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
mydsworld
Participant
Posts: 321
Joined: Thu Sep 07, 2006 3:55 am

Post by mydsworld »

I tried the Horizontal pivot with Pivot stage :

File -> Pivot stage -> File

The job runs successfully but there is no data in output file. I get the following warning in director log :

Pivot_1,0: Info: Test_Pivot.Pivot_1: Cannot map output derivation of column 'Sr_No' to any input column.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

A Pivot stage will not help your requirement.
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