Guardian Programmer's Guide

Table Of Contents
Communicating With Magnetic Tape
Guardian Programmer’s Guide 421922-014
12 - 72
Accessing Unlabeled Tapes
Blocking Tape I/O
There is no support for blocking records that are written to an unlabeled tape. If you
choose to do blocking, then your program must pack multiple records into one record
block before the record gets written to tape. Similarly, on reading records from the
tape, the program must do its own deblocking of record blocks back into records.
Blocking records in this way has the following advantages:
It speeds up tape I/O because fewer write and read operations are required.
It uses less tape because there are fewer records and thus fewer interrecord gaps.
Refer to Blocking Tape Records earlier in this section for details.
Specifying Tape Density
When writing to tape, you can specify the density with which you want to write to tape.
If you do not set the density, then the system will use the configured default density for
the drive. On reading from tape, it is not necessary to specify the density, because the
tape controller can calculate the tape density.
If you open the tape using a DEFINE, you can use the same DEFINE to select the tape
density by setting the DENSITY attribute. The following code fragment sets the density
to 1600 bits per inch:
!Set the DENSITY attribute to 1600 bpi:
ATTRIBUTE^NAME ':=' "DENSITY ";
ATTRIBUTE^VALUE ':=' "1600" -> @S^PTR;
ERROR := DEFINESETATTR(ATTRIBUTE^NAME,
ATTRIBUTE^VALUE,
@S^PTR '-' @ATTRIBUTE^VALUE,
DEFAULT^NAMES);
IF ERROR <> 0 THEN ...
The tape density gets set when the tape device is opened using the DEFINE that
contains this attribute.
Alternatively, you can set the density using SETMODE function 66. parameter-1 of
the SETMODE procedure designates the density, as shown in Table 12-3.
Table 12-3. SETMODE 66 parameter-1 Settings for Tape Density
SETMODE
parameter
-1 Tape Density
1 1600 bpi (PE)
2 6250 bpi (GCR)
3 As indicated by switches on the tape drive (D-series releases only)