Communicator 3000 MPE/iX Release 6.0 (Platform Software Release C.60.00) (30216-90269)

Chapter 10 151
Technical Articles
COBOL II/iX Enhancements
CALL by plabel
This enhancement provides an alternate way to achieve execution-time
binding with the CALL statement. In standard COBOL, the CALL
statement can use an identifier that specifies a nonnumeric data item
containing the name of the desired subprogram. COBOL II/iX
generates a call to the HPGETPROCPLABEL intrinsic to dynamically
load the specified procedure, and that procedure is then executed. The
XLs searched in this case are those in the binding sequence of the
calling process.
There are situations where it may be desirable for the programmer to
call HPGETPROCPLABEL explicitly, for example, when the XL to be
searched is not known at load time or is not in the calling program's
binding sequence. It is now possible to code your own call to
HPGETPROCPLABEL, save the returned procedure label in a numeric
data item, and then use that plabel in a CALL statement.
As an example, suppose that the following subprogram has been
compiled and placed in an executable library named TESTXL.
IDENTIFICATION DIVISION.
PROGRAM-ID. COBOLSUB INITIAL.
PROCEDURE DIVISION.
BEGIN.
DISPLAY "In COBOLSUB"
EXIT PROGRAM.
END PROGRAM COBOLSUB.
Using the functionality of call by plabel, this subprogram can now be
dynamically loaded and invoked as follows.
IDENTIFICATION DIVISION.
PROGRAM-ID. COBOL-MAIN.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 PROCNAME PIC X(10) VALUE "-COBOLSUB-".
01 PLABEL PIC S9(9) COMP.
01 FIRSTFILE PIC X(8) VALUE "-TESTXL-".
PROCEDURE DIVISION.
BEGIN.
CALL INTRINSIC "HPGETPROCPLABEL" USING
PROCNAME, PLABEL, \\, FIRSTFILE
CALL PLABEL
STOP RUN.
END PROGRAM COBOL-MAIN.
The ability to use a numeric data item in a CALL statement is a
nonstandard HP extension to the COBOL language.
New Routines for Boolean Operations
There are six new routines for performing boolean operations:
HP_BYTE_AND
HP_BYTE_OR
HP_BYTE_XOR
HP_BYTE_NOT