Job Ordering and New Day Processing

This chapter includes the following topics:

Overview

In the previous chapters of this guide, you used the O (Order) or F (Force) option in the Job List screen to order individual jobs. These same options are available in the Table List screen to order or force all the jobs in a particular table.

There are, however, other methods of job ordering, In this chapter of the guide, you will look at job ordering through the following methods:

  • Batch utility CTMJOB

  • New Day Processing and User Daily jobs

  • Online utility CTMJOBRQ

You will also see a brief description of several other methods of job ordering.

Only relevant DD statements are illustrated in the sample JCLs for the exercises in this chapter. Other DD statements, such as DALOG and DACNDF, are not shown.

Preparations

No special preparations are required for this chapter of the guide.

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.

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

  1. Define the JCL for CTMJOB as follows:

    Copy
    //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 desired job scheduling definitions are specified in ORDER control statements included in a DAJOB DDstatement.

    • Each ORDER control statement identifies a library, table and job scheduling definition. To avoid repetition of the scheduling library name in each ORDER statement, the library name was identified in a preceding DDstatement.

    • The last ORDER statement requested a FORCE. Therefore, job IDJOB3 will be forced regardless of its basic scheduling criteria.

    The CTMJOB utility generally uses a DAJOB DDstatement 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).

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

  2. Define the JCL for CTMJOB as follows:

    Copy
    //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:

    Copy
      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:

    Copy
    //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:

    Copy
    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:

    • Immediately following the ORDER statement, you must specify either the name of scheduling library (in a DSN parameter), or the name of a DDstatement that identifies a scheduling library (in a DD or DDname parameter).

    • You must then specify a table name.

    • Jobname is optional. If not specified, all jobs in the table are ordered.

    • A date parameter, such as ODATE or DATE, is optional if a date control record has been defined.

    • The FORCE parameter is optional. It forces a job even if its basic scheduling criteria are not satisfied.

    • IGNORE and SELECT RBC statements are relevant for ‘SMART Table scheduling only.

    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 DDstatement 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:

    Copy
    //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 DDstatement. 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 DDstatement. This is done by specifying a PARM parameter in an EXEC statement in the JCL. For example:

    Copy
    //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.

New Day Processing

As mentioned in 5 AutoEdit and JCL, each site defines a time that represents the end of the old working day and the start of the new working day. At the start of the new working day, New Day processing is performed. New Day processing is the process by which daily maintenance is performed and jobs to be scheduled on the new day are placed in the Active Jobs file.

New Day processing is generally performed by a combination of the New Day procedure and User Daily jobs. The topic of New Day Processing is described in detail in the Control-M chapter of the INCONTROL for z/OS Administrator Guide.

You can now take a look at User Daily jobs.

User Daily Jobs

A User Daily job is a job scheduling definition and JCL job that executes the User Daily procedure CTMDAILY. This procedure, in turn, calls the CTMILU program.

The CTMILU program can be seen as an enhanced CTMJOB, in that it executes CTMJOB, but it also executes other programs that provide additional functionality. You will look at one of these other programs shortly, but first, you should create a User Daily job, as described in the following topic.

Defining the JCL of a User Daily Job

  1. Based on the above JCL, define a User Daily in member IDUDJ1, but do not exit the JCL:

    Copy
    //         JCLLIB  ORDER=your.proclib.PROCLIB
    //         INCLUDE MEMBER=IOASET                                     
    //GTSTRT5  EXEC CTMDAILY,                                            
    //            DATEREC=DATERECU                 <== CHANGE    
    //DAJOB     DD    *
      ORDER  DDNAME=SCHDLIB MEM=IDGS1 JOB=IDJOB1
      ORDER  DDNAME=SCHDLIB MEM=IDGS1 JOB=IDJOB2
      ORDER  DDNAME=SCHDLIB MEM=IDGS1 JOB=IDJOB3

    The DAJOB DDstatement looks familiar because these parameters are ultimately passed to CTMJOB. Therefore, any syntax that is valid for passing parameters to program CTMJOB, as demonstrated in previous steps in this chapter, can be used in the User Daily job.

    But there is a difference. Note that the order statements do not contain date parameters as they did in the previous steps. Instead the date information is provided by a record called the Date Control record. You can now identify the Date Control record to the job, and then create this Date Control record, using the DATEREC parameter in the procedure that points to the member containing the Date Control record.

    Now note the statement DATEREC=DATERCU. You should examine this item for a moment.

  2. In the JCL, change this statement:

    //            DATEREC=DATERECU

    to this statement:

    //              DATEREC=IDDCRU

    and then exit the JCL.

Defining the Date Control Record for a User Daily Job

In your PARM library is a member called DATERECU. This is the model Date Control record provided with Control-M. The sample Date Control record is displayed similar to the following:

Copy
 ****** ***************************** Top of Data ******************************
 000001 301000           301000 301000            301000 301000           301000
 ****** **************************** Bottom of Data ****************************

The Date Control record contains an example date that is repeated several times in specific columns. The integrity of these columns must be maintained. The date must appear in the Date Control record of a User Daily job in the following columns:

  • 01 - 06

  • 18 - 23

  • 25 - 30

  • 43 - 48

  • 50 - 55

  • 67 - 72

