Communicator 3000 MPE/iX Release 6.0 (Platform Software Release C.60.00) (30216-90269)
150 Chapter 10
Technical Articles
COBOL II/iX Enhancements
COBOL II/iX Enhancements
by Walter Murray
Support Technology Lab
Overview
This release of COBOL II/iX on MPE/iX 6.0 provides several
enhancements that were requested by Interex SIGCOBOL. Some of
these enhancements have already been made available in various
patches to MPE/iX 5.5.
Secondary Entry Points
COBOL II/iX now supports secondary entry points in a main program.
To specify a secondary entry point, use the ENTRY statement, and give
a nonnumeric literal with the desired entry point name. Specifying that
entry point on the MPE/iX RUN command will cause execution to begin
at that ENTRY statement. Any number of ENTRY statements may
appear, as long as they specify different entry point names. The ENTRY
statement is a nonstandard HP extension to the COBOL language.
The following sample program demonstrates the use of a secondary
entry point.
IDENTIFICATION DIVISION.
PROGRAM-ID. UPDATE-MASTER.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 SW-CLEAR-YTD-TOTALS PIC X VALUE "F".
PROCEDURE DIVISION.
0000-BEGIN.
* Enter here for routine processing.
GO TO 1000-MAIN.
ENTRY "YEAREND".
* Enter here for year-end processing.
MOVE "T" TO SW-CLEAR-YTD-TOTALS.
1000-MAIN.
* Update master file, optionally resetting
* year-to-date totals, etc.
DISPLAY "Begin UPDATE-MASTER: SW-CLEAR-YTD-TOTALS = ",
QUOTE, SW-CLEAR-YTD-TOTALS, QUOTE
* ...
STOP RUN.
END PROGRAM UPDATE-MASTER.
Suppose this program is compiled and linked into an executable
program named UPDATE. The usual way to invoke it would be with
this command:
RUN UPDATE
Alternately, it may be invoked through its alternate entry point, using
this command:
RUN UPDATE,YEAREND