concatenate the three columns

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
suresh_dsx
Participant
Posts: 160
Joined: Tue May 02, 2006 7:49 am

concatenate the three columns

Post by suresh_dsx »

Hi,

I want to concatenate the three columns on the emp information.

Code: Select all

Source data

ename,eid,eflag
"abc","100","yes"
"bbc","200","new"
"cbc","300","old"
"dbc","400","NA"

output: 

ename,eid,eflag,eval
"abc","100","yes","abc100new"
"bbc","200","new","bbc200old"
"cbc","300","old","cbc300NA"
"dbc","400","NA",""
eval is similar like encrypted value. Tried with transfer stage and able to concatenate the same value but I am unable to concatenate the next row value.

Any help greatly appreciated

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

Post by ray.wurlod »

Sort in reverse order and use stage variables to remember previous value. Initialize the "remembering" stage variable to "". Re-sort if necessary downstream of the Transformer 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.
ersunnys
Participant
Posts: 29
Joined: Wed Sep 13, 2006 1:39 pm
Location: Singapore

Post by ersunnys »

Unfortunately all processing is done in order...

If you want value of second record in first record then sort the data in descending (reverse) order first and then process through transformer...

use stage variable store value of eflag of previous record and use it with next record...
Regards,
Sunny Sharma.
Post Reply