Specifying compiler options under z/OS UNIX

The compiler is installed and set up with default compiler options. While installing the compiler, a system programmer can fix compiler option settings to ensure better performance or maintain certain standards. You cannot override any compiler options that your site has fixed.

About this task

For options that are not fixed, you can override the default settings by specifying compiler options in any of three ways:

  • Code them on the PROCESS or CBL statement in your COBOL source.
  • Specify the -q option of the cob2 command.
  • Set the COBOPT environment variable.

The compiler recognizes the options in the above order of precedence, from highest to lowest. The order of precedence also determines which options are in effect when conflicting or mutually exclusive options are specified. When you compile using the cob2 command, compiler options are recognized in the following order of precedence, from highest to lowest:

  1. Installation defaults fixed as nonoverridable
  2. The values of BUFSIZE, SQL, SQLIMS, and OUTDD options in effect for the first program in a batch compilation
  3. The values that you specify on PROCESS or CBL statements in COBOL source programs
  4. The values that you specify in the cob2 command's -q option string
  5. The values that you specify in the COBOPT environment variable
  6. Installation defaults that are not fixed

Restrictions:

  • The SQL coprocessor can be used with a compile job initiated from z/OS UNIX. All the following conditions must be met for this to work:
    • The Db2® data set that contains the Db2 coprocessor services must be included in your STEPLIB, unless these services are in the LNKLST. Typically, this data set is called xxxxxx.SDSNLOAD. For example, for DB2® 11 it might be DSNB10.SDSNLOAD, but your installation might have changed the name.
    • The SQL compiler option must be specified.
    • The -dbrmlib option of cob2 must be specified. Suppose that file is the name of the input COBOL file to compile:
      • Use dbrmlib=xxx to direct the database request module (DBRM) to an existing PDS data set, where a new member named file will be created.
      • Use -dbrmlib (without =xxx) to send the DBRM to an HFS file named file.dbrm.
    The separate SQL precompiler does not run under z/OS UNIX.
  • Do not use the SQLIMS compiler option under z/OS UNIX.
  • The OPTFILE option is ignored when you compile using the cob2 command under z/OS UNIX.

    You can use the COBOPT environment variable, which provides a capability that is comparable to OPTFILE, instead.