Upgrade recommendations and best practices
Upgrading to Enterprise COBOL 5 and 6 is more difficult than earlier COBOL compiler migrations (except for the OS/VS COBOL to Enterprise COBOL upgrade), and it is recommended that you read this section before you upgrade to Enterprise COBOL 5 or 6.
Decide on the approach for the upgrade
A big motivation towards upgrading your COBOL programs is to continue using supported software. Some earlier compilers have reached end of support, but you can run the COBOL applications as long as they run on current z/OS hardware, with the z/OS Language Environment as your COBOL runtime.
- Upgrade all programs/applications at once
- Upgrade only specific applications for now
- Upgrade as part of a normal development process
In general, for Enterprise COBOL
5 and 6, consider having a team identified to upgrade
each application completely, rather than upgrading one or two programs at a time. In this way, all
programs in an application will be upgraded, so future updates or fixes will not also involve an
upgrade. You can save costs in the long run because more programs can take advantage of the
million instructions per second (MIPS)
savings with Enterprise COBOL
5 and 6.
Regression testing
For information on regression testing and invalid data, refer to Regression testing and invalid data.
Another type of invalid data is zero addresses, wherein an instruction uses an address of zero to access memory. Programs that do this may run fine for years, but when moving to a new level of z/OS, they may begin producing incorrect results. Such occurrences have been seen when customers move to z/OS 2.5 from earlier z/OS levels. To identify and fix this problem, use the Zero Address Detection (ZAD) feature of z/OS.
SLIP Zero Address Detection (ZAD) is a z/OS feature that detects and documents execution of an instruction that accesses (stores or fetches) storage by using an operand address that was formed from a general register containing zero. This detection feature allows the owner of an application to identify programming errors where an assembler instruction is inadvertently accessing data within the Prefixed Save Area (PSA) control block, which resides at virtual address zero, due to incorrect register content of zero.
For details about how to generate and read a z/OS SLIP Zero Address Detection (ZAD) report, see the technote.
Setting ARCH for the hardware level
Always set the correct ARCH level for your hardware level, or your programs may not run at all.
To set the ARCH level, explore the different levels of hardware where your COBOL applications might run on, including disaster recovery machines. Set ARCH to match the lowest level that you find, and set it in installation defaults only (IGYCDOPT). In particular, do not set ARCH in build tools or JCL or CBL/PROCESS. For TUNE, set it to match the hardware where performance is most important, such as production machines. Like ARCH, TUNE should only be set in installation defaults.
Ensure sufficient test coverage and set up automated testing
IBM Test Accelerator for Z is a test automation and test generation framework with support for on-demand virtual development and test z/OS environments. This tool was built specifically for z/OS developers and testers. Learn more about this product at the IBM Test Accelerator for Z product page or see the documentation at Overview of IBM Test Accelerator for Z.
Common problems and solutions
- Invalid data in numeric USAGE DISPLAY data items
- Parameter/argument size mismatches
- Overpopulated binary data items, with values that have more digits than are defined in the data definitions in programs compiled with TRUNC(STD) or TRUNC(OPT)
- Uninitialized data items, or data items that are used without first being set
- Use the
Scanning COBOL programs for compatibility
feature of IBM® Developer for z/OS® to check parameters and arguments. For details, refer to Scanning COBOL programs for compatibility. - Compile with SSRANGE, NUMCHECK, PARMCHECK, INITCHECK, and OPT(0) for initial code changes and unit tests.
- Recompile with NOSSRANGE, NONUMCHECK, NOPARMCHECK, and OPT(2), for quality assurance tests and production.