Guardian Programmer's Guide

Table Of Contents
Communicating With Magnetic Tape
Guardian Programmer’s Guide 421922-014
12 - 38
Writing to a File on Multiple Labeled Tape Volumes
.
.
Writing to a File on Multiple Labeled Tape Volumes
The procedure for writing to a file that resides on multiple labeled tapes is similar to the
procedure for writing to a file on a single tape reel. Again you use a DEFINE to
describe the file and the type of operation you intend to perform. Then you open and
write to the DEFINE.
The following paragraphs show the complete procedure for writing records to a file on
multiple reels of 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). This value should specify a list of
volume names starting with the first volume where the file resides.
The file identifier (FILEID attribute). If the file already exists, the file identifier
must be the same as the file identifier in the file label. If the file does not yet
exist, the file identifier can be any valid file identifier.
The file sequence number (FILESEQ attribute). This value must be set to 1 (or
not specified, as the default is 1).
The I/O operation (USE attribute). This value must be set to “EXTEND” to
append records to the file or “OUT” to write to a new file section.
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). Specify fixed-length or variable-length
records, as appropriate.
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