Page 1 of 1

send an email when a job abort

Posted: Fri Feb 14, 2003 4:27 am
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.

Posted: Fri Feb 14, 2003 5:03 pm
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

Posted: Sat Feb 15, 2003 12:18 am
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.