Compaq COBOL AAQ2G1FTK User Manual

Page 477

Advertising
background image

Using Compaq COBOL in the Alpha Common Language Environment

13.4 Calling Routines

13.4.5.1 Library Return Status and Condition Value Symbols (OpenVMS)

Library return status and condition value symbols have the following general
form:

fac$_abcmnoxyz

where:

fac

is a 2- or 3-letter facility symbol (LIB, MTH, STR, OTS, BAS, COB, FOR, SS).

abc

are the first 3 letters of the first word of the associated message.

mno

are the first 3 letters of the next word.

xyz

are the first 3 letters of the third word, if any.

Articles and prepositions are not considered significant words in this format. If
a significant word is only two letters long, an underscore character is used to
fill out the third space. The OpenVMS Alpha normal or success code is used to
indicate successful completion. Some examples of this code are as follows:

RETURN Status

Meaning

LIB$_INSVIRMEM

Insufficient virtual memory

FOR$_NO_SUCDEV

No such device

MTH$_FLOOVEMAT

Floating overflow in Math Library procedure

BAS$_SUBOUTRAN

Subscript out of range

13.4.6 Locating the Result (OpenVMS)

Once you have defined the arguments, called the procedure, and checked the
condition value, you are ready to locate the result. To find out where the result is
returned, look at the description of the system routine you are calling.

For example, in the following call to MTH$ACOS the result is written into the
variable COS:

01 ARG-CODE PIC S9(9) COMP VALUE 1.
01 COS

COMP1 VALUE 0.

.
.
.

CALL "MTH$ACOS" USING BY REFERENCE ARG-CODE GIVING COS.

This result is described in the OpenVMS Alpha documentation on system services
and Run-Time Library routines, under the description of the system routine.

13.5 Establishing and Removing User Condition Handlers

(OpenVMS)

To establish a user condition handler, call the LIB$ESTABLISH routine.

The form of the call is as follows:

CALL LIB$ESTABLISH USING BY VALUE new-handler GIVING old-handler

Using Compaq COBOL in the Alpha Common Language Environment 13–15

Advertising