Interprogram Communication [ HP COBOL II/XL Reference Manual ] MPE/iX 5.0 Documentation
HP COBOL II/XL Reference Manual
Interprogram Communication
This section explains these aspects of interprogram communication:
* External names.
* Subprogram types.
* Intrinsics.
* Parameter alignment.
External Names
An external name is one that is visible to other programs. The compiler
generates external names for the PROGRAM-ID name (programname), the name
in the ENTRY statement (literal-1), and the program name in the CALL
statement (literal-1) according to the following conventions (unless
$CONTROL CMCALL is specified):
* Long names are truncated to 30 characters.
* Uppercase characters are converted to lowercase unless the first
character of the name is a backslash (\).
* If a name begins with a backslash, it is interpreted literally as
beginning with the character after the backslash.
* Hyphens are converted to underscores.
When $CONTROL CMCALL is specified, the external names are generated
according to the following conventions:
* Hyphens within names are removed.
* Uppercase characters are converted to lowercase.
* Names are truncated to 15 characters.
Subprogram Types
Subprogram types are discussed in Chapter 11 , "Interprogram
Communication," and in the HP COBOL II/XL Programmer's Guide. There are
no restrictions as to which type of subprogram (ANSISUB, DYNAMIC, or
SUBPROGRAM) can be in a relocatable library or an executable library in
HP COBOL II/XL.
When an ON EXCEPTION phrase,[REV BEG] an ON OVERFLOW phrase, or[REV END]
identifier-1 is specified in the CALL statement, the following
restrictions apply:
* identifier-1 cannot be numeric.
* The subprogram called must reside in an executable library or in
the program file.
Calling Intrinsics
You must include the INTRINSIC phrase to call all MPE operating system
intrinsics. Using the INTRINSIC phrase is also recommended for calling
subsystem intrinsics to provide for more thorough error checking and
greater portability of programs.
Parameter passing to intrinsics is described in detail in the HP COBOL
II/XL Programmer's Guide.
[REV BEG]
The system intrinsic file is SYSINTR.PUB.SYS.[REV END]
.LOC. Pseudo-Intrinsic.
Addresses on MPE XL systems are either 32 or 64 bits long. To get a
32-bit address, you must define the result of the .LOC. pseudo-intrinsic
as:
PIC S9(9) USAGE IS BINARY.
To get a 64-bit address, you must define the result as:
PIC S9(18) USAGE IS BINARY.
CAUTION Pseudo-intrinsics are highly machine-dependent and should not be
used in programs that may be run on different machines and
architectures now or in the future.
Parameter Alignment
The compiler passes information to the Link Editor about the actual
alignment of each parameter of the CALL statement.
[REV BEG]
If you use either CALLALIGNED or CALLALIGNED16 with the control option
OPTFEATURES, an error message is issued for each parameter of a CALL
statement that is not on a 32- or 16-bit boundary, respectively.[REV END]
If you specify either LINKALIGNED or LINKALIGNED16 with the control
option OPTFEATURES for a subprogram, the subprogram expects all
parameters in the USING phrase of the PROCEDURE DIVISION header to be
aligned on 32-bit or 16-bit boundaries, respectively. Without this
option, the compiler assumes that all parameters are on byte boundaries.
On MPE V systems, the @ sign preceding a parameter in the USING phrase of
the CALL statement indicates that the byte address of that parameter
should be passed to the subprogram being called. Since all addresses are
byte addresses on MPE XL systems, the @ sign on parameters is ignored.
MPE/iX 5.0 Documentation