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
kavuri
Premium Member
Premium Member
Posts: 161
Joined: Mon Apr 16, 2007 2:56 pm

pivot stage

Post by kavuri »

Hi,
I never used pivot stage. I am trying how to use this. Here below I took a sample scenario.

Input file:

11,22,33,44,55

I defined the schema as

a INTEGER
b INTEGER
c INTEGER
d INTEGER
e INTEGER

Now I am trying to pivot this so that I can get 5 rows in one column.

I studied in our forum that we need to define derivation field in the grid. But exactly how to define I couldnot understand.

I am having pivot stage in my palette, but I dont have a pdf. If you can point some location for pdf. It will be helpful for me.

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

Post by ray.wurlod »

Wherever your DataStage client is installed (for example C:\Program Files\Ascential\DataStage) there is a sub-folder called Docs. It is in the Docs folder that you will find Pivot.pdf.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kavuri
Premium Member
Premium Member
Posts: 161
Joined: Mon Apr 16, 2007 2:56 pm

Post by kavuri »

Got it in docs.

Thanks
Kavuri
kavuri
Premium Member
Premium Member
Posts: 161
Joined: Mon Apr 16, 2007 2:56 pm

Post by kavuri »

I had gone through the documents, and developed a sample job. But it is aborting due to the following reason. I searched the site for this error but in didnot result anything.

main_program: Fatal Error: Fatal: Shared library (pivotenu.so) failed to load: errno = (2), system message = (/opt/IBM/Ascential/DataStage/DSEngine/lib/pivotenu.so: undefined symbol: DSCUVTextMark)

Can anybody tell me what is this error?

Thanks
Kavuri
krisna
Participant
Posts: 77
Joined: Tue Apr 08, 2008 11:33 pm

Post by krisna »

in pivot stage properties,

select outputs tab -> select columns -> give the single column name as 'col1' -> in derivation give all the input column names separated by a space.

for ex : -

Column name | group | Derivation | key | SQL Type

col1 a b c d e integer

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

Post by ray.wurlod »

Describe the failing job design. In particular are you doing anything to the data upstream of the Pivot 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.
Prabhakar
Participant
Posts: 10
Joined: Mon Apr 02, 2007 6:28 pm
Location: Melbourne

Post by Prabhakar »

you can achieve the result via using column import and pivot stage

for e.g

column1 Column2
12 1,2,3,4,5
13 5,4,3,2,1



Using colum import stage split the comma oriented data in to seperate columns

column1 iclmn1 iclmn2 iclmn3 iclmn4 iclmn5
12 1 2 3 4 5
13 5 4 3 2 1


Now use the Pivot State, in the output tab of the pivot stage specify the all the 5 column with comma oriented to the column you want to pivot

for eg:
column1
Clmn3 iclmn1,iclmn2,iclmn3,iclmn4,iclmn5
Output Expected

column1 Clmn3
12 1
12 2
12 3
Post Reply