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
orCBL
statement in your COBOL source. - Specify the
-q
option of thecob2
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:
- Installation defaults fixed as nonoverridable
- The values of
BUFSIZE
,SQL
,SQLIMS
, andOUTDD
options in effect for the first program in a batch compilation - The values that you specify on
PROCESS
orCBL
statements in COBOL source programs - The values that you specify in the
cob2
command's-q
option string - The values that you specify in the COBOPT environment variable
- 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 theLNKLST
. 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 ofcob2
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 namedfile.dbrm
.
- Use
- The Db2® data
set that contains the Db2 coprocessor
services must be included in your
- Do not use the
SQLIMS
compiler option under z/OS UNIX. - The
OPTFILE
option is ignored when you compile using thecob2
command under z/OS UNIX.You can use the COBOPT environment variable, which provides a capability that is comparable to
OPTFILE
, instead.