Even though closing an open file isn’t always mandatory (for instance when stopping the execution of a COBOL program with the STOP RUN
statement), it’s good coding practice to always explicitly close any open files. This rule checks that for every OPEN
statement there is
a corresponding CLOSE
statement somewhere in the program.
Noncompliant code example
OPEN INPUT my-file
Compliant solution
OPEN INPUT my-file
...
CLOSE my-file