Concatenate duplicate values..

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
pratapsriram
Premium Member
Premium Member
Posts: 41
Joined: Tue Jan 24, 2006 3:43 pm
Location: United States
Contact:

Concatenate duplicate values..

Post by pratapsriram »

Hi All
I am gettin data like this ... and gettin duplicates ( in green).
A B C D

1 2 3 X
1 4 5 Y
1 2 3 Z
5 8 4 C
1 2 3 K

Output should be as below...to be written to a Hashed file with A, B, C as Keys


A B C D

1 2 3 X : Z :K
1 4 5 Y
5 8 4 C

Please forward some suggestions on how to do this.


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

Post by ray.wurlod »

Lookup against the hashed file and construct D then write back to the hashed file.
Disable both read cache and write cache, and lock for update when performing the lookup.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
sun rays
Charter Member
Charter Member
Posts: 57
Joined: Wed Jun 08, 2005 3:35 pm
Location: Denver, CO

Re: Concatenate duplicate values..

Post by sun rays »

1)First sort the data and
2)then in transformer use the persistent stage variables like svCurrentA, svPreviousA, svCurrentB....etc to compare the current and previous values of the first 3 columns,
3)and concatenate the values of the fourth column as long as current and previous values are equal. Flush the row to output when the comparison evalutes to false.
Post Reply