COBOL application developer tasks

These upgrade tasks are typically completed by COBOL application developers. These tasks include setting default compiler options, regression testing, checking for invalid data, and fixing the problems.

Set default compiler options

Tip: IBM IBM COBOL Upgrade Advisor for z/OS® outlines compiler option recommendations to tell you exactly what options need to be added, changed, or removed for your compiler version. If you are using IBM COBOL Upgrade Advisor for z/OS, follow the steps there to complete this task.
Set the default compiler options in IBM Enterprise COBOL for z/OS 6.4 to be compatible with previous COBOL compilers. This involves copying IGYCDOPT source from SIGYSAMP, setting the options, and then assembling the modified IGYCDOPT.

The most important options to set the same as previous compilers are:

  • ADV
  • AWO
  • DYNAM
  • NUMPROC (other than changing from NUMPROC(MIG) to NUMPROC(NOPFD))
  • TRUNC

You should also:

  1. Set up your source library control system compiler options for the new compiler to be compatible with the old compiler(s).
  2. Document all customization and setups performed for future reference.

Regression testing and invalid data

You can get different results with IBM Enterprise COBOL for z/OS 6.4 compared to previous compilers if your programs process "invalid COBOL data" or you have "invalid COBOL programs", where run time data values or programs do not conform to the rules in the Enterprise COBOL Language Reference manual.

To determine if your programs process invalid COBOL data at run time, or have mismatched parameters at run time, compile your programs with the following compiler options, and run regression tests:
  • NUMCHECK
  • PARMCHECK
  • SSRANGE
  • INITCHECK
  • OPT(0)
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 earlier compilers, recompile with the following compiler options:
  • NOSSRANGE
  • NONUMCHECK
  • NOPARMCHECK
  • OPT(2)
Once this is complete, run a final test and move the application into production.

It is important to test with each of SSRANGE, NUMCHCEK, and PARMCHECK because some users have found different invalid data results with Enterprise COBOL 6. INITCHECK is also important because it can find uninitialized data at compiler time which can also cause upgrade problems.

If you have not found any SSRANGE, NUMCHECK, PARMCHECK, or INITCHECK errors after a period of time, then you may consider skipping this step for future upgrades, as you may not have any invalid data usage. Additionally, this step is only recommended for the first time that a program is compiled with Enterprise COBOL 6. Once you have compiled a program with Enterprise COBOL 6, you can skip regression testing with SSRANGE, NUMCHECK, PARMCHECK, or INITCHECK for future compiles.

Another type of invalid data is zero addresses, wherein an instruction uses an address of zero to access memory. Programs with this issue might run fine for years, but when moving to a new level of z/OS, they might produce incorrect results. Such occurrences are 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.

Some customers have reported problems caused by invalid COBOL data that cannot be detected by inspecting source code when they migrate to Enterprise COBOL 5 or 6, and the most common problems are as follows:
  • 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
To identify these problems more easily, consider the following solutions:
  • 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.

Compiler options to detect problems

This section describes compiler options that help to detect, correct, or tolerate problems due to migration and problems that are carried from the earlier versions.

Table 1. Compiler options to solve invalid data issues
Invalid data problem Compiler options Step at which error messages appear Risk due to compiler upgrade ABO considerations

Invalid USAGE DISPLAY/PACKED data (data format nonconformation to the USAGE clauses of that data - this is for packed/zoned data, similar to string)

Option that identifies and corrects problems:
  • NUMCHECK
Option that tolerates problems:
  • INVDATA (Replaces the deprecated ZONEDATA, but ZONEDATA tolerates for compatibility)
    Note: Pay special attention to NUMPROC setting if you use INVDATA.
  • Run time
  • Compile time
    Note: Use NUMCHECK, when the compiler detects the problem at the compile time.

Wrong results or different behavior

Not an issue with ABO

Overpopulated binary data [data format nonconformation to the PICTURE clauses of that data - this is for binary data, similar to bit/bytes]

NUMCHECK
  • Run time
  • Compile time
    Note: Use NUMCHECK, when the compiler detects the problem at the compile time.

Wrong results or different behavior

Not an issue with ABO
Parameter passing size mismatch [data corruption beyond the end of WORKING-STORAGE] PARMCHECK Run time

Abends or wrong results

Not an issue with ABO
Data items used before set [usage of uninitialized data items] INITCHECK Compile time

Abends or wrong results

Not an issue with ABO
Table 2. Compiler options to solve carry-over issues
Problem description Compiler options Step at which error messages appear Risk due to compiler upgrade ABO considerations
  • 'indexed by' data item issue
  • Invalid table processing
  • Out-of-range storage references
SSRANGE Run time

The impact of out of range table access is more severe or very different with V5/V6 vs V4

SSRANGE also detects other problems that are common or present the same in COBOL 4,5,6

 
To find any cases of ‘hidden’ loss of data when statements truncate numeric data items DIAGTRUNC Compile time

The impact of out of range table access is more severe or very different with V5/V6 vs V4

SSRANGE also detects other problems that are common or present the same in COBOL 4,5,6