External Names [ HP COBOL II/XL Programmer's Guide ] MPE/iX 5.0 Documentation
HP COBOL II/XL Programmer's Guide
External Names
An external name is a compiler-generated name that is recognized outside
the program. The compiler generates an external name for each of the
following:
* program-id. *
* ENTRY statement literal. *
* EXTERNAL data item or file.
* Program name that a CALL or CANCEL statement specifies.
* An external name is only generated for a program-id or ENTRY statement
literal of a separately compiled program. Programs nested within other
programs are not separately compiled, and their names are never external.
The compiler forms the external name from the name in the program as
follows:
[REV BEG]
* Converts each hyphen (-) to an underscore (_), unless the original
name begins with a backslash (\).
* Changes uppercase letters to lowercase letters, unless the
original name begins with a backslash (\).
* Truncates the original name to 30 characters if it is longer than
30 characters.[REV END]
If you compile the program with the control option CMCALL (Compatibility
Mode CALL), the compiler does the following unless the name begins with a
backslash (\):
1. Strips hyphens from the name.
2. Changes uppercase letters to lowercase letters.
3. Truncates the name to 15 characters.
Use the CMCALL control option for the following:
* Programs that call subprograms written in languages that depend on
1 and 3 above.
* Native Mode programs that call Compatibility Mode subprograms.
The above rules do not apply to intrinsics, whose external names are
supplied through the intrinsic mechanism in the file SYSINTR.PUB.SYS.
Example
The following are example program names and their corresponding external
names:
Internal Name External Name
Sub-Total sub_total
\Sub-Total Sub-Total
Name-Longer-Than-Thirty-Characters name_longer_than_thirty_charac
MPE/iX 5.0 Documentation