RNF7534

Files should be closed explicitly in a non-cycle module.

10

Cause . . . . . : The RPG Program Cycle is not in effect when a MAIN or NOMAIN keyword is specified on the Control specification, so files do not get closed automatically. CLOSE operations are recommended for all files that may be opened during module initialization, or by procedures in the module.

Recovery . . . : One solution is to create a procedure to be called at the end of the application that contains a CLOSE *ALL operation. Another solution is to close files in the same procedure that opens them.