JobName of the failed job while sending e-mail notification.

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
navistar
Participant
Posts: 12
Joined: Sat Jan 12, 2008 7:55 am
Location: CT

JobName of the failed job while sending e-mail notification.

Post by navistar »

DSFriends,

I have a job sequence which has 10 jobs. When one of these jobs fail, I route it through a sequencer activity and send out an e-mail notification (using notification activity) before aborting it using UtilityToAbortLog from Routine activity.

On a job failure, I also write out the job name that failed to a file. Now while sending the e-mail, I need to fetch the job name from this file and use it in the text of the e-mail message from the notification activity.

So the question is how would I get the job name from the file and use it as the text in the e-mail notification activity?

PS: If your answer is to use a dynamic parameter, please be clear in explaining how to use it in my scenario.

Thanks.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

In your job sequence you have that information available to you. Each Job Activity has 3 User Activity variables associated with it, the $JobName, $JobStatus and $UserStatus. You can use those in the sequence, for instance in a User Variables Activity, to set a string value with the job name of the failed job(s) and pass that to your notification activity.
navistar
Participant
Posts: 12
Joined: Sat Jan 12, 2008 7:55 am
Location: CT

Post by navistar »

ArndW, than you for your insights on this problem of mine.

I used the User Variables Activity stage in my job sequence and I am able to pass the JobName of the failed job to the E-mail Notification Activity. But I am not sure if I can use this passed variable in the E-mail Body of this activity. I am able to use it in the E-mail Subject field by clicking the small button on the right side of the E-mail Subject filed. E-Mail body does not have anything like this.

Is it possible to use a parameter in the E-mail body?

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

Post by ray.wurlod »

No. The email body does not support job parameter references.

You would need to write your own routine for sending mail to implement this requirement.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
itsvarunm
Participant
Posts: 10
Joined: Fri Aug 31, 2012 6:33 am

Post by itsvarunm »

I used a terminator activity flowing to a user variable stage on to the notification stage. This works fine.. No need for a routine
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The User Variable activity did not exist in 2008.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
vamsi.4a6
Participant
Posts: 334
Joined: Sun Jan 22, 2012 7:06 am
Contact:

Post by vamsi.4a6 »

1)Job1--->Job2-->..................... Job10


exceptional Handler--->execute Command Activity

2)In execute command stage call the unix script and folllowing things to be performed

a)For each Job check the Job status and if it is aborted send the mail

use dsjob -jobinfo,loop,grep,mail commands in the script
Post Reply