Rule Definition
A PERFORM statement must not cause itself to be executed into a cycle. A cyclic PERFORM statement can cause unpredictable results.
Remediation
Try to remove cyclic algorithms in the program and replace them by iterative algorithms.
Violation Code Sample
PROCEDURE DIVISION.
PROCESS.
MOVE 0 TO A.
PERFORM PROC-01.
GOBACK.
PROC-01.
ADD 1 TO A.
PERFORM PROC-02.
PROC-02.
* If condition is true then there is a recursive call
IF A < 13 THEN
PERFORM PROC-01
END-IF
Fixed Code Sample
PROCEDURE DIVISION.
PROCESS.
MOVE 0 TO A.
PERFORM PROC-01 UNTIL A = 13.
GOBACK.
PROC-01.
ADD 1 TO A.
Reference
IBM Enterprise Cobol for z/OS - Language Reference
Related Technologies
Cobol
Technical Criterion
CWE-1047 - Modules with Circular Dependencies
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.