What is new in Enterprise COBOL for z/OS 6.2 and COBOL 6.2 with PTFs installed
This section lists new and improved features in Enterprise COBOL for z/OS® 6.2 and Enterprise COBOL for z/OS 6.2 with PTFs installed.
Enterprise COBOL for z/OS supports the continuous delivery (CD) model so that you can receive new features and enhanced capabilities as soon as the code is ready without waiting for the next release. The below feature descriptions that begin with an APAR number are introduced in the PTFs that are shipped with Enterprise COBOL for z/OS V6.2. Install the latest PTFs using the FIXCAT feature of SMP/E to take advantage of these features. For more information on SMP/E FIXCATs, see Determining service required. For more information on PTFs and APARs for Enterprise COBOL for z/OS, see the COBOL for z/OS support page.
The enhancements that are described in this section also have an associated cross-reference to the COBOL publications for your convenience.
- Support of 2002 and 2014 COBOL standards
- Support of IBM® extensions
- JSON enhancements
- Other language element changes
- Compiler option changes
- Usability enhancements
- Listing changes
- IBM-supplied CICS® reserved-word table changes
- Installation customization changes
- COBOL/JNI interface enhancement
- Debugging enhancement
- Compiler message changes
Support of 2002 and 2014 COBOL standards
- The DEFINE directive defines or undefines a compilation variable. (DEFINE)
- The EVALUATE directive provides a multi-branch method of choosing the source lines to include in a compilation group. (EVALUATE)
- The IF directive provides for a one-way or two-way conditional compilation. (IF)
-
The new INLINE directive allows the compiler to decide whether to inline procedures referenced by PERFORM statements in the source program. (INLINE)
- PI97160: Add support for the TO FALSE phrase of the SET statement, as well as the corresponding WHEN SET TO FALSE clause, which allow you to use the SET statement to set condition names to values that will test false in conditions. (Format 4: SET for condition-names and Format 2 VALUE clause: condition-name value)
The following intrinsic functions are added as part of the 2014 COBOL Standard:
- The E function returns an approximation of e, the base of natural logarithms. (E)
- The PI function returns a value that is an approximation of pi, the ratio of the circumference of a circle to its diameter. (PI)
- The TRIM function returns a character string that contains the characters in the argument with leading spaces, trailing spaces, or both, removed. (TRIM)
- The ABS function returns the absolute value of the argument. (ABS)
- The BYTE-LENGTH function returns an integer equal to the length of the argument in bytes. (BYTE-LENGTH)
- The EXP function returns an approximation of the value of e raised to the power of the argument. (EXP)
- The EXP10 function returns an approximation of the value of 10 raised to the power of the argument. (EXP10)
- The NUMVAL-F function returns the numeric value represented by the alphanumeric character string or national character string specified as the argument. The function removes any leading or trailing spaces in the string to produce a numeric value. (NUMVAL-F)
- The SIGN function returns +1, 0, or –1 depending on the sign of the argument. (SIGN)
- The TEST-NUMVAL function verifies that the contents of argument-1 conform to the specification for argument-1 of the NUMVAL function. (TEST-NUMVAL)
- The TEST-NUMVAL-C function verifies that the contents of argument-1 conform to the specification for argument-1 of the NUMVAL-C function. (TEST-NUMVAL-C)
- The TEST-NUMVAL-F function verifies that the contents of argument-1 conform to the specification for argument-1 of the NUMVAL-F function. (TEST-NUMVAL-F)
Support of IBM extensions
- PI99703:
- The BIT-OF function returns an alphanumeric character string consisting of characters "1" and "0" that correspond to the binary value of each byte in the input argument. (BIT-OF)
- The HEX-OF function returns an alphanumeric character string consisting of the bytes of the input argument converted to a hexadecimal representation. (HEX-OF)
HEX-OF
orBIT-OF
intrinsic functions to convert data of any type to hexadecimal or binary digits. (Converting to hexadecimal or bit data (HEX-OF, BIT-OF)) - PH02183:You can use the
- The BIT-TO-CHAR function returns a character string consisting of bytes that correspond to the bit pattern indicated by the sequence of "0" and "1" characters in the input argument. (BIT-TO-CHAR)
- The HEX-TO-CHAR function returns a character string consisting of bytes that correspond to the hexadecimal digit characters in the input argument. (HEX-TO-CHAR)
HEX-TO-CHAR
orBIT-TO-CHAR
intrinsic functions to convert hexadecimal character strings to alphanumeric data items. (Converting from hexadecimal or bit data (HEX-TO-CHAR, BIT-TO-CHAR))
JSON enhancements
You can watch this video to get an overview of the JSON support in Enterprise COBOL for z/OS V6.
- JSON GENERATE:
- PH20084: A new "NAME is OMITTED" phrase is added to the JSON GENERATE
statement to allow generation of an anonymous JSON object, whose top-level
parent name is not generated. Note: COBOL Runtime LE PTF UI66560(V2R2)/UI66555(V2R3)/UI66557(V2R4) must also be applied on all systems where programs that make use of this new feature are linked or run.
- PH28546: A new "CONVERTING" phrase is added to the JSON GENERATE
statement so that you can generate JSON boolean values. Note: COBOL Runtime LE APAR PH26698 must also be applied on all systems where programs that make use of this new feature are linked or run.
- PH32356: New "when-phrase" and "generic-suppression-phrase" are
added to the JSON GENERATE statement so that you can conditionally
suppress data items during JSON GENERATE. Note: COBOL Runtime LE APAR PH31172 must also be applied on all systems where programs that make use of this new feature are linked or run.
- PH20084: A new "NAME is OMITTED" phrase is added to the JSON GENERATE
statement to allow generation of an anonymous JSON object, whose top-level
parent name is not generated.
- JSON PARSE:
- The new JSON-STATUS special register is used to indicate either that a JSON PARSE statement executed successfully or that a nonexception condition occurred. (JSON-STATUS)
- The JSON-CODE special register is also used to indicate either that a JSON PARSE statement executed successfully or that an exception condition occurred. (JSON-CODE)
- PH02251: As the new keyword OMITTED is introduced, the JSON PARSE
statement is updated. Note: COBOL Runtime LE PTF UI58596(V2R1)/UI58595(V2R2)/UI58603(V2R3) must also be applied on all systems where programs that make use of this new feature are linked or run.
- PH28546: A new "CONVERTING" phrase is added to the JSON PARSE
statement so that you can parse JSON boolean values. Note: COBOL Runtime LE APAR PH26698 must also be applied on all systems where programs that make use of this new feature are linked or run.
Other language element changes
- PH19715: A new UUID4 intrinsic function is introduced, which returns
a 36-character alphanumeric string that is a version 4 universally
unique identifier. (UUID4)Note: COBOL Runtime LE PTF UI66560(V2R2)/UI66555(V2R3)/UI66557(V2R4) must also be applied on all systems where programs that make use of this new feature are linked or run.
- PI95081: A new LOC(24|31) phrase is added to the ALLOCATE statement to control the location of dynamic storage that is acquired, which overrides the influence of the DATA compiler option. (Storage and its addressability)
- PI97434: Add support for processing national data items including surrogate-pair awareness to the following intrinsic functions: REVERSE, ULENGTH, UPOS, USUBSTR, and UWIDTH. (Intrinsic functions and national data)
Compiler option changes
- PI97621: ALOWCOPYLOC:
ALOWCOPYLOC
affects whetherCOPYLOC
options can be used when compiling COBOL programs. (ALOWCOPYLOC) - PI97621: ALOWDEFINE:
ALOWDEFINE
affects whetherDEFINE
options can be used when compiling COBOL programs. (ALOWDEFINE) - PI91584: COPYLOC: The new
COPYLOC
compiler option can be used to add either aPDSE
(orPDS
) dataset or z/OS® UNIX directory as an additional location to be searched for copy members during the library phase. (COPYLOC) - DEFINE: The
DEFINE
compiler option provides a way for you to assign values to compilation variables from outside the program source. If that is not needed, it is sufficient to use theDEFINE
directive within program source to define compilation variables. (DEFINE) - PH05855: INITIAL: The new
INITIAL
compiler option allows you to get a program that has initial values in data items each time the program is called, without having to add theIS INITIAL
clause to thePROGRAM-ID
paragraph, and without having to use dynamicCALL
andCANCEL
statements. (INITIAL) - INITCHECK:
- Use the
INITCHECK
option to have the compiler check for uninitialized data items and issue warning messages when they are used without being initialized. - PH09225: The INITCHECK option can be specified with OPTIMIZE(0).
- PH24413: 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.
- Use the
- INLINE: The
INLINE
compiler option controls whether the inlining of procedures (paragraphs or sections) referenced by PERFORM statements in the source program is allowed. (INLINE) - PH31500: The new
INVDATA
compiler option replaces the deprecatedZONEDATA
compiler option and provides users fine-grained control over how the compiler generates code to handleUSAGE DISPLAY
andUSAGE PACKED-DECIMAL
data items that contain invalid data. (INVDATA) - NUMCHECK:
- The
NUMCHECK
compiler option tells the compiler whether to generate extra code to validate data items when they are used as sending data items. For zoned decimal (numericUSAGE DISPLAY
) and packed decimal (COMP-3
) data items, the compiler generates implicit numeric class tests for each sending field. For binary data items, the compiler generatesSIZE ERROR
checking to see whether the data item has more digits than itsPICTURE
clause allows. - PI96135: For packed decimal (COMP-3) data items that have an even number of digits, the unused bits are checked for zeros.
- PI98480: New suboptions ALPHNUM | NOALPHNUM are added to the NUMCHECK(ZON) option to control whether the compiler will generate code for an implicit numeric class test for zoned decimal data items that are being compared with an alphanumeric data item, alphanumeric literal or alphanumeric figurative constant.
- PH08642: Redundant checks previously added by the NUMCHECK option have been removed, improving performance, and some checks can be done at compile time. Specifying NUMCHECK may also cause the compiler to produce some messages at compile time instead of at run time.
- PH11667: NUMCHECK(BIN) will check for binary data items (COMP, COMP-4, and USAGE BINARY) even when TRUNC(BIN) is in effect.
- PH24340: New suboptions LAXREDEF | STRICTREDEF are added to the NUMCHECK(ZON) option to control whether the compiler will check and issue warning messages for redefined items.
- PH28544: New suboptions TRUNCBIN | NOTRUNCBIN are added to the NUMCHECK(BIN) option to control whether the compiler will generate the checking code for binary data items.
- PTF UI71111 (no APAR number): New functionality is added to NUMCHECK to check alphanumeric senders whose contents are being moved to a numeric receiver. For alphanumeric senders whose contents are being moved to a numeric receiver, the compiler treats the sender as a numeric integer so NUMCHECK generates an implicit numeric class test for each alphanumeric sender.
- PH41362: When a zoned decimal data item is moved to another zoned
decimal data item,
NUMCHECK
will not check the sender of the move. However, if the sender is subsequently used in a numeric context, it will be checked. - PH50301: The
NUMCHECK
compiler option is updated to avoid generating runtime checking code of zoned decimal senders inMOVE
statements when the receiver is an alphanumeric data item andNUMCHECK(ZON(LAX))
is in effect.
- The
- PARMCHECK: The
PARMCHECK
option tells the compiler to generate an extra data item following the last item inWORKING-STORAGE
. This buffer data item is then used at run time to check whether a called subprogram corrupted data beyond the end ofWORKING-STORAGE
. (PARMCHECK)
- AFP: The default value is changed to AFP(NOVOLATILE). (AFP)
- ARCH: A new higher level of ARCH(12) is accepted. ARCH(7) is still the default. (ARCH)
- MAXPCF: The default value is changed to MAXPCF(100000) to reflect the increased capacity of the V6 compiler. (MAXPCF)
- PH36690:
OFFSET
: TheOFFSET
option behavior is changed. If there are multiple blocks of instructions for a single line of COBOL code, multiple entries will be generated for those instructions in theOFFSET
table. (OFFSET) - NOSTGOPT: In earlier versions, data items can get optimized with OPT(2) even when NOSTGOPT was in effect. NOSTGOPT was changed in this version so that no optimization of storage or data items occurs even with OPT(2). This is especially helpful for WORKING-STORAGE eye-catchers. (STGOPT)
- RULES:
- PH04369: RULES(NOEVENPACK) will not issue messages for even-digit PACKED-DECIMAL data items whose names start with DFH, DSN, EYU, or SQL, that is, data items generated for/by CICS® and Db2®®.
- PI91585: New suboptions OMITODOMIN | NOOMITODOMIN are added to the RULES option to control whether the compiler will issue warning messages for any OCCURS DEPENDING ON clauses that are specified without integer-1 (the minimum number of occurrences).
- PI91586: New suboptions UNREF | NOUNREFALL | NOUNREFSOURCE are added to the RULES option to control whether the compiler will report 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).
- PH36688: New suboptions
LAXREDEF | NOLAXREDEF
are added to theRULES
option to inform users of redefined items with mismatched lengths.
- SSRANGE: New suboptions MSG and ABD are added to the SSRANGE compiler option to control how the compiler checks reference modification lengths. (SSRANGE)
- TEST:
- New suboptions SEPARATE and 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).
- Runtime APAR PH20569(V2R2/V2R3/V2R4): The included DWARF diagnostic information when TEST(NOSEPARATE) is in effect can be extracted from the LLA/VLF managed programs.
- PH04485: New suboptions DSNAME | NODSNAME are added to the TEST|NOTEST(SEPARATE) option to control whether the external file name, which is the SYSDEBUG dataset name used during compilation, will or will not be stored in the object program.
- PI90571: ZONEDATA: The ZONEDATA option is updated to affect the behaviour of MOVE statements, comparisons, and computations for USAGE DISPLAY or PACKED-DECIMAL data items that could contain invalid digits, an invalid sign code, or invalid zone bits. (ZONEDATA)
- PH31500:
ZONEDATA
: This compiler option is deprecated but tolerated and is automatically mapped to an equivalent form of the newINVDATA
compiler option. (ZONEDATA) - PH41362:
NUMCHECK(ZON)
:LAXREDEF|STRICTREDEF
option is deprecated but is tolerated for compatibility, and it is replaced by theLAX|STRICT
option. (NUMCHECK)
Usability enhancements
Improves usability of the compiler in the z/OS UNIX System Services environment with addition of help information for the cob2 compiler invocation command. (cob2 syntax and options)
Listing changes
- Compiler diagnostic messages now appear at the end of the listing, as was the case in COBOL compilers before Enterprise COBOL V5.
- Addition of MD5 signature to program objects and debug data to allow matching of debug data with executables even if a program is recompiled. (Example: MD5 signature)
- Three new fields are added at the end of PPA4:
- Offset of the first user-defined data item in WORKING-STORAGE.
- Total length of user-defined data items in WORKING-STORAGE.
- Bit to indicate whether there are EXTERNAL data items.
IBM-supplied CICS reserved-word table changes
PI91589: New COBOL words are added to the IBM-supplied CICS reserved-word table. (CICS reserved-word table)
Installation customization changes
- PH36777: Adds support for diagnosing miscoded options or options
coded as
OPTION()
instead ofOPTION=
in the COBOL customization macro. (Changing the defaults for compiler options)
COBOL/JNI interface enhancement
Runtime APAR PH37101(V2R3/V2R4): An enhancement is made to assist COBOL programs running in AMODE 31 to interact with Java™ programs in AMODE 64. (COBOL programs in AMODE 31 interacting with Java programs in AMODE 64)
Debugging enhancement
Runtime APAR PH61133 (V2R4 or later): You can use ddname IGZPROUT
at the run step of your JCL to generate a report of all COBOL 5 or later programs that are called
dynamically, statically, and via DLL linkage. (Generating a report of dynamically called COBOL programs)
Compiler message changes
- PH08642: Specifying NUMCHECK may cause the compiler to produce
the following messages at compile time:
- IGYCB7313-E (IGYCB7313-E)
- IGYCB7314-E (IGYCB7314-E)
- IGYCB7315-W (IGYCB7315-W)
- IGYCB7316-W (IGYCB7316-W)
- PH42575: The following messages are updated to report additional information and return codes:
- IGYSI5305-U (IGYSI5305-U)
- IGYSI5306-U (IGYSI5306-U)