Previous Topic: Modifying the EXEC Processing SubroutineNext Topic: Modifying the END-OF-STEP Processing Subroutine


Modifying the DD Processing Subroutine

Modify this DD processing subroutine to increment the DD statement counter. If the DD statement UNIT parameter is CART (cartridge), have the cart count statement increment the count by 1 to keep track of the number of cartridges used per step.

  1. Increment the dd_count variable by one by 1 each time a DD statement is processed.
  2. Code the IF statement on the following line to check for a value equal to CART (cartridge) in the DD statement UNIT parameter. If the parameter is equal to CART, the following statements within the DO loop are executed.
  3. Code the following DO loop to increment the cartridge count by 1.
  4. Code the IF statement on the following line to check the value of UNIT for the name BOGUS and if the unit name is BOGUS, execute the statements in the following DO WHILE loop.
  5. Code the following DO loop to issue an informational message and set the value of UNIT to null, removing it from the JCL.
  6. Code the IF statement on the following line to check the value of ddname for the name OBSOLETE and if the ddname is OBSOLETE, execute the statements in the following DO loop.
  7. Code the following DO loop to issue a warning message and set the delete_flag to Y for later processing in the raw_processing subroutine.
  8. Code the IF statement on the following line to check the value of ddname for the name COMMENT and if the ddname is COMMENT, execute the statements in the following DO loop.
  9. Code the following DO loop to issue an informational message and set the comment_flag to Y for later processing in the raw_processing subroutine.
          /********************************************************************/
          /*  Data Definition Processing Subroutine                          */
          /********************************************************************/
          DD_PROCESSING:
           dd_count = (dd_count + 1)
           If (DD.UNIT = 'CART') then
            Do
           cart_count = (cart_count + 1)
           End
           If (DD.UNIT = 'BOGUS') then
            Do
           Call $CAJCL_ERROR,
           'I','Unit name coded 'dd.unit' is no longer valid and will be removed'
           DD.UNIT = ''                       /* remove unit name from JCL */
           End
           If (DD.DDNAME = 'OBSOLETE') then
            Do
           delete_flag = 'Y'                   /* delete this statement */
           Call $CAJCL_ERROR,
           'W','DD named 'dd.ddname' was coded and is no longer required, this statement
           will be deleted'
           End
           If (DD.DDNAME = 'COMMENT') then
            Do
           comment_flag = 'Y'                   /* delete this statement */
           Call $CAJCL_ERROR,
           'I','DD named 'dd.ddname' will be commented out, it is no longer valid'
          End
          Return