Defining A Magnetic Tape File (Tru64 Unix) - Compaq COBOL AAQ2G1FTK User Manual

Compaq computer accessories user manual
Table of Contents

Advertisement

Processing Files and Records
6.2 Identifying Files and Records from Within Your Compaq COBOL Program
Example 6–9 Defining a Magnetic Tape File (OpenVMS)
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT MYFILE-PRO
DATA DIVISION.
FILE SECTION.
FD MYFILE-PRO.
01 DAT-RECORD PIC X(100).
PROCEDURE DIVISION.
A000-BEGIN.
OPEN INPUT MYFILE-PRO.
READ MYFILE-PRO AT END DISPLAY "end".
CLOSE MYFILE-PRO.
Example 6–10 achieves the same result as Example 6–9, but on Tru64 UNIX. The
I/O statements in Example 6–10 refer to MYFILE-PRO, which the ASSIGN clause
identifies to the operating system as a magnetic tape file. The file is named in the
Data Division VALUE OF ID clause as MARCH.311.
Example 6–10 Defining a Magnetic Tape File (Tru64 UNIX)
ENVIRONMENT DIVISION
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT MYFILE-PRO
DATA DIVISION.
FILE SECTION.
FD MYFILE-PRO VALUE OF ID "MARCH.311".
01 DAT-RECORD PIC X(100).
PROCEDURE DIVISION.
6–16 Processing Files and Records
ASSIGN TO "MTA0:MARCH.311"
.
.
.
.
.
.
.
.
.
.
.
.
ASSIGN TO REEL.
.
.
.
.
.
.
(continued on next page)

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the COBOL AAQ2G1FTK and is the answer not in the manual?

Subscribe to Our Youtube Channel

Table of Contents