Preparing COBOL for MVS and VM programs

Perform the following steps for compiling your COBOL for MVS and VM programs:

  1. Create libraries (PDSE is suggested unless PDS is required in your organization) for compiler listing files. Allocate one or more compiler listing libraries for each environment, such as test and production.
  2. Create a corresponding listing library for each load library. Specify LRECL=133,RECFM=FBA,BLKSIZE=(multiple of lrecl < 32K).
  3. For all programs, such as batch, CICS, and IMS:
    • In test environments, specify compiler options TEST(ALL,SYM),NOOPT,LIST,MAP,SOURCE,NONUMBER,XREF(SHORT) to create a module that can be used with Debug Tool for z/OS, Fault Analyzer for z/OS and Application Performance Analyzer for z/OS.

      TEST is required for Debug Tool for z/OS.

      The ALL sub-option adds debug hooks, which will add some run-time overhead.

      SYM stores symbolics data required by Debug Tool for z/OS into the module, which can make it significantly larger.

      The other options format the compiler listing as required by Debug Tool for z/OS, Fault Analyzer for z/OS, and Application Performance Analyzer for z/OS.

    • In production environments, specify compiler options NOTEST,LIST,MAP,SOURCE,NONUMBER,XREF(SHORT) to create a production-ready module that can be used with Fault Analyzer for z/OS and Application Performance Analyzer for z/OS (but not Debug Tool for z/OS). Specify OPTIMIZE if preferred.

      NOTEST disables source level debugging with Debug Tool , but can provide better performance and smaller module size.

      The other options (except OPTIMIZE) format the compiler listing as required by Fault Analyzer for z/OS and Application Performance Analyzer for z/OS.

  4. Modify the SYSPRINT DD in the JCL of the compiler step to refer to a file.
    //SYSPRINT DD DSN= compiler.listing.pds(pgmname),DISP=SHR
    Save the compiler listing in a file in the compiler listing library and specify a member name that is equal to the program name of your application program. This is the source information file for Debug Tool for z/OS, Fault Analyzer for z/OS and Application Performance Analyzer for z/OS.
  5. Modify the promotion process to promote compiler listing files. When a load module is promoted, for example, from test to production, promote the corresponding compiler listing file or files. A promotion can be a recompile, a copy, or a move. Perform the same steps with the compiler listing file that you perform with the module during promotion.
  6. Optionally, include a Debug Tool Language Environment exit module into the load module during the linkage editor step. This is one way to enable Debug Tool’s panel 6 in ISPF, a simple panel-driven method to start the debugger automatically when a program runs, without JCL changes, based on the program name and user ID. Use module EQADBCXT for batch programs (including IMS batch), EQADICXT for IMS/TM programs and EQADDCXT for DB2 stored procedures. Do not include the exit module for CICS programs.