The CLOSE statement disconnects a file from a unit. It takes the following form:
{ STATUS } CLOSE ([UNIT=]u[, { DISPOSE } =p] [,ERR=s] [,IOSTAT=ios]) { DISP }
The default is 'DELETE' for scratch files. For all other files, the default is 'KEEP'.
CLOSE statement parameters can occur in any order. The UNIT keyword is optional if the unit specifier is the first parameter in the list.
The disposition specified in the CLOSE statement supersedes the disposition specified in the OPEN statement, except that a file opened as a scratch file cannot be saved. For example, the following statement closes the file on unit J and deletes it:
CLOSE (UNIT=J, STATUS='DELETE', ERR=99)
A file opened as a scratch file cannot be saved, printed, or submitted, and a file opened for read-only access cannot be deleted.