concatenating same column data

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
DSkkk
Charter Member
Charter Member
Posts: 70
Joined: Fri Nov 05, 2004 1:10 pm

concatenating same column data

Post by DSkkk »

hi All,
my data is so bad that the emailaddress got split into different rows with all the same other details.
eg:
order_nbr emailaddress seq_id
100 Y, 6
100 DSkkk@yahoo 7
100 .com 8

i have the column seq_id which has the consequent nos for the continuation.
now i have to concatenate the whole email address and discard the remaining rows.
i have done an order by through my SQL query and have all the rows in this fashion in order. now i am to concatenate them when they have all order_nbr same.
can you suggest different ways to do this?
g.kiran
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

You can sort the data by the key and seq no. Then you can use stage variables to control the concatenation and pass to next stage on change of key. But note that the last record has to be handled in some way (maybe by obtaining wc -l before job and passing it as a job param).
DSkkk
Charter Member
Charter Member
Posts: 70
Joined: Fri Nov 05, 2004 1:10 pm

Post by DSkkk »

i did not exactly follow the suggestion. can you explain?
Thanks
g.kiran
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Try to concatenate the col.s in an empty hash-file to start.

Read and write into the same hash file.

I explained this method to another post just 2 or 3 above yours.
Post Reply