send an email when a job abort

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
luca
Participant
Posts: 81
Joined: Wed May 14, 2003 11:34 pm

send an email when a job abort

Post by luca »

Hi !
I would like all my jobs to send an email if the execution doesn't finish fine.
I was thinking of doing it by creating a new after job subroutine, in which I would test the status of the job and then send an email if the status isn't "finished OK".
Can you confirm me that when executing the after job subroutine, the job is really finished (that is, the job doesn't wait for the subroutine itself to finish).
Then, what should I use in the subroutine to test the status of the job.
Thanks a lot.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

If you test the status of a job in the job's own after-job subroutine the status of the job is always "running". The job is not finished until its after-job subroutine (if any) has finished.
Construct a sequence that runs the job then takes seperate paths if the status is success or failure. Or do it with job control code, where you can explicitly interrogate any specific piece of the attached job.


Ray Wurlod
Education and Consulting Services
ABN 57 092 448 518
luca
Participant
Posts: 81
Joined: Wed May 14, 2003 11:34 pm

Post by luca »

Thanks for your reply, Ray.
The point is I was doing this in a Job Sequencer, as you suggested but as I found it a little long to add a new notification activity after each Job activity, I had the idea of using an afterjob subroutine for doing this, but I was suspicious about the job being really finished or not. I now have the answer : not finished.
So, I'll keep my email notifiaction activity in my job sequencers.
Thanks.
Post Reply