Guardian Programmer's Guide

Table Of Contents
Communicating With Magnetic Tape
Guardian Programmer’s Guide 421922-014
12 - 73
Accessing Unlabeled Tapes
The following example also sets the tape density to 1600 bits per inch:
LITERAL TAPE^DENSITY = 66;
.
.
DENSITY := 1;
CALL SETMODE(TAPE^NUM,
TAPE^DENSITY,
DENSITY);
IF <> THEN ...
Here, the tape drive must already be open. The selected density becomes effective
immediately.
Selecting the 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 device mode. You set the device mode after opening the tape
device but before accessing the tape.
The following example sets the device mode to 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 mode.
Selecting the Conversion Mode
When reading information from an unlabeled tape written by another vendors
equipment or writing to an unlabeled tape that will be read by another vendor’s
equipment, you must consider whether the tape contains EBCDIC or ASCII code.
For an EBCDIC tape, you need to convert the data on input to ASCII. You can use a
FUP command to copy the data from tape to disk or another tape and convert the code
to ASCII at the same time. The following example copies an EBCDIC tape from device
$TAPE2 to $TAPE1:
FUP COPY $TAPE2,$TAPE1,EBCDICIN