Compare two 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
verify
Premium Member
Premium Member
Posts: 99
Joined: Sun Mar 30, 2008 8:35 am

Compare two columns

Post by verify »

Hi ,

I want to compare two columns in a file .If these column values are same for all rows then i need to send a mail saying equal else i need to send mail saying not equal .

Can we do this in datastage parallel jobs ? Please suggest .

Thanks all in advance
RK Raju
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

In a transform stage, put a constraint of "In.ColA <> In.ColB" to the output link going to a sequential file. If this file contains one or more lines then you need to send a mail; this logic can be done as part of the after-job routine, or part of the job sequence which calls the job, or even as a 2nd job (if any rows get read from the file then send a mail).
VijayDS
Participant
Posts: 38
Joined: Thu Jun 18, 2009 3:50 am

Re: Compare two columns

Post by VijayDS »

The best way is to compare the columns with the condition colA=colB else capture the records into the reject file. In the sequencer execute command stage specify the Field function to count the number of records in the reject file. if the row num>=1 then send the mail by using the Email Notification activity stage.



verify wrote:Hi ,

I want to compare two columns in a file .If these column values are same for all rows then i need to send a mail saying equal else i need to send mail saying not equal .

Can we do this in datastage parallel jobs ? Please suggest .

Thanks all in advance
Thanks
Vijay
Post Reply