please Help in routine

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
nag0143
Premium Member
Premium Member
Posts: 159
Joined: Fri Nov 14, 2003 1:05 am

please Help in routine

Post 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.
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

You need the routine posted on ADN http://developernet.ascential.com/forum ... php?t=1043.
Mamu Kim
nkumar_home
Participant
Posts: 19
Joined: Fri Apr 02, 2004 10:13 am

Re: please Help in routine

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