Guardian Programmer's Guide

Table Of Contents
Communicating With Magnetic Tape
Guardian Programmer’s Guide 421922-014
12 - 48
Reading From a File on Multiple Labeled Tape
Volumes
TAPE^NUM);
IF ERROR <> 0 THEN ...
!Set buffered mode:
CALL SETMODE(TAPE^NUM,
BUFFERED^MODE,
ON);
IF <> THEN ...
.
.
!Position the tape to the desired record block:
PHYSICAL^RECORD^ADVANCE := 36;
CALL CONTROL(TAPE^NUM,
SPACE^FORWARD,
PHYSICAL^RECORD^ADVANCE);
!Read a record block from the tape file into the input
!buffer:
RCOUNT := 2048;
CALL READ(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 Multiple Labeled Tape Volumes
The procedure for reading from a file that resides on multiple labeled tapes is similar to
the procedure for reading from a file on a single tape reel. Again you describe the file
and the type of operation you intend to perform in a DEFINE, open the DEFINE, and
read from the file associated with the returned file number.
The following paragraphs show how to create a DEFINE for this type of tape access,
then how to use the DEFINE for reading record blocks from a file on multiple reels of
labeled tape.
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.”