The germ for this post came from a question I was asked about if it is possible to monitor a job, and if it errors to send an email. In previous posts I have given examples of the pieces need to do this, and in this post I will just put it all together, like assembling pieces of Lego.
The one perquisite that is needed to make this work is that the name of the Job has to be unique, and always the same. Each time the job is submitted to batch it has to be submitted with the same unique name. In this example the job I want to monitor will always have the name: SIMON_JOB
SBMJOB CMD(CALL PGM(program)) JOB(SIMON_JOB) |
If the name of this job is not unique then there is no way I can identify it, and I will be able to check its status.
The program is quite simple I just need to do two things: