compare two records in DataStage

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
amar.v023
Participant
Posts: 17
Joined: Thu Nov 19, 2009 12:55 am
Location: Hyderabad

compare two records in DataStage

Post 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...
Amar
srinivas.nettalam
Participant
Posts: 134
Joined: Tue Jun 15, 2010 2:10 am
Location: Bangalore

Post by srinivas.nettalam »

Please put the values in tabular format so that it will be easy for you to pose your question..
Last edited by srinivas.nettalam on Thu Feb 14, 2013 3:39 am, edited 1 time in total.
N.Srinivas
India.
123gopal
Participant
Posts: 16
Joined: Sat Feb 09, 2013 11:41 am
Location: chennai

Re: compare two records in DataStage

Post by 123gopal »

can be use Aggregator stage for that or compare the two records using join or merge stage after that use aggregater stage
mgplk
srinivas.nettalam
Participant
Posts: 134
Joined: Tue Jun 15, 2010 2:10 am
Location: Bangalore

Re: compare two records in DataStage

Post 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
N.Srinivas
India.
vmcburney
Participant
Posts: 3593
Joined: Thu Jan 23, 2003 5:25 pm
Location: Australia, Melbourne
Contact:

Post 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.
Post Reply