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.

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:

  • Do not use the SQL compiler option under z/OS UNIX.

    Neither the separate SQL precompiler nor the integrated SQL coprocessor runs 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.