My Job Dependancy Tool (MDJOBREL)
Purpose and operation of program
To manage my batch scheduling. May not be useful to you, but here it is anyway.
I currently submit all my batch jobs into the JES2 input queue in a held state
once a day (currently using a modified version of 'schedule' from one of the
Xephon MVS magazines available on
the cbttape site that I modified
to run on the backlevel mvs3.8j OS).
The exception is the first job in
the batch run that starts immediately (the trigger job for the rest of the batch).
The last step in every batch job runs a proc PROC MDJOBREL to run PGM=MDJOBREL,COND=EVEN
That ensures the program will run even if any prior steps abended. The program will scan
all prior jobsteps to see if any exceeded the maximum condition code or abended.
- If all prior jobsteps were OK it will release all dependant jobs using a JES2 $A'jobname' command
- if there was an error in the job it will instead WTO as action messages that the job failed and will list every job that should have been released but was not, enabling operators to manually restart the jobstream if needed and making the impact of the failed jobstream clear.
Optional user exit module
Additionally it will try to pass a 51 byte status message containing the maxCC the job will allow and the maxCC the job actually had to an optional program MDJOBLOG (a sample "demo" program is included) which can be used to take additional actions based on the message. The sample "demo" program simply inserts a timestamp and the jobname to the passed message and will write it to a LOGFILE DD.
It is optional, if the MDJOBLOG program does not exist the OS will write an 813 (program not found) message and MDJOBREL will write a second message saying the same, and just continue without logging the message. The sample is supplied so you can extend it for your needs, if you need it at all.
MDJOBREL control card image rules
Card deck rules
Any line with a * in position 1 is a comment line, the actual data card rules are
- columns 1 to 8, the trigger jobname owning the dependant jobs
- column 10 to 18, the name of a job to be released when the trigger job completes ok, or DUMMY
- any trailing fields are comments
A DUMMY entry in the to be released jobname column indicates a normal end of the batch stream. This is because the MDJOBREL program is smart enough to complain if it is invoked and no dependant job entries can be found (so typos can be detected), so a control card is needed for every job calling MDJOBREL. The DUMMY indicates that you have your control file correct but no action is required for this last job record.
My card deck example
This is what I have running on my system, while I have ordered them
the cards do not have to be in any specific order, MDJOBREL just
scans the card deck for any jobname in field 1 matching the name of the job
invoking MDJOBREL, and issues a $A'jobname' for the job in field 2.
You may have multiple cards for a release job, for example my DAILY
job below releases two jobs off the help input queue.
So my systems control card deck is
* DAILY BATCH STREAM DAILY DY01SCR DAILY READY JOB RELEASES TAPE SCRATCH JOB DAILY DY01PNCH AND THE DAILY PDS PUNCH JOB DY01PNCH DY02BKPU PUNCH JOB RELEASES THE DYNAMIC BACKUP JOB(S) DY02BKPU DY02WAIT WAIT FOR ALL INSTANCES OF DY02BKPU TO END DY02WAIT DY02PAKU AFTER THE BACKUP OF PDS WE COMPRESS THEM DY02PAKU DUMMY AT WHICH POINT WE ARE DONE * * WEEKLY BATCH JOB STREAM WK00RDY WK01MKFL ON WTOR REPLY U, RELEASE JOB TO CREATE WORK * FILE FOR WEEKLY BACKUP LISTINGS WK01MKFL WK01SHUT IF OK SHUTDOWN EVERYTHING BUT JES2 WK01SHUT WK02BKPS AFTER TSO, NET, MMPF SHUTDOWN DO BACKUP WK02BKPS WK02WAIT WAIT FOR ALL INSTANCES OF WK02BKPS TO END WK02WAIT WK02PAKS AND COMPRESS SYSTEM DATASETS WK02PAKS WK03STRT WHEN DONE WITH SYSTEM DATASETS START ALL STCS AGAIN WK03STRT WK04BKPP CAN BACKUP FULL NON-SYSTEM PACKS (NET/TSO UP NOW) WK04BKPP WK04WAIT WAIT UNTIL ALL BACKGROUND JOBS COMPLETE WK04WAIT WK05SDLY WEEKLY ENDED, LOAD THE DAILY STREAM NOW WK05SDLY DUMMY END OF WEEKLY STREAM
Read this far, you might possibly want it then
The job to create the distribution file for MDJOBREL is available here. Comments at the start of the JCL deck discuss what you need to change to run/install the utility on your system.
Additional things you may want
If you intend to automate your batch you may want to look at my TAPEMAN utility to automate AWS tape mounts. That also includes a few utilities to do pack backups and produce backup reports that I started using once I had fully automated all my tape mounts.
Cautionary notes
caution: as of 2015/01/09 this is being actively modified to rely on external programs.
- The MDJOBLOG interface mentioned above is an example of a new feature, it will eventually become required rather than optional, although there will be more than a 'demo' module shipped at that point as it is intended to be used to report back to the job scheduler (still being written)
- now requires: the MDSVC34 program from my website. As I need the ability to issue commands from multiple automation programs I use now I am changing all my programs to use that common program in the linklist and not coding the function in individual programs