Guardian Programmer's Guide

Table Of Contents
Communicating With Magnetic Tape
Guardian Programmer’s Guide 421922-014
12 - 34
Writing to a File on a Multiple-File
Labeled Tape Volume
create a DEFINE and then use the DEFINE for writing to the file. The difference is that
the FILESEQ attribute specified in the DEFINE must identify the correct file.
The following paragraphs show how to create a DEFINE for, and write records to, a file
on a multiple-file labeled tape.
Creating the DEFINE
Create the DEFINE as follows:
1. Turn on DEFINEs by calling the DEFINEMODE procedure.
2. Create a working set for the DEFINE using successive calls to the
DEFINESETATTR procedure. The working set should include the following:
The class of DEFINE (CLASS attribute). Set this value to “TAPE.”
The type of labels used (LABELS attribute). Set this value to “ANSI” or “IBM.”
The volume identifier (VOLUME attribute). Set this value to the value written to
the tape in the volume label.
The file identifier (FILEID attribute). If the file already exists, the file identifier
must be the same as the one in the file label. If the file does not yet exist, you
can specify any valid file identifier.
The file sequence number (FILESEQ attribute). This value must be set to the
sequence number of the file on the tape. For example, if the DEFINE will
describe the seventh file on the tape, then the FILESEQ attribute must be set
to 7.
The I/O operation (USE attribute). This value must be set to “EXTEND” to
append records to the file or “OUT” to write records in a new file.
The conversion mode (EBCDIC attribute). Set this value to “OUT” to convert
ASCII code to EBCDIC on output. Use this option only if the tape uses IBM
standard labels.
The record type (RECFORM attribute). This value specifies fixed-length or
variable-length records.
The record length (RECLEN attribute). If you are appending to an existing file,
this value must be equal to the value written to the file label when the tape file
was created.
The record-block length (BLOCKLEN attribute). Set this value to either a
multiple of the fixed record length or the maximum variable record length. If
you are creating a new file, this value is placed in the tape label. If you are
appending to a file, this value must also equal the corresponding value in the
file label on the tape.
The tape density (DENSITY attribute). This value must be the same as the
density of existing data on the tape to ensure that the new data gets written at