COBOL Manual for TNS and TNS/R Programs

Procedure Division Verbs
HP COBOL Manual for TNS and TNS/R Programs522555-006
9-40
CLOSE for Relative, Indexed, and Queue Files
°
The block is not transmitted to the file.
°
The close operation terminates immediately, setting any file-status variable
associated with the file to 34 (for a sequential file) or 24 (for a relative or
indexed file).
°
Any applicable USE procedure executes.
°
The file is not closed.
COBOL and FUP Closing Procedures Are Incompatible (Multiple-Tape File)
When the run-time routine closes a nonfinal reel of a multiple-tape file, it writes an
end-of-file mark, a trash record, and an end-of-file mark. When the File Utility
Program (FUP) closes a multiple-reel tape file, it writes only the two consecutive
end-of-file marks. Because these closing procedures differ, you must not use FUP
to copy tapes written by and for COBOL programs. Instead, write a simple COBOL
program to copy such tapes.
Process Pairs
When the run unit is executing as a process pair, the execution of a CLOSE file-
name also executes an implied statement of this form:
CHECKPOINT FILE file-name
Repositioning a Sequential File to Its Beginning
Although you can reposition a sequential file to its beginning by closing it and
reopening it, you can do it faster with the routine
COBOL85^REWIND^SEQUENTIAL or COBOL_REWIND_SEQUENTIAL_. For
information on these routines, see COBOL85^REWIND^SEQUENTIAL and
COBOL_REWIND_SEQUENTIAL_.
CLOSE for Relative, Indexed, and Queue Files
file-name
is the name of the relative,indexed, or queue file to be closed.
When more than one file-name appears, the files can have different
organization and access modes and the optional phrases following one file-
name are independent of those following any other file-name.
file-name
CLOSE
WITH LOCK
VST140.vsd