Regarding Mail Notification Activity

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
Zabeerulla
Participant
Posts: 38
Joined: Tue Jan 10, 2006 1:25 am

Regarding Mail Notification Activity

Post by Zabeerulla »

Hi,


We have a sequence in which 50 jobs will run one after the other. Please let me know can how to add a Notification Activity stage in this sequence so whenever one of the job fails I have to get a mail.
Thanks & Regards,

Zabi
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Use Execption Handler.
If any job aborts, contorl comes to this stage. Trigger Email Notification accordingly.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

As long as you have the 7.5.x version. Before that it gets more... complicated.
-craig

"You can never have too many knives" -- Logan Nine Fingers
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

May be need to add to at each jobActivity stage with failure trigger condition.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
gateleys
Premium Member
Premium Member
Posts: 992
Joined: Mon Aug 08, 2005 5:08 pm
Location: USA

Post by gateleys »

The question you put across is 'whenever one of the job fails'. You may want to be more specific. For example, what if the job did not fail, but had warnings. Also, how would you want the other jobs handled if one of them failed, should the entire sequence be aborted or only the job that failed should be aborted, etc, etc.
Now, lets assume a case where a job sequence has 3 job activities and -
i) All of them should execute successfully for the sequence also to be )successful, and hence send a success e-mail.
ii) If any of them, either generate a warning or fail, then downstream jobs should not execute and the sequence should abort.

In such a scenario-
1. Drop a sequencer stage on your canvas, and set it to ANY mode.
2. Connect the job activities sequentially, that is job1--> job2--> job3.
3. Connect job3 to the Notification stage (for success).
4. Set the Trigger to these links to "Conditional OK" (Executed OK).
5. Draw a second link from each job activity and connect it to the Sequencer stage.
6. Set the Trigger of these to "Otherwise" - meaning, if they finish with the status warning or fail.
7. Add a notification stage in the outlink of Sequencer (for failure notification).
8. Now, add a Routine to the outlink of notification stage. The routine should accepts jobname as the argument and forces an abort of the job.

Code: Select all

Call DSLogFail(JobName, 'Job Failed')
Ans=''
You are ready to go. However, this design would used only in the case of ALL or NOTHING design. It may be modified to handle other issues.

Hope this helps :lol: .

gateleys
Zabeerulla
Participant
Posts: 38
Joined: Tue Jan 10, 2006 1:25 am

Post by Zabeerulla »

Thanks to All

Gateleys, this is working fine. Can I get the name of the job also which has been failed in the sequence.
Thanks & Regards,

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

Post by chulett »

Zabeerulla - what 7.x version of DataStage do you have?
-craig

"You can never have too many knives" -- Logan Nine Fingers
gateleys
Premium Member
Premium Member
Posts: 992
Joined: Mon Aug 08, 2005 5:08 pm
Location: USA

Post by gateleys »

Zabeerulla wrote:Thanks to All

Gateleys, this is working fine. Can I get the name of the job also which has been failed in the sequence.
The logic works in a way that if ANY of the jobs fail, then the sequence aborts. So, it is irrespective of which job failed, and hence the name is inconsequential. However, on the good side, if you include the job report in the notification stage, it will contain which job failed. Works with DS7.0.

gateleys
Post Reply