Page 1 of 1

compare two records in DataStage

Posted: Thu Feb 14, 2013 1:37 am
by amar.v023
Hi All,

Is it possible to compare two records in DataStage, then decide what value to add to a new field on each record?
For example, if Record 1 has an 'A' and Record 2 has a 'B' then, add a new field with 'Z' for Record 1 and 'Y' for Record 2. But, if Record 1 has an 'A' and Record 2 has a 'C', the new values would be different. Hopefully that makes a little sense ;-)

Any idea please share...

Posted: Thu Feb 14, 2013 3:38 am
by srinivas.nettalam
Please put the values in tabular format so that it will be easy for you to pose your question..

Re: compare two records in DataStage

Posted: Thu Feb 14, 2013 3:38 am
by 123gopal
can be use Aggregator stage for that or compare the two records using join or merge stage after that use aggregater stage

Re: compare two records in DataStage

Posted: Thu Feb 14, 2013 3:44 am
by srinivas.nettalam
123gopal wrote:can be use Aggregator stage for that or compare the two records using join or merge stage after that use aggregater stage
Apparently,there are no common values expected in the two sets so we cannot porceed with the combining stages.However you can try compare stage but even that stage requires same values in the columns as per my understading

Posted: Thu Feb 14, 2013 8:59 pm
by vmcburney
You might be able to do something with a Transformer loop - this lets you step through the values of records across more than one row and output rows based on what you find. This Transformer looping functionality was new in version 8.5 (I think) and is in every version since. You would need to partitioning and sorting to make sure row A and B come into the transformer in a row.