Job Sequence question

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
srini
Charter Member
Charter Member
Posts: 3
Joined: Fri Apr 12, 2002 5:29 am
Location: Texas

Job Sequence question

Post by srini »

I have 4 jobs which run in parallel in Sequence. I want to be notified through email ONLY if any one of the job aborts. How do I do that???

I understand I have to use Notification Activity stage but can somebody throw some light on the design aspects like how many Notification stage I should use and how to send a job status mail only if the job fails etc

Also could I accomplish the same thing by using a scripts

Thanks in advance for your help

Srini
iwin
Premium Member
Premium Member
Posts: 99
Joined: Mon Apr 11, 2005 9:20 pm

Re: Job Sequence question

Post by iwin »

srini wrote:I have 4 jobs which run in parallel in Sequence. I want to be notified through email ONLY if any one of the job aborts. How do I do that???

I understand I have to use Notification Activity stage but can somebody throw some light on the design aspects like how many Notification stage I should use and how to send a job status mail only if the job fails etc

Also could I accomplish the same thing by using a scripts

Thanks in advance for your help

Srini
Well, if you have 4 jobs running in parallel then u can link all those to a sequencer stage with tigger set to failed and in the sequencer stage u have to set the mode to any and then followed by one notification activity.
Krazykoolrohit
Charter Member
Charter Member
Posts: 560
Joined: Wed Jul 13, 2005 5:36 am
Location: Ohio

Post by Krazykoolrohit »

link all the 4 to a sequencer stage and change the mode of the stage to "any". link the sequencer stage to "notification activity" stage and fill in the details

In each of the 4 jobs(in sequencer), in triggers tab, change expression type to FAILED (conditional)

Job 1 -> sequencer1
Job 2 -> sequencer1
Job 3 -> sequencer1
Job 4 -> sequencer1

sequencer1 -> notification activity

and you would be good to go:-)
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

If you have the exception handler stage then no need to connect all of them to a sequencer with mode 'Any' and then to the notification activity.
Just drop an exception handler connected to a notification activity. When any job fails, the control will be passed on to the exception handler which in turn will trigger the notification activity.
In other words, avoid the spider web. :wink:
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
sri1dhar
Charter Member
Charter Member
Posts: 54
Joined: Mon Nov 03, 2003 3:57 pm

Post by sri1dhar »

Don't forget to check the "Automatically hanle activities that fail" option in the General job properties when using a Exception handler.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Unless, of course, you want separate messages from each of the jobs. IN that case, each job requires its own "lack of success" trigger to its own Notification activity (and maybe a Routine activity as well to invoke UtilityWarnToLog).

Tigger should only be used when you want something bounced. :lol:
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Krazykoolrohit
Charter Member
Charter Member
Posts: 560
Joined: Wed Jul 13, 2005 5:36 am
Location: Ohio

Post by Krazykoolrohit »

can i abort the sequence in this way if a job aborts?

I have one routine and a job notification stage, which i want to run when a job fails.

Job1-Notify(fail)

Exception handler - notify(seq fail)

If i handle the error in the job, exceptional handler doesnt capture it
Krazykoolrohit
Charter Member
Charter Member
Posts: 560
Joined: Wed Jul 13, 2005 5:36 am
Location: Ohio

Post by Krazykoolrohit »

i changed the job design to

job1 - Job 2

Exception handler - notify (sequence) - Notify (job fail)

and its working

The issue now is when i say that job2 should run after job1 unconditionally and job1 fails, i want the control to pass to job2. ofcourse i need the exceptional handler to work too for job1?
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Connect the exception handler to a sequencer with Mode set to 'any' going to your second job. The sequencer will also have another input coming in from the sequencer. This way job 2 will be fired even though the control is passed to the exception handler.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Krazykoolrohit
Charter Member
Charter Member
Posts: 560
Joined: Wed Jul 13, 2005 5:36 am
Location: Ohio

Post by Krazykoolrohit »

I have around 20 jobs in one sequence. It looks rather clumsy connecting all of them to one.

this is the way its currently designed. I was looking into the possibility of another design to improove the legibility of the sequence
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Krazykoolrohit wrote:The issue now is when i say that job2 should run after job1 unconditionally and job1 fails, i want the control to pass to job2. ofcourse i need the exceptional handler to work too for job1?
If I'm understanding your need, you are out of luck - you can't have it both ways. Either you are handling job failures via links and triggers or the Exception Handler is handling them. And once the Exception Handler kicks in, control transfers to that part of the process. In other words, at that point you are done.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Krazykoolrohit
Charter Member
Charter Member
Posts: 560
Joined: Wed Jul 13, 2005 5:36 am
Location: Ohio

Post by Krazykoolrohit »

is there nothing in pallete that can help me?

something which transfers the loop to the job next in sequence?
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Or have a routine to send mail regarding the status of each job in AferJobSubroutine.
Anyway by having the unconditional trigger of each job, you dont have to abort the sequence untill all finishes. So the same routine in after the sequence gets over.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
Post Reply