Guardian Programmer's Guide

Table Of Contents
Communicating With Magnetic Tape
Guardian Programmer’s Guide 421922-014
12 - 22
Accessing Labeled Tapes
Accessing Labeled Tapes
You gain access to a labeled tape by passing a tape DEFINE name to the
FILE_OPEN_ procedure. $ZSVR responds to the FILE_OPEN_ call by sending a
message to the operator to mount the tape on any tape drive. (Recall that when
handling labeled tapes, it is not necessary to identify the device.)
ERROR := FILE_OPEN_(=TAPE^FILE^1,
TAPE^NUM);
IF ERROR <> 0 THEN ...
When handling labeled tapes, you use a different DEFINE for each file that exists on a
labeled tape. =TAPE^FILE^1 identifies one such file.
You create the DEFINE either interactively at the TACL prompt (see the Guardian
User’s Guide) or programmatically using procedure calls. Complete details on how to
programmatically create DEFINEs are given in Section 7, Using DEFINEs.
You set DEFINE attributes for opening the tape file depending on several factors, such
as whether you are creating a new file or reading or updating an existing file; how
many tape volumes the file takes; or how many files are stored on the one tape
volume.
Recall from Section 7, Using DEFINEs:
Before working with DEFINEs, you must enable DEFINEs by issuing a
DEFINEMODE procedure call:
NEW^VALUE := 1;
CALL DEFINEMODE(NEW^VALUE,
OLD^VALUE);
Once you have specified the DEFINE attributes in the working set, you create the
DEFINE using the DEFINEADD procedure:
DEFINE^NAME ':=' "=NAME^OF^DEFINE ";
CALL DEFINEADD(DEFINE^NAME);
The following paragraphs describe the DEFINE attributes most commonly found in
tape DEFINEs.
In addition, the following paragraphs include instructions for setting magnetic tape
parameters that cannot be set using DEFINEs. These include setting buffered mode
and choosing the device mode. These parameters are set using the SETMODE
procedure after the tape file is open.