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
----


== See

* http://cwe.mitre.org/data/definitions/459.html[MITRE, CWE-459] - Incomplete Cleanup


ifdef::env-github,rspecator-view[]
'''
== Comments And Links
(visible only on this page)

include::comments-and-links.adoc[]
endif::env-github,rspecator-view[]
