Send email for 0 rows in link

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
shrey3a
Premium Member
Premium Member
Posts: 234
Joined: Sun Nov 21, 2004 10:41 pm

Send email for 0 rows in link

Post by shrey3a »

Hi,

Our requirement is to send the email to users if the file is empty i.e. there are no rows processed, we want to implement the logic in ETL only.

I used the below logic in stage variable, constraint and even column transformation but it only runs if if there are actually rows processed i.e. @INROWNUM = 1 or > 1 for =0 it do nothing

IF @INROWNUM = 0 THEN DSSendMailTester('a@yahoo.com', 'a@yahoo.com', 'ul', 'a.com', 'Zero') else 0

Please guide if there is anyother way of doing it.

Regards,
Munish
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You need to check the link count after the fact in a separate process. This would typically be done in a Sequence job - a Routine Activity stage to do the DSGetLinkInfo and then triggers to send a zero result to a Notification Activity stage.
-craig

"You can never have too many knives" -- Logan Nine Fingers
sunil_acc
Participant
Posts: 28
Joined: Thu Oct 20, 2005 5:49 am

Post by sunil_acc »

why dont you try creating a befor job subroutine.
code tthe subroutine to check the size of the file, if the size is zero then send mail, and use it as a befor job subroutine in your job!

thanks
sunil
sunil_acc
Participant
Posts: 28
Joined: Thu Oct 20, 2005 5:49 am

Post by sunil_acc »

why dont you try creating a befor job subroutine.
code tthe subroutine to check the size of the file, if the size is zero then send mail, and use it as a befor job subroutine in your job!

thanks
sunil
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

To use an after-stage subroutine, rather than a before-job subroutine, would make more sense.

I would use a separate activity, or even two, in a job sequence to detect the zero row count and to send the email. These would, of course, be executed after the job in question, though possibly in the same job sequence.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply