Datastage EE

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
pavans
Participant
Posts: 116
Joined: Sun Sep 10, 2006 7:33 am
Location: bangalore, india

Datastage EE

Post by pavans »

Hi
My source is oracle table and columns are:
elmt_i,node_i,name
1,10,a
1,10,b
1,10,c
1,10,d
2,10,a
2,10,b
3,10,c
3,10,d

Mytarget is oracle table and result should be:
elmt_i,node_i,name
1,10,abcd
1,10,abcd
1,10,abcd
1,10,abcd
2,10,ab
2,10,ab
3,10,cd
3,10,cd
i.e. based on elmt_i i have to concatenate the name column.
How can i do this datastage. can u explain me the logic and the stage tobe used.

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

Post by ray.wurlod »

Sort data on the first two columns, have the Sort stage generate a Key Change column.
In a Transformer stage use stage variables to accumulate the third column, and use the Key Change column to trigger sending a row to the output link.
Be careful to partition your data based on the sort keys.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
pavans
Participant
Posts: 116
Joined: Sun Sep 10, 2006 7:33 am
Location: bangalore, india

Post by pavans »

ray.wurlod wrote:Sort data on the first two columns, have the Sort stage generate a Key Change column.
In a Transformer stage use stage variables to accumulate the third column, and use the Key Change column to trigg ...
Hi Ray,
Can u explain me little more detial.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Not really, what was unclear?

I note that you don't have premium membership so can't read the entire post. So even if I posted a more complete answer, you'd still only be able to see the first 200 or so characters of it.

Read the help or the manuals about each of the stages I've referred to, and stay alert for the terms I've used. It should become clearer just from that.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
pavans
Participant
Posts: 116
Joined: Sun Sep 10, 2006 7:33 am
Location: bangalore, india

Post by pavans »

ray.wurlod wrote:Not really, what was unclear?

I note that you don't have premium membership so can't read the entire post. So even if I posted a more complete answer, you'd still only be able to see the first 200 or so characters of it.

Read the help or the manuals about each of the stages I've referred to, and stay alert for the terms I've used. It should become clearer just from that.

Hi Ray,
I used Sort Stage and Then Transformer. But could not solve the problem.
I have taken 3 stage variables.
But unable to get the logic.
can u please give me the detials again.

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

Post by ray.wurlod »

Use a Sort stage to partition and sort on elmt_i and node_i, and to generate a fourth column called key_changed using the Sort Key Change property.
In the Transformer stage construct a stage variable that is derived as If key_changed Then name Else sv : "," : name
Derive the output column name as sv[1,Len(sv)-1]
Take that result through a Remove Duplicates stage preserving the last of each group.
Ensure that partitioning and sorting is preserved throughout.
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