MAXPCF

Use the MAXPCF option to specify a maximum program complexity factor value. The program complexity factor (PCF) is computed by the compiler and the computed value is in the listing file. If the PCF of your program exceeds the maximum value, the compiler will automatically reduce the optimization level to speed up the compilation and use less storage. Therefore, when you compile a suite of programs, you do not have to specify an OPTIMIZE option value for each program.

MAXPCF option syntax

Read syntax diagramSkip visual syntax diagramMAXPCF( n)

Default is: MAXPCF(100000)

Abbreviations are: None

n must be an integer of 0 - 999999.

The aspects of the program taken into consideration when computing the complexity factor include:
  • The number of COBOL statements in the PROCEDURE DIVISION, including generated statements from the CICS, SQL or SQLIMS options, and the expansion of COPY and REPLACE statements
  • Initialization operations for WORKING-STORAGE or LOCAL-STORAGE data items with value clauses
  • Operations for variable-length groups or subgroups in the DATA DIVISION, which compute their size at run time
Note: PCF is not a metric to measure how complex a program is. It is merely a count of COBOL items that can cause problems for optimization when there are a lot of them. To measure program complexity, you should use something like the Metrics feature provided by IBM® Developer for z/OS®.

For large and complex programs, you can use the MAXPCF option to set a threshold on the program complexity that the compiler attempts optimize. Lower the MAXPCF value to reduce the optimization level, hence the compiler needs less memory and compilation time. Raise the MAXPCF value to attempt to optimize the programs at the cost of longer compilation time.

If you specify MAXPCF(0), no limit is enforced on the complexity of the program, and the MAXPCF option has no effect.

If you specify MAXPCF(n) and n is not zero, when the program complexity factor exceeds n, any specification of OPTIMIZE(1) or OPTIMIZE(2) is reset to OPTIMIZE(0), and a warning message is generated.

If the COBOL source file contains a sequence of source programs (a batch compile), the MAXPCF limit is applied on a per program basis.

Notes:
  • If the OPTIMIZE(1) or OPTIMIZE(2) option is set at installation time as a fixed, nonoverridable option, then MAXPCF(n) with a nonzero n is an option conflict. In this case, the OPTIMIZE option takes precedence and the MAXPCF(0) option is forced on.
  • If you attempt to optimize a program larger than the default threshold by raising the value of MAXPCF to n where n is greater than the default, or by specifying MAXPCF(0), the compiler might take excessive time to compile or fail to compile because of insufficient memory.

Related references  
OPTIMIZE