== Why is this an issue?

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

[source,cobol]
----
OPEN INPUT my-file
----


=== Compliant solution

[source,cobol]
----
OPEN INPUT my-file
...
CLOSE my-file
----


== Resources

* CWE - https://cwe.mitre.org/data/definitions/459[CWE-459 - Incomplete Cleanup]


ifdef::env-github,rspecator-view[]

'''
== Implementation Specification
(visible only on this page)

=== Message

File "XXXX" is opened, but never explicitely closed


'''
== Comments And Links
(visible only on this page)

=== is related to: S1630

endif::env-github,rspecator-view[]
