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


Modifying the JOB Processing Subroutine

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

Change this subroutine so that:

  1. Code the first statement to extract the first three characters of the job name and store them in this job_prefix variable.

    Note: If this job name is fewer than three characters, the job prefix variable is filled with trailing spaces.

  2. Code the statement on the following line to extract the first three characters of the user ID and store them in this user_prefix variable.
  3. Code the IF statement on the following line so that if the job_prefix value is equal to PMK and the job class is not equal to P, the statements within the following DO loop are executed.
  4. Code the following DO loop to call the $CAJCL_ERROR subroutine so that CA JCLCheck issues the associated (W)arning message.
  5. Code the IF statement on the following line so that if the job_prefix value is equal to SYS and the job class is not equal to X, the following statements within the DO loop are executed.
  6. Code the following DO loop to call the $CAJCL_ERROR subroutine so that CA JCLCheck issues the associated (W)arning message.
  7. Code the IF statement on the following line so that if the address space value is equal to real and the user prefix is not equal to SYS on the JOB card, the following statements within the DO loop are executed.
  8. Code the following DO loop to call the $CAJCL_ERROR subroutine so that CA JCLCheck issues the associated (E)rror message.
  9. Code the error_count= (error_count + 1) to increment the number of errors by 1 upon the issuance of an (E) severity code level or higher.

    Note: The levels of severity codes are assigned as follows:

    I = 0, W = 4, E = 8, S = 12.

    This adheres to normal CA JCLCheck error severity.

          /********************************************************************/
          /*  Job Card Processing Subroutine                                 */
          /********************************************************************/
          JOB_PROCESSING:
          job_prefix = SUBSTR(JOB.JOBNAME,1,3)
          user_prefix = SUBSTR(JOB.USERID,1,3)
          If job_prefix = 'PMK' & JOB.CLASS ¢ 'P' then
           Do
           Call $CAJCL_ERROR,
           'W','Class "P" should be used for production jobs'
           End
         If job_prefix = 'SYS' & JOB.CLASS ¢ 'X' then
           Do
           Call $CAJCL_ERROR,
           'W','Class "X" should be used for technical services jobs'
           End
          If JOB.ADDRSPC = 'REAL' & user_prefix ¢ 'SYS' then
           Do
           Call $CAJCL_ERROR,
           'E','ADDRSPC=REAL is a restricted JCL parameter'
           error_count = (error_count + 1)
           End
          Return