Wednesday, December 14, 2011

Run a job based on previous job without Job scheduler

If your shop has Thruput manager(TM), then you can use DJC(Dependent Job Control) command of the TM. DJC allows you to control the order of execution of jobs that depend on the completion of other jobs.


Example:
A simple schedule of 3 jobs.  Job ABC will run.  Depending on the completion of ABC will either run job QRS or XYZ.  For DJC to manage these jobs need to have a DJC “group”.  I would use for group names – userid.you_pick_a_name.  So for this example I would use MYID.DBUPDT.  The DJC statements for the jobs look like this:

DB Update Job:

//ABC JOB (1234),'TEST',             
//    CLASS=A,NOTIFY=&SYSUID,MSGCLASS=H,TIME=5
//*+DJC GROUP MYID.DBUPDT
//* THIS JOB HAS NO DEPENDENCIES
//* IT WILL NOT BE HELD BY DJC
...rest of JCL

DB Backup Job:

//QRS JOB (1234),'TEST',             
//    CLASS=A,NOTIFY=&SYSUID,MSGCLASS=H,TIME=5
//*+DJC GROUP MYID.DBUPDT CLOSE
//* GROUP IS TO BE CLOSED AFTER THIS JOB
//*+DJC RUNIF ABC NORMAL
//* THIS JOB IS RELEASED BY DJC AFTER NORMAL COMPLETION OF JOB ABC
//* IF ABC TERMINATES ABNORMALLY THIS JOB IS FLUSHED
...rest of JCL

DB Reload Job:

//XYZ JOB (1234),'TEST',              
//    CLASS=A,NOTIFY=&SYSUID,MSGCLASS=H,TIME=5
//*+DJC GROUP MYID.DBUPDT CLOSE
//* GROUP IS TO BE CLOSED AFTER THIS JOB
//*+DJC RUNIF ABC FAILS
//* THIS JOB IS RELEASED BY DJC ONLY IF ABC FAILS
//* IF ABC TERMINATES NORMALLY THIS JOB IS FLUSHED
...rest of JCL

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.