CLOSE

FUNCTION

To close files that are no longer needed.

FORMAT

CLOSE filename;

for example

CLOSE CustF;

CLOSE is only valid in batch programs. 

The file named (CustF in this example) must be defined in the program with one of these file types: -

F, FB, V, VB, U, VSAM, ESDS

It is not valid for any other definition type, including SQL.

CLOSE is used in Load-Table routines, where a table is loaded from a file in the program’s initial processing, but then the file is never needed again so it is changed to free up space and reduce system overheads.  However there is no need to close files at the end of processing, as this is done automatically for you.