COBOL Manual for TNS/E Programs (H06.08+, J06.03+)
Figure 36 Software Involved in Labeled-Tape Processing
To use a labeled tape file with an HP COBOL program, you must:
1. Describe the labeled tape file in a file-control entry in the HP COBOL program, assigning the
file’s COBOL file name to a DEFINE name.
2. Enable the creation of DEFINEs with the TACL command SET DEFMODE ON.
3. Add a DEFINE that has the name assigned to the file in Step 1 and the appropriate attributes
(see Adding DEFINEs for Tape Files).
4. Execute the program (see Executing HP COBOL Programs That Use Tape Files).
Describing Labeled Tape Files in an 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 (page 821)).
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 266 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.
Example 266 Labeled Tape File
ENVIRONMENT DIVISION.
...
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT SEQ-FILE ASSIGN TO "=PROG1D1"
ORGANIZATION SEQUENTIAL
Reading and Writing Tape Files 843










