COBOL Manual for TNS and TNS/R Programs
Tape Input and Output
HP COBOL Manual for TNS and TNS/R Programs—522555-006
27-6
Unlabeled Tape Files
One File on Several Tapes
To read or write one file that spans several tapes, follow Step 1 through Step 5 under
Unlabeled Tape Files and then execute these steps:
1. Close the file with the CLOSE statement, specifying REEL FOR REMOVAL (or
UNIT FOR REMOVAL). The REMOVAL phrase rewinds the tape for removal so
that you can remove it from the tape drive and replace it with the next tape.
2. Read or write the file again (see Step 5 under Unlabeled Tape Files).
3. Repeat Step 4 and Step 5 under Unlabeled Tape Files and Step 1 above for each
tape that contains part of the file.
4. Close the file with the CLOSE statement. Do not use a NO REWIND phrase. Use a
LOCK phrase if the file was not dynamically assigned and you want to prevent the
tape from being reopened (the run-time tape routine ignores LOCK for a
dynamically assigned file).
Mount Messages
When a run-time routine needs to have a reel of tape mounted, it sends a message to
the process’ home terminal.
Respond to the message sent to the home terminal after the next tape reel is mounted.
If the next reel is ready on the device named in the mount message, press Return. If
the next reel is ready on a different tape device, type that device name (beginning with
$) before you press Return.
If you do not want to continue with the next reel of tape, type “NO” in response to the
message. If the program is reading the tape, the next READ statement will discover an
end of file.
For example, suppose that a file is stored on three tapes. Its COBOL file name is
HUGEFILE. If HP COBOL end-of-tape sequences were used when the tapes were
created, HP COBOL automatically asks for each reel; otherwise, you must read and
then close each reel.
Table 27-1. Mount Messages
For an input file:
Mount the next reel of fd-name = device-name in sequence
For an output file:
Mount the next reel of fd-name = device-name, with a write ring
Message sent to the home terminal:
Type return or $volume (or 'NO' to end input)