Rule Definition
A subprogram can be called statically or dynamically. A static call uses a literal to specify the target whereas a dynamic call uses a variable. In the first case, the main program and the subprogram are compiled and linked into one load module. In the second case, the main program and the subprogram are compiled separately and the load module will not contain the subprogram code. They will be linked at the execution time when the main program will call the subprogram.
So for performance and memory aspects, it is better to call large subprograms dynamically in order to avoid having a large load module.
Remediation
Replace static calls by dynamic calls to large subprograms.
Violation Code Sample
IDENTIFICATION DIVISION.
PROGRAM-ID. PROG01.
*----------
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SPECIAL-NAMES.
DECIMAL-POINT IS COMMA.
*----------
DATA DIVISION.
LINKAGE SECTION.
01 PAR1 PIC X(10).
*----------
PROCEDURE DIVISION
MAIN-PARAGRAPH.
MAIN.
PERFORM P100.
PERFORM P200.
PERFORM P300.
PERFORM P400.
STOP RUN.
P100.
PERFORM P150.
* Static call to a large program
CALL "SUBPGM1" USING PAR1.
PERFORM P170.
P150.
...
Fixed Code Sample
IDENTIFICATION DIVISION.
PROGRAM-ID. PROG01.
*----------
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SPECIAL-NAMES.
DECIMAL-POINT IS COMMA.
*----------
DATA DIVISION.
WORKING-STORAGE SECTION.
01 SPGM PIC X(8) VALUE "SUBPGM1".
*----------
LINKAGE SECTION.
01 PAR1 PIC X(10).
*----------
PROCEDURE DIVISION
MAIN-PARAGRAPH.
MAIN.
PERFORM P100.
PERFORM P200.
PERFORM P300.
PERFORM P400.
STOP RUN.
P100.
PERFORM P150.
* Dynamic call to a large program
CALL SPGM USING PAR1.
CANCEL SPGM.
PERFORM P170.
P150.
...
Reference
IBM Enterprise Cobol for z/OS - Programming Guide
Related Technologies
Technical Criterion
Efficiency - Memory, Network and Disk Space Management
About CAST Appmarq
CAST Appmarq is by far the biggest repository of data about real IT systems. It's built on thousands of analyzed applications, made of 35 different technologies, by over 300 business organizations across major verticals. It provides IT Leaders with factual key analytics to let them know if their applications are on track.