Guardian Programmer's Guide

Table Of Contents
Communicating With Magnetic Tape
Guardian Programmer’s Guide 421922-014
12 - 29
Writing to the Only File on a Labeled Tape Volume
Setting Buffered Mode
We recommend using buffered mode to increase throughput. However, to use
buffered mode, the application must be able to recover from errors in any buffering
mode it uses. See Recovering From Errors, later in this section, for details.
In the case of a write operation, the application is allowed to continue as soon as the
tape process has received the write request. Without buffered mode, the application
has to wait for each write to tape to finish before continuing. When reading in buffered
mode, the tape process reads ahead in anticipation of sequential reads.
You turn on buffered mode using SETMODE function 99 after the tape device is open:
LITERAL BUFFERED^MODE = 99,
ON = 1,
OFF = 0;
.
.
CALL SETMODE(TAPE^NUM,
BUFFERED^MODE,
ON);
IF <> THEN ...
Buffered mode gets turned off when the application closes the tape process or when
the application explicitly turns off buffered mode:
CALL SETMODE(TAPE^NUM,
BUFFERED^MODE,
OFF);
IF <> THEN ...
For complete details on buffered-mode operation, refer to Working in Buffered Mode,
earlier in this section.
Writing to the Only File on a Labeled Tape Volume
To write to the only file on a labeled tape volume, you need to do the following:
Create a DEFINE for opening the file for writing
Open the DEFINE and write to it
You create the DEFINE only once, then use it whenever you write to the file. The
following paragraphs describe how to create the DEFINE and how to write to the tape
using the DEFINE.
Creating the DEFINE
Create the DEFINE as follows:
1. Turn on DEFINEs by calling the DEFINEMODE procedure.