Compiler option changes in Enterprise COBOL 6

The following options are added:
Table 1. Compiler options new with Enterprise COBOL 6
Compiler option Comments
CONDCOMP New option in Enterprise COBOL V6.3 with the service PTFs. It affects the behavior of conditional compilation directives and controls how conditional code will be displayed in the listing.
COPYLOC New option in Enterprise COBOL 6.1 with the service PTFs, 6.2 with the service PTFs, and from 6.3. It can be used to add either a PDSE (or PDS) dataset or z/OS® UNIX directory as an additional location to be searched for copy members during the library phase.
DEFINE New option from Enterprise COBOL 6.2. It assigns a literal value to a compilation variable that is defined in the program by using the DEFINE directive with the PARAMETER phrase.
INITCHECK New option in Enterprise COBOL 6.1 with the service PTFs and from 6.2. It controls whether to check for uninitialized data items and issue warning messages when they are used without being initialized.
INITIAL New option in Enterprise COBOL 6.2 with the service PTFs and from 6.3. It causes a program and all of its nested programs to behave as if the IS INITIAL clause was specified on the PROGRAM-ID paragraph.
INLINE New option in Enterprise COBOL 6.1 with the service PTFs and from 6.2 and later versions. It controls the compiler to consider whether to inline procedures referenced by PERFORM statements in the source program. INLINE is a potential performance boosting option. (Note that INLINE was always in effect in COBOL 5.)
INVDATA New option in Enterprise COBOL 6.2 with the service PTFs and from 6.3. The option supercedes the deprecated ZONEDATA option. It tells the compiler whether data in USAGE DISPLAY and PACKED-DECIMAL data items is valid, and if not, what the behavior of the compiler should be.
To ease your migration to COBOL 5 or 6:
  • If your digits, sign code, and zone bits are valid, use NOINVDATA and the same NUMPROC setting that you used with COBOL 4 when using COBOL 5 or 6.
    Note: If you used NUMPROC(MIG) in 4, it is no longer available in COBOL 5 or 6 and you should use NUMPROC(NOPFD) in this scenario instead.
  • If you have invalid digits, invalid sign code, or invalid zone bits:
    • If you used NUMPROC(MIG) with COBOL 4, use INVDATA(FORCENUMCMP,NOCLEANSIGN) and NUMPROC(NOPFD) with COBOL 5 or 6.
    • If you used NUMPROC(NOPFD) with COBOL 4, use INVDATA(NOFORCENUMCMP,CLEANSIGN) (or simply INVDATA) with COBOL 5 or 6.
    • If you used NUMPROC(PFD) with COBOL 4, use INVDATA(NOFORCENUMCMP,CLEANSIGN) (or simply INVDATA) with COBOL 5 or 6.
JAVAIOP New option from Enterprise COBOL 6.4. It controls the behavior of COBOL programs that interoperate with Java™ though the JAVA-CALLABLE or JAVA-SHAREABLE directives or by calling Java static methods using the CALL statement.
LP New option from Enterprise COBOL 6.3. It can be used to indicate whether an AMODE 31 (31-bit) or AMODE 64 (64-bit) program should be generated with the related language features enabled.
NUMCHECK New option in Enterprise COBOL 6.1 with the service PTFs and from 6.2. It controls whether to generate implicit numeric class tests for zoned decimal and packed decimal data items that are used as sending data items, and whether to generate SIZE ERROR checking for binary data items.
PARMCHECK New option in Enterprise COBOL 6.1 with the service PTFs and from 6.2. It tells the compiler to generate an extra data item following the last item in WORKING-STORAGE. This buffer data item is then used at run time to check whether a called subprogram corrupted data beyond the end of WORKING-STORAGE.
SMARTBIN New option from Enterprise COBOL 6.4. It instructs the compiler to generate modules containing additional binary metadata that enables them to be optimized by IBM® Automatic Binary Optimizer (ABO) for z/OS 2.2.

For details, see SMARTBIN changes.

SUPPRESS New option from Enterprise COBOL 6.1. It controls whether to ignore the SUPPRESS phrase of COPY statements.
TUNE New option from Enterprise COBOL 6.3 with the service PTFs. It specifies the architecture for which the executable program will be optimized.

In Enterprise COBOL 6.4, TUNE(8) and TUNE(9) are removed, and a new higher level of TUNE(14) is accepted.

The default TUNE level matches the ARCH level if ARCH is specified. If ARCH is not specified, both ARCH and TUNE default to 10.

VSAMOPENFS New option from Enterprise COBOL 6.1. It affects the user file status reported from successful VSAM OPEN statements that require verified file integrity check.
VLR New option in Enterprise COBOL 6. It affects the READ statement processing of variable length records that have length conflicts. VLR(STANDARD) is the default. VLR(COMPAT) is compatible with older COBOL compilers. For details, see Variable length records - wrong length READ.

The following options are modified:

Table 2. Compiler option changed with Enterprise COBOL 6
Compiler option Comments
AFP It controls the compiler usage of the Additional Floating Point (AFP) registers that are provided by IBM z/Architecture® processors.
  • In Enterprise COBOL 6.1, AFP(VOLATILE) is the default.
  • From Enterprise COBOL 6.2, AFP(NOVOLATILE) is the default.
