Page 1 of 1

Compare two columns

Posted: Tue Jun 23, 2009 3:58 pm
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

Posted: Wed Jun 24, 2009 12:58 am
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).

Re: Compare two columns

Posted: Fri Jun 26, 2009 4:29 am
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