Email notification for failed jobs in job sequence

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
xch2005
Participant
Posts: 85
Joined: Fri Apr 29, 2005 3:13 am
Location: India

Email notification for failed jobs in job sequence

Post by xch2005 »

Hi,

I have a job sequence where there are 10 jobs running in parallel and all of them need to run even in case some of them fails. How do I send out email notification only for the jobs that failed during execution? Is there a way in Datastage I can acheive this?

Appericiate your time and thanks in advance.

Thanks.
xch2005
Participant
Posts: 85
Joined: Fri Apr 29, 2005 3:13 am
Location: India

Post by xch2005 »

Sorry, forgot to mention that I need to send out only 1 email notifcation with all the failed job names.

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

Post by chulett »

Off the top of my head, an "out of the box" solution would be to enable the "include status" option in the email. That would list all of the stages in the sequence, noting which ones succeeded and which ones failed.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

After all the jobs have finished check the $JobStatus activity variable for each and, if any is not DSJS.RUNOK, generate your email.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
xch2005
Participant
Posts: 85
Joined: Fri Apr 29, 2005 3:13 am
Location: India

Post by xch2005 »

Thanks Ray.

Activity variable would determine whether the job failed or not and need to have seperate failure links to send email but that would be for each job.

But, say out of my 10 jobs 3 failed, how do I send out only 1 email notification with these 3 job names that failed.

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

Post by chulett »

So... not going to try the 'status' option I posted?
-craig

"You can never have too many knives" -- Logan Nine Fingers
xch2005
Participant
Posts: 85
Joined: Fri Apr 29, 2005 3:13 am
Location: India

Post by xch2005 »

The option would work for sure but here the requirement is to send out only 1 email notification and that would have the failed job names. If I include the job status in email option that would contain too much information and the users are not really interested for it.

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

Post by ray.wurlod »

If you use Failure triggers, you can bring them together using a Sequencer.

If you don't use Failure triggers, the activity variables for each job activity continue to be available downstream, so you can combine them with a logical expression (for example in a nested condition activity) ahead of generating the email.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

xch2005 wrote:The option would work for sure but here the requirement is to send out only 1 email notification and that would have the failed job names. If I include the job status in email option that would contain too much information and the users are not really interested for it.
Out of curiousity, have you actually tried it and seen what a failure email looks like? I really wouldn't call it "too much information" and I haven't seen anyone who found it any kind of confusing. Saves a lot of shenanigans compared to building "only the failures" in an email and hope you're not dismissing it out of hand without actually ever having seen one.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply