One of the huge improvements in z/OS version 2.2 is the possibility to define and execute jobflows like in OPC/TWS or other job schedulers. JCL has been expanded with cards making it possible to define the jobs in a jobflow with dependencies. To understand how it works I have defined a very simple jobflow. It executes two jobs in secuence and JES will guarantee the order of execution. First step is to define the jobflow:
//MYUSERJG JOBGROUP //MYUSERJ1 GJOB //MYUSERJ2 GJOB // AFTER NAME=MYUSERJ1 //MYUSERJG ENDGROUP
A jobflow in JCL is called a JOBGROUP. A JOBGROUP must have a name and in the above example the name is MYUSERJG. Each job in a jobgroup is defined as a GJOB (Group JOB). By usng AFTER NAME=<GJOBname> you specify to JES that job MYUSERJ2 only can be executed when job MYUSERJ1 has been executed. You terminate the jobgroup by specifying an ENDGROUP using the same name as in JOBGROUP. When specified you submit the JOBGROUP as you submit any other job. I just need to add that in early releases of z/OS version 2.2 the SUBMIT command does not yet know about JOBGROUP. If the SUBMIT of the above example fails then contact your z/OS systems programmer and ask him or her to fix it. You can submit using internal reader until the SUBMIT command works.
How do you then verify that JES has accepted your JOBGROUP? Use the JG command in SDSF which takes you to a new overview of jobgroups. Here you can use the same line commands as you are used to from the ST overview. The P for PURGE command may not be working as it requires additional setup in RACF (at lest it did at my installation). Contact your RACF administrator if purge does not work.
When your jobgroup seems to be fine in SDSF you are ready to submit your two jobs:
//MYUSERJ1 JOB ACCT,NAME // SCHEDULE JOBGROUP=MYUSERJG //TESTSTEP EXEC PGM=IEFBR14 //MYUSERJ2 JOB ACCT,NAME // SCHEDULE JOBGROUP=MYUSERJG //TESTSTEP EXEC PGM=IEFBR14
You probably need to adjust these two jobs in order to fit the requirements at your installation before they will work. JES needs to be able to recognise your jobs as belonging to your JOBGROUP. Thus you need to specify a SCHEDULE card following the job card having JOBGROUP=<jobgroup-name> as parameter in order to allow JES to process the job as belonging to your JOBGROUP. Following the SCHEDULE card you specify the rest of your job.
You can submit the jobs belonging to your JOBGROUP in any order and you do not need to do it at the same time. JES will keep track of the jobs and you can follow the status in the SDSF JG overview. I will strongly recommend you to experiment with the submit order to give you a feeling of how JOBGROUP and the corresponding jobs works. The only requirement is that your JOBGROUP must be submitted before your jobs.
The above example is only suited to get you started into the new world of JOBGROUP. There are a lot of different options for defining job schedules and controls depending on return codes. You can read about it all in JCL reference.