AutoMan ©
Automation Power Tools for OS/390 and z/OS
|
AutoMan © Version 2.9 Jobs Schedule Monitor |
The Jobs Schedule Monitor is a new feature for AutoMan © V2.9, which allows the user to specify the names of jobs, started tasks and TSO user ids, that are to be monitored.
The Jobs Schedule Monitor allows an optional SUBMIT clause to dispatch the job or task. The SUBMIT clause is identical to the AT specification for scheduled item. Jobs, tasks and users may be monitored by specific or generic name.
This new specifcation contains a WHEN JOB STARTS and WHEN JOB ENDS clause, which enables the user to include GAL code to be executed when these events occur. The WHEN JOB ENDS clause can test the jobs return code and dispatch follow on jobs, or send email notications.
JOBNAME=JMLOAD01
VAR &RC LEN 4
SUBMIT AT 13:00 EVERY WEEKDAY
WHEN JOB STARTS DO
WTO 'AMANJL01 Maint Loader has started'
END
WHEN JOB ENDS DO
LET &RC=$$JOBRET /* JOB RETURN CODE */
IF &RC EQ 0 DO
SUB (*(JMLOAD02)) /* submit follow on */
END ELSE DO
WTO 'AMANJL02 Maint Loader has failed RC=&RC'
EMAIL SUBJECT 'JMLOAD01 failed RC=&RC'
'Urgent that you check Maint Loader'
END
END
JOBNAME=TSTDL*
VAR &RET LEN 4 /* Return Code */
WHEN JOB STARTS DO
LET &JNM=$$JOBNAM /* JOB NAME */
WTO 'AMANJLXX &JNM has started'
END
WHEN JOB ENDS DO
LET &RET=$$JOBRET /* JOB RETURN CODE */
LET &JNM=$$JOBNAM /* JOB NAME */
IF &RET EQ 0 DO
WTO 'AMANJLXY &JNM has finished.'
END ELSE DO
WTO 'AMANJL02 &JNM has failed RC=&RET'
LET &JNM=$$JOBNAM /* JOB NAME */
END
END