Effect of CLOSE statement on file types
If the SELECT OPTIONAL clause is specified in the file-control entry for a file, and the file is not available at run time, standard end-of-file processing is not performed.
Files are divided into the following types:
- Non-reel/unit
- A file whose input or output medium is such that rewinding, reels, and units have no meaning. All files are of non-reel/unit file types.
- Sequential single volume
- A sequential file that is contained entirely on one volume. More than one file can be contained on this volume. All files are single volume.
- Sequential multivolume
- A sequential file that is contained on more than one volume. The concept of volume has no meaning.
The permissible combinations of CLOSE statement phrases are shown in the following tables:
- For sequential files: Sequential files and CLOSE statement phrases
- For indexed and relative files: Table 2
- For line-sequential files: Table 3
CLOSE statement phrases | Non-reel/ unit | Sequential single-volume | Sequential multivolume |
---|---|---|---|
CLOSE | C | C, G | A, C, G |
CLOSE WITH LOCK | C, E | C, E, G | A, C, E, G |
CLOSE statement phrases | Action |
---|---|
CLOSE | C |
CLOSE WITH LOCK | C,E |
CLOSE statement phrases | Action |
---|---|
CLOSE | C |
CLOSE WITH LOCK | C,E |
Key | Actions taken |
---|---|
A | Previous volumes
unaffected Input and input-output files: Standard volume-switch processing is performed for all previous volumes (except those controlled by a previous CLOSE REEL/UNIT statement). Any subsequent volumes are not processed. Output files: Standard volume-switch processing is performed for all previous volumes (except those controlled by a previous CLOSE REEL/UNIT statement). |
C | Close file Input and input-output files: If the file is at its end, and label records are specified, the standard ending label procedure is performed. Standard system closing procedures are then performed. If the file is at its end, and label records are not specified, label processing does not take place, but standard system closing procedures are performed. If the file is not at its end, standard system closing procedures are performed, but there is no ending label processing. Output files: If label records are specified, standard ending label procedures are performed. Standard system closing procedures are then performed. If label records are not specified, ending label procedures are not performed, but standard system closing procedures are performed. |
E | File lock: The compiler ensures that this file cannot be opened again during this execution of the object program. If the file is a tape unit, it will be rewound and unloaded. |
G | Rewind: The current volume is positioned at its physical beginning. |