4 calling system routines (openvms) – Compaq COBOL AAQ2G1FTK User Manual

Page 470

Advertising
background image

Using Compaq COBOL in the Alpha Common Language Environment
13.4 Calling Routines

Remember, you must specify the name of the routine being called and all
parameters required for that routine. Make sure the data types and passing
mechanisms for the parameters you are passing coincide with those defined in
the routine.

13.4.4 Calling System Routines (OpenVMS)

The basic steps for calling system routines are the same as those for calling
any routine. However, when calling system routines, you need to provide some
additional information discussed in the following sections.

13.4.4.1 System Routine Arguments (OpenVMS)

All OpenVMS Alpha system routine arguments are described in terms of the
following information:

OpenVMS Alpha usage

Data type

Type of access allowed

Passing mechanism

OpenVMS Alpha usages are data structures layered on the standard OpenVMS
Alpha data types. For example, the OpenVMS Alpha usage mask_longword
signifies an unsigned longword integer used as a bit mask, and the OpenVMS
Alpha usage floating_point represents any OpenVMS Alpha floating-point data
type. Table 13–4 lists the OpenVMS Alpha usages and the COBOL statements
you need to implement them.

Table 13–4 COBOL Implementation of the OpenVMS Alpha Data Types (OpenVMS)

OpenVMS Alpha Data
Type

COBOL Definition

access_bit_names

NA . . . PIC X(128).

1

access_mode

NA . . . PIC X.

1

access_mode is usually passed BY VALUE
as PIC 9(9) COMP.

address

USAGE POINTER.

address_range

01 ADDRESS-RANGE.

02 BEGINNING-ADDRESS USAGE POINTER.
02 ENDING-ADDRESS USAGE POINTER.

arg_list

NA . . . Constructed by the compiler as a result of using the COBOL CALL
statement. An argument list may be created as follows, but may not be
referenced by the COBOL CALL statement.

01 ARG-LIST.

02 ARG-COUNT PIC S9(9) COMP.
02 ARG-BY-VALUE PIC S9(9) COMP.
02 ARG-BY-REFERENCE USAGE POINTER
02 VALUE REFERENCE ARG-NAME.

. . . continue as needed

1

Most OpenVMS Alpha data types not directly supported in COBOL can be represented as an alphanumeric data item

of a certain number of bytes. While COBOL does not interpret the data type, it may be used to pass objects from one
language to another.

(continued on next page)

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

Advertising