Compaq COBOL AAQ2G1FTK User Manual

Page 246

Advertising
background image

Handling Input/Output Exception Conditions
7.3 Using File Status Values and OpenVMS RMS Completion Codes

These special registers supplement the file status values already available and
allow the Compaq COBOL program to directly access RMS completion codes.
For more information on RMS completion codes, refer to the Compaq COBOL
Reference Manual
and the OpenVMS Record Management Services Reference
Manual
.

You do not define these special registers in your program. As special registers,
they are available whenever and wherever you need to use them in the Procedure
Division. RMS-CURRENT-STS contains the RMS completion codes for the most
recent file or record operation for any file. RMS-CURRENT-FILENAME contains
the name of the current file by which it is known to the system, which can be
the full file specification (directory, device, file name, and extension). RMS-
CURRENT-STV contains other relevant information (see the OpenVMS System
Messages and Recovery Procedures Reference Manual
, an archived manual that
is available on the OpenVMS Documentation CD-ROM.). When you access these
three special registers, you must not qualify your reference to them. However,
if you define more than one file in the program and intend to access RMS-STS,
RMS-STV, and RMS-FILENAME, you must qualify your references to them by
using the internal COBOL program’s file name for the file that you intend to
reference.

Notice the use of the WITH CONVERSION phrase of the DISPLAY statement in
Example 7–5. This converts the PIC S9(9) COMP contents of the RMS Special
Registers from binary to decimal digits for terminal display.

Example 7–5 Referencing RMS-STS, RMS-STV, RMS-CURRENT-STS, and

RMS-CURRENT-STV Codes (OpenVMS)

.
.
.

DATA DIVISION.
FILE SECTION.
FD

FILE-1.

01

RECORD-1

PIC X(50).

FD

FILE-2.

01

RECORD-2

PIC X(50).

WORKING-STORAGE SECTION.
01

ANSWER

PIC X.

01

STS

PIC S9(9)

COMP.

01

STV

PIC S9(9)

COMP.

(continued on next page)

7–6 Handling Input/Output Exception Conditions

Advertising