Guardian Programmer's Guide

Table Of Contents
Communicating With Magnetic Tape
Guardian Programmer’s Guide 421922-014
12 - 45
Reading From a File on a Multiple-File Labeled
Tape Volume
CALL READX(TAPE^NUM,SBUFFER,
RCOUNT,COUNT^READ);
!Deblock the input buffer into four records:
LOGICAL^BUFFER^1[0] ':=' SBUFFER[0] FOR 512;
LOGICAL^BUFFER^2[0] ':=' SBUFFER[512] FOR 512;
LOGICAL^BUFFER^3[0] ':=' SBUFFER[1024] FOR 512;
LOGICAL^BUFFER^4[0] ':=' SBUFFER[1536] FOR 512;
.
.
Reading From a File on a Multiple-File Labeled Tape Volume
If the labeled tape contains multiple files, the procedure for reading records from the
file is similar to that for reading from the only file on a labeled tape volume; you need to
create a DEFINE and then use the DEFINE for reading from the file. The difference is
that the FILESEQ attribute specified in the DEFINE must identify the correct file.
Again, it is not necessary to specify the tape density when reading. The tape controller
can calculate the density by reading the tape.
The following paragraphs show how to create a DEFINE for this type of access and
then use the DEFINE to read records from a file that resides on a labeled tape
containing other files.
Creating the DEFINE
Create the DEFINE as follows:
1. Turn on DEFINEs by calling the DEFINEMODE procedure.
2. Create a working set for the DEFINE using successive calls to the
DEFINESETATTR procedure. The working set should include the following:
The class of DEFINE (CLASS attribute). Set this value to “TAPE.”
The type of labels used (LABELS attribute). Set this value to “ANSI” or “IBM.”
The volume identifier (VOLUME attribute). Set this value to the value written to
the tape in the volume label.
The file identifier (FILEID attribute). The file identifier must be the same as the
file identifier in the file label.
The file sequence number (FILESEQ attribute). This value must be set to the
sequence number of the file on the tape. For example, if the DEFINE will
describe the seventh file on the tape, then this attribute must be set to 7.
The I/O operation (USE attribute). This value must be set to “IN” to read
records from the file.
The conversion mode (EBCDIC attribute). Set this value to “IN” to convert
EBCDIC code to ASCII on input. Use this option only if the tape uses IBM
standard labels.