Using Program Switches - Compaq COBOL AAQ2G1FTK User Manual

Compaq computer accessories user manual
Table of Contents

Advertisement

Example 1–6 (Cont.) Using RMS-CURRENT Special Registers to Detect Errors
DATA DIVISION.
FILE SECTION.
FD
01
FD
01
FD
01
PROCEDURE DIVISION.
DECLARATIVES.
USE-SECT SECTION.
CHECK-RMS-CURRENT-REGISTERS.
END DECLARATIVES.
MAIN-PROG SECTION.
MAIN-PARA.
END-PROGRAM RMS-CURRENT-SPEC-REGISTERS.

1.5 Using Program Switches

You can control program execution by defining switches in your Compaq
COBOL program and setting them internally (from within the image) or
externally (from outside the image). Switches exist as the environment variable
COBOL_SWITCHES (on the Tru64 UNIX operating system) or the logical name
COB$SWITCHES (on the OpenVMS Alpha operating system).
On OpenVMS Alpha systems, switches can be defined for the image, process,
group, or system.
On Tru64 UNIX systems, switches can be defined for the image or process.
(OpenVMS)
FILE-1.
FILE-1-REC.
02
F1-REC-FIELD
FILE-2.
FILE-2-REC.
02
F2-REC-FIELD
FILE-3.
FILE-3-REC.
02
F3-REC-FIELD
USE AFTER STANDARD EXCEPTION PROCEDURE ON INPUT.
DISPLAY "************** ERROR **************".
DISPLAY "Error on file: " RMS-CURRENT-FILENAME.
DISPLAY "Status Values:".
DISPLAY "
RMS-STS = " RMS-CURRENT-STS WITH CONVERSION.
DISPLAY "
RMS-STV = " RMS-CURRENT-STV WITH CONVERSION.
DISPLAY "***********************************".
OPEN INPUT FILE-1.
OPEN INPUT FILE-2.
OPEN INPUT FILE-3.
.
.
.
CLOSE FILE-1.
CLOSE FILE-2.
CLOSE FILE-3.
STOP RUN.
Developing Compaq COBOL Programs
1.4 Program Run Messages
PIC 9(9).
PIC 9(9).
PIC 9(9).
Developing Compaq COBOL Programs 1–59

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?

Questions and answers

Table of Contents