If the SELECT OPTIONAL clause is specified in the FILE-CONTROL entry for a file, and the file is not present at run time, standard end-of-file processing is not performed. For QSAM files, the file position indicator and current volume pointer are unchanged.
Files are divided into the following types:
Table 37. Sequential Files and CLOSE Statement Phrases | |||
CLOSE Statement Phrases |
Non-Reel/ Unit |
Sequential Single-Volume |
Sequential Multi-Volume |
---|---|---|---|
CLOSE | C | C, G | A, C, G |
CLOSE REEL/UNIT | F | F, G | F, G |
X CLOSE REEL/UNIT WITH X NO REWIND |
X F X |
X B, F X |
X B, F X |
CLOSE REEL/UNIT FOR REMOVAL | D | D | D |
CLOSE WITH NO REWIND | C, H | B, C | A, B, C |
CLOSE WITH LOCK | C, E | C, E, G | A, C, E, G |
Table 38. Indexed and Relative File Types and CLOSE Statement Phrases | |
CLOSE Statement Phrases | Action |
---|---|
CLOSE | C |
CLOSE WITH LOCK | C,E |
X Table 39. Line Sequential File Types and CLOSE Statement Phrases | |
X CLOSE Statement Phrases | X Action |
---|---|
X CLOSE | X C |
X CLOSE WITH LOCK | X C,E |
Table 40. Meanings of Key Letters for Sequential File Types | |
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). |
B |
No Rewinding of Current Reel--the current volume is left in its current position. |
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. |
D | Volume Removal--Treated as a comment. |
E |
File Lock--The compiler ensures that this file cannot be opened again during this execution of the object program. |
F |
Close Volume Input and Input-Output Files--If the current reel/unit is the last and/or only reel/unit for the file or if the reel is on a non-reel/unit medium, no volume switching is performed. If another reel/unit exists for the file, the following operations are performed: a volume switch, beginning volume label procedure, and the first record on the new volume is made available for reading. If no data records exist for the current volume, another volume switch occurs. Output (Reel/Unit Media) Files--The following operations are performed: the ending volume label procedure, a volume switch, and the beginning volume label procedure. The next executed WRITE statement places the next logical record on the next direct access volume available. A close statement with the REEL phrase does not close the output file; only an end-of-volume condition occurs. Output (Non-Reel/Unit Media) Files--Execution of the CLOSE statement is considered successful. The file remains in the open mode and no action takes place except that the value of the I-O status associated with the file is updated. |
G | Rewind--The current volume is positioned at its physical beginning. |
H |
Optional Phrases Ignored--The CLOSE statement is executed as if none of the optional phrases were present. |
Adobe, the Adobe logo, Acrobat, the Acrobat logo, and Acrobat Reader are registered trademarks of Adobe Systems incorporated.