Each User Daily requires its own Date Control record. You will use this model record to create a Date Control record for the User Daily that you have just created. As you can see from the step you just performed, you are going to call the Date Control record for this User Daily IDDCRU.

  1. In the PARM library, copy member DATERECU and call it IDDCRU.

  2. Edit member IDDCRU and, without changing the column positions, replace the old dates with the current working date. Then exit the member.

    Once you have created a Date Control record for a User Daily, Control-M automatically updates the date information in the record. This is one of the great advantage of using User Dailies to order jobs. You do not have to update date information in a DAJOB DDstatement each day, because Control-M provides the updated information through the Date Control record.

    This appearance of the date six times (instead of once) in the Date Control record of a User Daily enables Control-M to manage the process of job ordering. At each stage in the job ordering process, the current original scheduling date is placed in one of these fields.

Enhanced Daily Checkpointing

An optional, second, Date Control record can be defined for a User Daily to enable Enhanced Daily Checkpointing. If an interruption such as a system crash occurs during job ordering, Enhanced Daily Checkpointing facilitates automatic rerun of the job ordering process by enabling Control-M to identify the last job ordered before the interruption. Control-M can then continue the ordering process from that point.

This second Date Control record has a completely different format than the regular Date Control record. In fact, the Enhanced Daily Checkpointing Date Control record contains far more than dates.

The following table shows the format of the second Date Control record, which is required only if Enhanced Daily Checkpointing is used.

Table 21 Format of the Second Date Control Record (For Enhanced Daily Checkpointing Only)

Column

Constant or Value Added

Description

01 - 04

JOB=

Constant.

05 - 12

blank

In this area, Control-M stores the MEMNAME value of the last ordered job.

13 - 23

,SERIAL_NO=

Constant (note the comma before the "S").

24 - 28

blank

In this area, Control-M stores its internal sequence number of the last ordered job.

29 - 37

,ORDERID=

Constant (note the comma before the "O").

38 - 42

blank

In this area, Control-M stores the order ID of the last ordered job.

43 - 49

,GROUP=

Constant (note the comma before the "G").

50 - 69

blank

In this area, Control-M stores the group name of the last ordered job.

When creating this record, you must

  • specify the indicated constants, such as JOB=, in the appropriate columns

  • leave blank the columns indicated as blank

  • These columns are filled in by Control-M during User Daily processing.

Defining the Job Scheduling Definition of a User Daily Job

You have now defined the JCL of User Daily job IDUDJ1, and created its Date Control record called IDDCRU. One task remains, however; you must define the job scheduling definition for User Daily IDUDJ1.

  1. In your scheduling library, create a new table called IDUDT1, and in it create a job scheduling definition called IDUDJ1. Define the job scheduling definition as follows:

    1. Ensure that the MEMNAME and MEMLIB fields point to the JCL of IDUDJ1.

    2. Define the Basic Scheduling parameters so that this job scheduling definition gets ordered every day, for example, by using a DAYS value of ALL.

    3. Exit the job scheduling definition.

Additional Points About User Daily Jobs

As you saw in previous chapters you can order jobs in the online facility. However, using this method, you must first enter the online facility. Then you must order the jobs, either individually or a table at a time. This method is not bad for an occasional job order, but it certainly is not suitable for ordering a large number or jobs, especially if they are from different tables.

In this chapter, you saw that you can order a large number of jobs using a single run of CTMJOB. And you can keep the list of jobs you specified to CTMJOB for reuse. This eliminates the disadvantages of using online job ordering on regular daily basis.

For daily processing, employing User Daily jobs provides an additional advantage—the Date Control record. The Date Control record has many advantages, including the following facts:

  • It can be used in conjunction with the RETRO parameter, described in the parameters chapter of the Control-M for z/OS User Guide, to enable the site to catch up with missed work days—for example, if the system is down for several days.

  • It enables Enhanced Daily Checkpointing, which is useful in case of system crash.

However, even the User Daily job must be ordered. There are several ways this can be done:

  • You can order the User Daily job using the Online facility. But this requires going into the Control-M Online facility—still a manual intervention.

  • You can order the User Daily job using CTMJOB.

  • You can use any the other job ordering methods available, some of which will be described below. But this, too, involves manual intervention.

  • Finally, you can order User Dailies using the New Day procedure. The New Day procedure is defined and maintained by the Control-M administrator, and is run once each day as part of New Day processing. When User Dailies are defined to the New Day procedure, they are automatically ordered each day that their basic scheduling criteria are satisfied. Most sites use a combination of User Daily jobs and the New Day procedure to completely automate daily job scheduling.

  • Because the New Day procedure is defined by the Control-M administrator, and is discussed in detail in the INCONTROL for z/OS Administrator Guide, it is not discussed in this guide.

