COBOL Manual for TNS and TNS/R Programs
Tape Input and Output
HP COBOL Manual for TNS and TNS/R Programs—522555-006
27-10
Labeled Tape Files
Describing Labeled Tape Files in a HP COBOL Program
In the file-control entry for a labeled tape file, assign the COBOL file name of the
labeled tape file to a DEFINE name (for the syntax of a DEFINE name, see DEFINE
Names).
In the file description entry for a labeled tape file, include a RECORD CONTAINS
clause to specify whether the file’s records are of fixed or variable length and to define
their size.
Example 27-4 assigns the COBOL file name SEQ-FILE to the DEFINE name
=PROG1D1 (giving it sequential organization and access mode as required for a tape
file) and then describes SEQ-FILE as having fixed-length records of 30 characters
each.
Consistency Checking of Labeled Tape Information
HP COBOL run-time routines check that the HP COBOL program specifications are
consistent with these DEFINE attributes:
•
LABELS
•
RECFORM
•
BLOCKLEN
•
RECLEN
•
FILESEQ
•
USE
If a program specification is inconsistent with an attribute, an HP COBOL run-time
routine takes one of these actions, depending on the attribute:
•
Allows the DEFINE attribute to override the program specifications
•
Issues an open error because of inconsistency
Example 27-4. Labeled Tape File
ENVIRONMENT DIVISION.
...
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT SEQ-FILE ASSIGN TO "=PROG1D1"
ORGANIZATION SEQUENTIAL
ACCESS MODE SEQUENTIAL.
...
DATA DIVISION.
FILE SECTION.
FD SEQ-FILE
RECORD CONTAINS 30 CHARACTERS
01 SEQ-RECORD PIC X(30).
...