ARCH It specifies the machine architecture for which the executable program instructions are to be generated.
  • In Enterprise COBOL 6.1, ARCH(7) is the default.
  • In Enterprise COBOL 6.2, a new higher level of ARCH(12) is accepted, and ARCH(7) is still the default.
  • In Enterprise COBOL 6.3, ARCH(7) is removed, and a new higher level of ARCH(13) is accepted. ARCH(8) is the default.
  • In Enterprise COBOL 6.4, ARCH(8) and ARCH(9) are removed, and a new higher level of ARCH(14) is accepted. ARCH(10) is the default.
CURRENCY From Enterprise COBOL 6.3, the literal argument to the CURRENCY option can no longer be the character 'U' or the character 'u'.
INITCHECK In Enterprise COBOL 6.1 with the service PTFs, 6.2 with the service PTFs, and from 6.3 with the service PTFs, new suboptions LAX | STRICT are added to the INITCHECK option to control whether the compiler will issue warning messages for data items unless they are initialized on at least one, or on all, logical paths to a statement.
LANGUAGE

To change to uppercase English or Japanese compiler messages in COBOL 6, in addition to using the LANGUAGE compiler option, you must also set the Language Environment® runtime option NATLANG at compile time. We recommend using CEEOPTS DD in the compile JCL.

For example, to change messages to Japanese, use the LANGUAGE(JA) compiler option and also specify the NATLANG LE runtime option at compile time:
//CEEOPTS DD * 
          NATLANG(JPN)
/*
MAXPCF New option. It instructs the compiler not to optimize code if the program contains a complexity factor greater than n.
  • In Enterprise COBOL 6.1, MAXPCF(60000) is the default.
  • From Enterprise COBOL 6.2, MAXPCF(100000) is the default.
NOSTGOPT In Enterprise COBOL 6.1, data items can get optimized with OPT(2) even when NOSTGOPT was in effect. In Enterprise COBOL 6.1 with the service PTFs and from 6.2, NOSTGOPT was changed so that no optimization of storage or data items occurs even with OPT(2). This is especially helpful for WORKING-STORAGE eye-catchers.
NUMCHECK From Enterprise COBOL 6.3, when invalid data is found at compile time, regardless of whether NUMCHECK(MSG) or NUMCHECK(ABD) is in effect, an error-level message is produced and the check is removed.
RULES In Enterprise COBOL 6.2 with the service PTFs and from 6.3, the following new suboptions are added to the RULES compiler option:
  • OMITODOMIN | NOOMITODOMIN tells the compiler whether to issue warning messages for any OCCURS DEPENDING ON clauses that are specified without integer-1 (the minimum number of occurrences).
  • UNREF | NOUNREFALL | NOUNREFSOURCE tells the compiler whether to issue warning messages for unreferenced data items, and to control whether the reporting is done only for data items not declared in a copy member (NOUNREFSOURCE) or all data items (NOUNREFALL).
  • LAXREDEF | NOLAXREDEF tells the compiler whether to issue warning messages when a data item is redefined to a smaller item on any level.

From Enterprise COBOL 6.4, if there are multiple RULES specifications for a compilation, the suboptions are additive, which means they are accumulated.

SOURCE From Enterprise COBOL 6.3 with the service PTFs, new suboptions DEC | HEX are added to SOURCE compiler option. If SOURCE(DEC) is in effect, the line numbers for the listing of the source will be in decimal format. If SOURCE(HEX) is in effect, the line numbers for the listing of the source will be in hexadecimal format.
SSRANGE In Enterprise COBOL 6.1 with the service PTFs and from 6.2, new suboptions MSG | ABD are added to the SSRANGE compiler option to control the runtime behavior of the COBOL program when a range check fails.
TEST From Enterprise COBOL 6.2, new suboptions SEPARATE | NOSEPARATE are added to the TEST compiler option to control program object size on disk while retaining debugging capability. In addition, new combinations of suboptions are supported in both the TEST and NOTEST compiler options, including TEST(NODWARF), TEST(SEPARATE), and NOTEST(DWARF,SOURCE).

The following options are removed:

Table 3. Compiler option not available in Enterprise COBOL 6
Compiler option Comments
LVLINFO From Enterprise COBOL 6.1, the LVLINFO installation option is removed. The build level information is put where LVLINFO used to be, and the SERVICE compiler option can be used for user service level information in place of LVLINFO.
ZONECHECK In Enterprise COBOL 6.1 with the service PTFs and from 6.2, ZONECHECK is deprecated but is tolerated for compatibility, and it is replaced by NUMCHECK(ZON).

For a detailed list of options supported for the various compiler versions, see Option comparison.

For a detailed list of compiler options that can affect performance, see How to tune compiler options to get the most out of COBOL 6 in the Enterprise COBOL Performance Tuning Guide.

For detailed descriptions of all the compiler options, see Compiler options in the Enterprise COBOL Programming Guide.