HP 3000 Manuals

Ch 11. Interprogram Communication [ HP COBOL II/XL Reference Manual ] MPE/iX 5.0 Documentation


HP COBOL II/XL Reference Manual

Chapter 11  Interprogram Communication 

Program modules consist of separately compiled,but logically coordinated
programs, which, at execution time, are subdivisions of a single process.
This approach to programming lends itself to making a large problem more
easily programmed and debugged, by breaking a problem into logical
modules and coding each module separately.

In COBOL terminology, a program is either a source or an object program.
The distinction between the two is that a source program is simply a
syntactically correct set of COBOL statements, whereas an object program 
is the set of instructions, constants, and other data resulting from the
compilation of a source program.

A run unit is defined as being the total machine language necessary to
solve a given generated data processing problem.

One run unit may contain several object programs, some of which may not
have been generated by the COBOL compiler.

A run unit, then, is a combination of one main program with, optionally,
one or more subprograms.  Each subprogram may itself use one or more
subprograms.

The state of a program the first time it is called in a run unit is the
initial state of a program.  The initial state of a program is
characterized as follows:

   *   The program's internal data contained in the WORKING-STORAGE
       SECTION is initialized.  If a VALUE clause is used in the
       description of the data item, the data item is initialized to the
       defined value.  If a VALUE clause is not associated with a data
       item, the initial value of the data item is undefined.

   *   Internal files associated with the program are not in open mode.

   *   The control mechanisms for all PERFORM statements contained in the
       program are set to their initial states.

   *   A GO TO statement referenced by an ALTER statement within the same
       program is set to its initial state.

In COBOL, a program can transfer control to one or more subprograms,
whether or not the names of the subprograms are known at compile time.
Also, it is possible for the compiler to determine the[REV BEG]
availability of that subprogram.[REV END]

When a run unit contains more than one object program, there must be
communication between them.  Interprogram communication takes two forms:
transfer of control from one object program to another; and reference to 
common data.



MPE/iX 5.0 Documentation