Disassociates a file value from the physical file with which it was associated when it was opened.
CLOSE FILE(reference)[ENVIRONMENT(LEAVE|REREAD)] [,FILE(reference)[ENVIRONMENT(LEAVE|REREAD)]]…;
Abbreviation(s): ENV for ENVIRONMENT.
FILE specifies the file that is dissociated from the data set. CLOSE FILE(*) closes all open files.
CLOSE FILE(F); CLOSE FILE(G(K)); CLOSE FILE (L), FILE (M);
None.
Description
The CLOSE statement disassociates an Open PL/I file value from the physical file with which it was associated when it was opened.
Execution of a CLOSE statement closes the files identified by the references. Once closed, the files can be reopened and given different file attributes. It can also be used to designate a different operating system file or device.
Closing a closed file has no effect and is not an error.
Upon program termination (including abnormal termination), files not closed will be implicitly closed.