Previous Topic

Next Topic

Book Contents

Book Index

Job Ordering Through Utility CTMJOB

The CTMJOB job ordering utility can be invoked from the job step or by calling the program from a TSO environment and/or application program.

Assume that you want to order jobs IDJOB1, IDJOB2, and IDJOB3 in table IDGS1.

There are quite a few ways to do this using CTMJOB. Several of these ways are illustrated in the following pages.

Note: Specify the appropriate library in place of CTM.TEST.SCHEDULE in each of the alternatives.

  1. Define the JCL for CTMJOB as follows:

    //SCHDLIB   DD    DSN=CTM.TEST.SCHEDULE ,DISP=SHR

    //DAJOB     DD    *

      ORDER  DDNAME=SCHDLIB MEM=IDGS1 JOB=IDJOB1 ODATE=ODATE

      ORDER  DDNAME=SCHDLIB MEM=IDGS1 JOB=IDJOB2 ODATE=ODATE

      ORDER  DDNAME=SCHDLIB MEM=IDGS1 JOB=IDJOB3 ODATE=ODATE

             FORCE

    //

    Notice a few things about this JCL.

    The CTMJOB utility generally uses a DAJOB DD statement to identify the tables and/or jobs to schedule, although an exception will be shown later in this chapter. But the ORDER statements do not have to be included in line in the DAJOB statement. They can, instead, be placed in a parameter member pointed to by the DAJOB statement.

    The following steps show how to create an alternative definition for CTMJOB that places the order statements in a PARM member (IDPRM1).

    Note: Be sure to specify an appropriate PARM library in place of CTM.TEST.PARM.

  2. Define the JCL for CTMJOB as follows:

    //SCHDLIB   DD    DSN=CTM.TEST.SCHEDULE DISP=SHR

    //DAJOB      DD  DISP=SHR,DSN=CTM.TEST.PARM(IDPRM1)

    //

  3. Specify the following contents in the IDPRM1 member in the PARM library:

      ORDER  DDNAME=SCHDLIB MEM=IDGS1 JOB=IDJOB1 ODATE=ODATE

      ORDER  DDNAME=SCHDLIB MEM=IDGS1 JOB=IDJOB2 ODATE=ODATE

      ORDER  DDNAME=SCHDLIB MEM=IDGS1 JOB=IDJOB3 ODATE=ODATE           FORCE

    The above definitions for CTMJOB achieve the same results. The advantage of the second method, using the PARM member, is that you do not have to change the JCL if you want to change the list of jobs to be ordered. You merely need to change the contents of the PARM member.

    If the table being scheduled is a SMART Table, you can specify scheduling RBCs to include or ignore in the ORDER statements.

  4. Define the following JCL for CTMJOB:

    //DAJOB     DD    *

      ORDER  DDNAME=CTM.TEST.SCHEDULE MEM=IDGS2 ODATE=ODATE

      SELECT RBC EXERCISES

      IGNORE RBC EOW

      IGNORE RBC EOM

    //

    Now that you have seen several instances of using ORDER statements, take a closer look at the ORDER statement syntax.

    The syntax for the ORDER statement is as follows:

    ORDER{DSN=schedlib|DDNAME=dd|DD=dd},{MEMBER=table|MEM=table}[,JOB=jobnm]

             [,ODATE=date|DATE=date][,ODATEOPT={VALUE|VAL|RUN}][,FORCE]

    [SELECT RBC rbcname1]

    [IGNORE RBC rbcname2]

    Observe the following points about ORDER statements:

    For more information on the parameters in the ORDER statement, see the description of the format of ORDER statements in the Control-M chapter of the INCONTROL for z/OS Utilities Guide.

    Thus far, all instances of DD statement DAJOB included, or pointed to, a PARM member that includes ORDER statements. However, DAJOB statements can be defined without ORDER statements.

  5. Define the following JCL for CTMJOB:

    //DAJOB      DD  DISP=SHR,DSN=CTM.TEST.SCHEDULE(IDGS1)

    //           DD  DISP=SHR,DSN=CTM.TEST.SCHEDULE(IDGS3)

    //          

    Using this method, the schedule library and table is specified directly in DAJOB DD statement. This method provides no advantage over in-line specification of ORDER statements. It has the disadvantage that you cannot request specific jobs, only whole tables.

    It is also possible to use CTMJOB without specifying a DAJOB DD statement. This is done by specifying a PARM parameter in an EXEC statement in the JCL. For example:

    //ORDERJOB EXEC   PGM=CTMJOB,

    //       PARM='ORDER DSN=CTM.TEST.SCHEDULE TABLE=IDGS1 JOB=SORT ODATE=020201'

    //

However, this method is of very limited usefulness because it can only be used to order a single table or job.

If you were to submit any of the defined JCLs for CTMJOB, the specified job scheduling definitions would be ordered. However, instead of submitting the JCLs, for this exercise you should move on to the topic of User Daily jobs.

Parent Topic

Job Ordering and New Day Processing