Guardian Programmer's Guide

Table Of Contents
Communicating With Magnetic Tape
Guardian Programmer’s Guide 421922-014
12 - 28
Accessing Labeled Tapes
You will get an error if you try to write to the file before the expiration date.
However, you can still read the file after the expiration date.
A generation group for the file and a version number within the generation group.
Use the GEN attribute to identify the generation group and the VERSION attribute
to specify the version.
The generation group identifies a specific instance of a file. For example, a payroll
application might create a new instance of the payroll file each time the file is
updated. The GEN attribute allows you to identify a specific generation.
The version number allows you to identify a specific instance of a generation. For
example, suppose the payroll application stopped part way through writing out the
payroll file and had to start over. You should not create another generation
because the data belongs to the same generation as the file that was not
complete. Instead, you create a different version of the same generation.
The HP tape process does not check the generation group and version numbers
when reading a file. However, you might need to specify these values when writing
a file if the file is to be read on another vendor’s equipment and the reading
process expects the information.
An additional message to display to the operator when the DEFINE is opened.
Use the MOUNTMSG attribute.
The identity of the owner of the files on the volume. Use the OWNER attribute.
Selecting Device Mode (D-Series Only)
On D-series releases only, if you are accessing a tape on a drive controlled by a
3209/5120 controller, you can access the cartridge in either start/stop or streaming
mode. If you are using this type of drive, you should therefore use SETMODE function
119 to specify the access mode. You set the device mode after opening the tape
device but before accessing the tape.
The following example sets streaming mode.
LITERAL DEVICE^MODE = 119,
START^STOP = 0,
STREAMING = 1;
.
.
CALL SETMODE(TAPE^NUM,
DEVICE^MODE,
STREAMING);
IF <> THEN ...
A program can be designed to run for any type of tape drive/controller by using the
FILE_GETINFO_ procedure immediately after opening the tape file to determine the
subdevice type of the file. If the subdevice type is 5 (that is, the 3209 controller for a
5120 device), then you prompt the user for the mode and set the mode accordingly. If
the subdevice type is not 5, continue without setting the device type.