Migration recommendations to Enterprise COBOL V6
Migration to Enterprise COBOL V5 and V6 is more difficult than earlier COBOL compiler migrations (except for the OS/VS COBOL to Enterprise COBOL migration), and it is recommended that you read this section before you migrate to Enterprise COBOL V5 or V6.
Regression tests
The recommended migration strategy for Enterprise COBOL V6 is to compile each application (group of programs) with COBOL V6 using SSRANGE, NUMCHECK, PARMCHECK, INITCHECK, and OPT(0), and regression test the application alongside the same application in its current form (that is, compiled with Enterprise COBOL V4 or earlier compilers). If you do not get any SSRANGE, NUMCHECK, PARMCHECK, or INITCHECK errors, and you are sure that you get the same results with the new compiler as with the earlier compilers, recompile with NOSSRANGE, NONUMCHECK, NOPARMCHECK, and OPT(2); then run a final test and move the application into production. The reason for testing with SSRANGE, NUMCHECK, and PARMCHECK is that some customers have found that they have invalid COBOL data that gets different results with COBOL V6. INITCHECK can find (at compile time) cases of uninitialized data which could also cause migration problems.
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.
Best practices
Instead of treating Enterprise COBOL V5 and V6 like business as usual, consider having a team identified to migrate each application completely, rather than migrating one or two programs at a time. In this way, all programs in an application will be migrated, so that future updates or fixes will not also involve a migration. 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 V5 and V6.
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
- Always compile with RULES(NOEVENPACK) and DIAGTRUNC.
- Use the "Scanning COBOL programs for compatibility" feature of IBM® Developer for z/OS to check parameters and arguments. For details, see 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.