CRITICAL
Rule Definition
Each file used by a program must be properly opened and closed. If the file is not closed explicitly, then data can be lost.
Remediation
For each programs using files, check if files are closed. If not, then add a CLOSE statement at the end of the program
Violation Code Sample
DCL TEST1FILE FILE RECORD OUTPUT;
...
WRITE FILE(TEST1FILE) FROM (MYSTRUCT);
...
/*violation NO OPEN. NO CLOSE */
Fixed Code Sample
OPEN FILE (TEST1FILE);
..
WRITE FILE(TEST1FILE) FROM(MYSTRUCT);
CLOSE FILE (TEST1FILE);
Related Technologies
Technical Criterion
Efficiency - Memory, Network and Disk Space Management
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.