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
Datastage EE
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
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.
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.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
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.
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.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
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
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
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.
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.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.