Page 1 of 1

please Help in routine

Posted: Wed Nov 03, 2004 12:25 pm
by nag0143
Hi !

I have a requirment where i need to read a sequencial file and compare field 1 and field 2 and if field 1 > field 2 then i need to send an email where message body should contain field1 and field2 values respectively.
I am thinking of writing a routine as below but how do i get f1 and f2 values into message body.

Code: Select all

openseq SourceFile to filevar 
readseq fileline from filevar
f1=field(fileline, ",",1)
f2=field(fileline,",",2)
if f1 > f2 
then
Call DSSendMail(x@abc.com,y@abc.com,Hello,server,f1 and f2 values)
closeseq rfilevar
any help

Thanks
Nag.

Posted: Wed Nov 03, 2004 1:13 pm
by kduke
You need the routine posted on ADN http://developernet.ascential.com/forum ... php?t=1043.

Re: please Help in routine

Posted: Wed Nov 03, 2004 2:12 pm
by nkumar_home
You could try this-
If you need to send an e-mail for every row that f1 is > f2 then
you can use the below logic within the datastage job
f3 = f1:',':f2
DSSendMail("From:x@abc.com\nTo:y@abc.com\nSubject:Hi\nBody:f3\n")

Or you can write all records with f1 > f2 to a file and call DSSenMail from after job subroutine on unix with 'Input Value' of
From:x@abc.com\nTo:y@abc.com\nSubject:Hi\nBody:`cat filename`