Guardian Programmer's Guide

Table Of Contents
Communicating With Magnetic Tape
Guardian Programmer’s Guide 421922-014
12 - 49
Reading From a File on Multiple Labeled Tape
Volumes
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). The file identifier must be the same as the
file identifier in the file label.
The file sequence number (FILESEQ attribute). This value must be set to 1.
The I/O operation (USE attribute). This value must be set to “IN” to read
records from the file.
The conversion mode (EBCDIC attribute). Set this value to “IN” to convert
EBCDIC code to ASCII on input. Use this option only if the tape uses IBM
standard labels.
3. Create the DEFINE using the DEFINEADD procedure.
The following example creates a DEFINE called =THIRD^TAPE^READ. It describes
the third section of the file: that part contained on the third tape reel. This tape uses
standard ANSI labels.
!Turn on DEFINE mode:
NEW^VALUE := 1;
ERROR := DEFINEMODE(NEW^VALUE,
OLD^VALUE);
IF ERROR > 0 THEN ...
!Set the CLASS attribute to TAPE:
ATTRIBUTE^NAME ':=' "CLASS ";
ATTRIBUTE^VALUE ':=' "TAPE" -> @S^PTR;
ERROR := DEFINESETATTR(ATTRIBUTE^NAME,
ATTRIBUTE^VALUE,
@S^PTR '-' @ATTRIBUTE^VALUE,
DEFAULT^NAMES);
IF ERROR <> 0 THEN ...
!Set the LABELS attribute to ANSI:
ATTRIBUTE^NAME ':=' "LABELS ";
ATTRIBUTE^VALUE ':=' "ANSI" -> @S^PTR;
ERROR := DEFINESETATTR(ATTRIBUTE^NAME,
ATTRIBUTE^VALUE,
@S^PTR '-' @ATTRIBUTE^VALUE,
DEFAULT^NAMES);
IF ERROR <> 0 THEN ...
!Set the VOLUME attribute to THIRD:
ATTRIBUTE^NAME ':=' "VOLUME ";
ATTRIBUTE^VALUE ':=' "THIRD" -> @S^PTR;
ERROR := DEFINESETATTR(ATTRIBUTE^NAME,
ATTRIBUTE^VALUE,
@S^PTR '-' @ATTRIBUTE^VALUE,