Developing Compaq COBOL Programs
1.4 Program Run Messages
Example 1–6 (Cont.) Using RMS-CURRENT Special Registers to Detect Errors
(OpenVMS)
DATA DIVISION.
FILE SECTION.
FD
FILE-1.
01
FILE-1-REC.
02
F1-REC-FIELD
PIC 9(9).
FD
FILE-2.
01
FILE-2-REC.
02
F2-REC-FIELD
PIC 9(9).
FD
FILE-3.
01
FILE-3-REC.
02
F3-REC-FIELD
PIC 9(9).
PROCEDURE DIVISION.
DECLARATIVES.
USE-SECT SECTION.
USE AFTER STANDARD EXCEPTION PROCEDURE ON INPUT.
CHECK-RMS-CURRENT-REGISTERS.
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 "***********************************".
END DECLARATIVES.
MAIN-PROG SECTION.
MAIN-PARA.
OPEN INPUT FILE-1.
OPEN INPUT FILE-2.
OPEN INPUT FILE-3.
.
.
.
CLOSE FILE-1.
CLOSE FILE-2.
CLOSE FILE-3.
STOP RUN.
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.
♦
Developing Compaq COBOL Programs 1–59
Содержание COBOL AAQ2G1FTK
Страница 22: ......
Страница 30: ......
Страница 94: ......
Страница 110: ......
Страница 146: ......
Страница 180: ......
Страница 194: ...Processing Files and Records 6 1 Defi...
Страница 300: ......
Страница 490: ......
Страница 516: ......
Страница 517: ......
Страница 530: ......
Страница 534: ......
Страница 590: ......
Страница 620: ......