Before moving on to a discussion of alternative methods of job ordering, you should note the following points about User Daily jobs:

  • Control-M provides two sample User Daily job scheduling definitions in member MAINDAY in the SCHEDULE library:

    • DAILYSYS is a sample User Daily for scheduling system jobs

    • DAILYPRD is a sample User Daily for scheduling production jobs.

  • You can define as many User Daily jobs as you want, with each ordering only those jobs that you want it to order. This leaves you great flexibility in organizing your User Daily jobs by whatever system is useful. For example, you can organize User Dailies according to table, application or group, department, basic and runtime criteria of the jobs being ordered, or any other useful criteria or combination or criteria.

  • You can define the scheduling criteria of the User Daily job in any way you wish. For example, if a certain set of jobs is to be processed at the end of the work day, there is no need for them to sit in the Active Jobs file all day. Instead, you can ensure that they are ordered only in the evening or at night, by appropriately defining the TIME FROM criteria of the User Daily that orders those jobs.

  • If you want, you can define a User Daily to run several maintenance procedures that you would like run in succession.

  • Although the New Day procedure is ordered only once each day, at start of New Day, you can order User Daily jobs whenever you wish, and as often as you wish. Of course, you must ensure that this does not produce unwanted results. If you do not want multiple orders of the same job, you should not run the User Daily more than once.

  • You can locate your User Daily jobs as you wish. For example, if all the User Daily jobs are placed in a single table, then by ordering that table you order all User Daily jobs that it contains.

Job Ordering Through Online Utility CTMJOBRQ

As previously discussed, the occasional job scheduling request can be made using the Order or Force option in the Scheduling Definition facility. At some sites, however, access to Scheduling Definition facility may be restricted for security reasons, for example, to prevent the changing or deletion of job scheduling definitions.

As an alternative to ordering or forcing a job in the Scheduling Definition facility, you can order or force a job using Online Utility M1.

  1. Enter the Online Utilities menu and request utility CTMJOBRQ, which is Option M1. The Job Request Utility panel is displayed.

    Copy
    ----------------------------  JOB REQUEST UTILITY  ----------------------------
    COMMAND ===>



      SCHEDULING LIBRARY      ===> CTM.TEST.SCHEDULE

      TABLE NAME              ===>

      JOB NAME                ===>                       (* for all jobs)

      SCHEDULED RUN DATE      ===> 02 02 01              (ODATE - format MM DD YY)

      FORCED SCHEDULING       ===> NO                    (YES,NO)

      ENTER YES TO CONTINUE   ===>

      GROUP                   ===>                       (Optional)



      CALENDAR LIBRARY        ===> IOA.TEST.CAL

In this panel you can

  • specify the name of the library, table and job scheduling definition

  • To request all jobs in a table, specify an asterisk in the job name field.

  • specify the scheduling run date

  • The basic scheduling criteria of the jobs are checked against this date to see if the job should be ordered as requested.

  • indicate if you want the job forced if it should not be scheduled on that particular run date

  • specify the name of the calendar library

  • This tells Control-M where to look if a calendar name is specified in the job scheduling definition. Calendars are discussed in Additional Features.

  • specify a group name

The GROUP field is generally useful in tables whose jobs do not inherit the GROUP from the table, and only if an * is specified in the JOB NAME field. It limits the jobs ordered to those belonging to the specified group.

In general, it is probably quicker to use batch utility CTMJOB, especially if you are ordering several jobs. Perhaps the only advantage of online utility CTMJOBRQ is that you do not need to know the format of the order statements—you merely fill in the parameter fields presented in the panel. But CTMJOBRQ is definitely not a powerful utility.

Other Methods of Job Ordering

Thus far, you have seen the following methods of job ordering:

  • Order and Force options in the Job and Table List screens

  • Batch utility CTMJOB

  • User Daily jobs

  • Online utility CTMJOBRQ

The following job ordering methods are also available:

Table 22 Non-Routine Job Ordering Methods

Method

Description

End User Job Order interface

Enables job ordering through online utility (or CLIST) CTMJBINT M6. Described in the Control-M for z/OS User Guide.

Utility CTMBLT

Described in the Control-M chapter of the INCONTROL for z/OS Utilities Guide.

CLIST CTMCJOBS

Enables job ordering directly from the TSO environment. Described in the Control-M for z/OS User Guide.

Quick submit command CTMQSB

Enables job ordering through Control-M submit command CTMQSB instead of the ISPF submit command. Described in the Control-M for z/OS User Guide.

Job ordering from special environments

Facilitates job ordering from other environments, such as CICS and ROSCOE, through CTMAJO. Described in the Control-M for z/OS User Guide.

  1. Exit the Online facility.

    This completes the steps in this chapter of the Control-M for z/OS Getting Started Guide.

Review

In this chapter you

  • learned to order jobs using batch utility CTMJOB, and learned several different methods and formats that can be used to let the utility know which jobs to order

  • learned to define the JCL and job scheduling definition for a User Daily job, and how to define its required Date Control record, and a second, optional Date Control record for Enhanced Daily Checkpointing

  • took a look at the CTMJOBRQ online utility panel that can be used to order a job

  • briefly identified several other methods of job ordering

Recommended Reading

Before continuing with the next chapter, it is recommended that you read the following: