Previous Topic: Modifying the INITIAL PROCESSING SubroutineNext Topic: Modifying the EXEC Processing Subroutine


Modifying the JOB Processing Subroutine

Note: All values for the statement variables (that is, JOB, EXEC, DD) change when they encounter a new value for that statement variable.

Change the JOB Statement subroutine to obtain the current time and date. Code an IF statement test so that if the time is less than 17:00 hours (5:00 p.m.) and the job class is equal to O, then CA JCLCheck issues an error message if the test is true.

  1. Assign the current hour to the curr_hour variable.
  2. Assign the current time in civil format, HH:MMnn, with nn being a.m. or p.m., to the curr_c_time variable.
  3. Code the IF statement on the following line. If the JOB.CLASS variable is equal to O and the current time is less than 17:00 hours (5:00 p.m.), the statements within the following DO loop are executed.
  4. Code the DO loop to call the $CAJCL_ERROR subroutine so that CA JCLCheck issues the associated (E)rror message.

    The following are error message severity levels:

    I = 0

    W = 4

    E = 8

    S = 12

    This adheres to normal CA JCLCheck error severity standards.

       /********************************************************************/
       /*  Job Card Processing Subroutine                                 */
       /********************************************************************/
       JOB_PROCESSING:
       curr_hour = TIME(H)     /*   Get the current hour */
       curr_c_time = TIME(C)     /*   Get time in Civil format */
       If JOB.CLASS = 'O' & curr_hour < 17 then
         Do
        Call $CAJCL_ERROR,
        'E','Class "O" is reserved for second shift usage, retry after 5 PM, it is
        'only curr_c_time
        End
       Return