Rule Definition
The DISPLAY statement used with the UPON CONSOLE addition sends information to the console and then, it requires operator responses.
Remediation
Only use the DISPLAY statement for debug purpose and do not send information to the console. In the indicator area, use the 'D' character to specify that the statement is for debug version of the program. The DISPLAY statement should only be used to designate the start of the batch program, or the result of the execution of the batch program.
Violation Code Sample
PROCEDURE DIVISION.
MAIN.
DISPLAY "BEG. PGM" UPON CONSOLE.
MOVE 0 TO COUNTER.
PERFORM BODY UNTIL COUNTER = 10.
DISPLAY "END PGM" UPON CONSOLE.
STOP RUN.
BODY.
ADD 1 TO COUNTER.
DISPLAY COUNTER UPON CONSOLE.
...
Fixed Code Sample
PROCEDURE DIVISION.
MAIN.
D DISPLAY "BEG. PGM.".
MOVE 0 TO COUNTER.
PERFORM BODY UNTIL COUNTER = 10.
D DISPLAY "END PGM : COUNTER = " COUNTER.
STOP RUN.
BODY.
ADD 1 TO COUNTER.
...
Related Technologies
Cobol
Technical Criterion
Programming Practices - Error and Exception Handling
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.