Accessing Files Programmer's Guide (32650-90885)

Chapter 7 117
Record Selection and Data Transfer
Magnetic Tape Considerations
FCONTROL (FORWARD SPACE TO FILE MARK). A user program that spaces
forward to logical tape marks (EOFs) with the FCONTROL intrinsic cannot detect passing
the physical EOT marker. No special condition code is returned.
FCONTROL (BACKWARD SPACE TO FILE MARK). The EOT reflective marker is not
detected by FCONTROL during backspace file (EOF) operations. If the intrinsic discovers a
BOT marker before it finds a logical EOF, it returns a condition code of CCE and treats the
BOT as if it were a logical EOF. Subsequent backspace file operations requested when the
file is at BOT are treated as errors and return a CCL condition code and set a file system
error to indicate INVALID OPERATION.
In summary, except for FCONTROL, only those intrinsics that cause the magnetic tape to
write information are capable of sensing the physical EOT marker. If a program designed
to read a magnetic tape needed to detect the EOT marker, it could be done by using the
FCONTROL intrinsic to read the physical status of the tape drive itself. When the drive
passes the EOT marker and is moving in the forward direction, tape status bit 5 (%2000) is
set and remains on until the drive detects the EOT marker during a rewind or backspace
operation. Under normal circumstances, however, it is not necessary to check for EOT
during read operations. The responsibility for detecting end-of-tape and concluding tape
operations in an orderly manner belongs to the program that originally created (wrote) the
tape.
A program that needed to create a multiple reel tape file would normally write tape
records until the status returned from FWRITE indicated an EOT condition. Writing could
be continued in a limited manner to reach a logical point at which to break the file. Then
several file marks and a trailing tape label would typically be added, the tape rewound,
another reel mounted, and the data transfer continued. The program designed to read
such a multitape file must expect to find and check for the EOF and label sequence written
by the tape's creator. Since the logical end of the tape may be somewhat past the physical
EOT marker, the format and conventions used to create the tape are of more importance
than determining the location of the EOT.