Scanning COBOL programs for compatibility

Use the Scan for Compatibility action to scan a set of COBOL programs to determine whether the parameters passed between calling and called programs are compatible.

About this task

The Scan for Compatibility action can detect when a calling program is passing incompatible arguments to a called program. For example, one COBOL program might call another program using a 100-byte argument while the program expects a 200-byte argument.

Limitation: Call statements that reference Dynamic Length Data Items are not supported by the compatibility scanner.

Procedure

In the z/OS Projects or Remote Systems view, select a set of COBOL source programs, and then right-click and select Scan for Compatibility.
Scan for Compatibility menu item
The compatibility scanner analyzes all program calls to determine whether there are duplicate programs of the same name, whether the number of arguments used in a call is incorrect for any program, or whether the sizes of arguments are mismatched. For each incompatible call, a new problem marker is created in the Remote Error List.
Note: The compatibility scanner supports CALL statements using literals. When a data item is used in place of a literal in the CALL statement, the scanner uses static analysis to attempt to determine a value for the data item. If the data item has a VALUE clause defining a literal value for the data item or if the data item is assigned a literal value as part of an unconditional MOVE statement, the scanner will use that value when performing the compatibility check. When the scanner detects alternate names assigned via MOVEs in different branches of a conditional statement, it checks for parameter mismatches against each of the possible targets.

Results

This example shows Scan for Compatibility messages in the Remote Error List. For each compatibility error, the list shows the name of the calling program, the name of the called program, the actual and expected size of each incompatible parameter, and the location of the source file and the line number of the program call. The first message in this list, for example, reports a program call in line 190 of the source file USER146.SCAN.COBOL(TB75DRVX). The parameter passed to the called program TB7500BA has a size of 847, but TB7500BA expects a parameter with a size of 1304.
Sample list of messages returned by the Scan for Compatibility action