The Initial Clause; Contained Programs - Compaq COBOL AAQ2G1FTK User Manual

Compaq computer accessories user manual
Table of Contents

Advertisement

Interprogram Communication
12.2 COBOL Program Attributes
Example 12–3 Run Unit with Three Separately Compiled Programs, One with

12.2.1 The INITIAL Clause

A COBOL program with an INITIAL clause is returned to its initial state
whenever that program exits. This ensures that it will be in its initial state the
next time it is called.
During this initialization process, all internal program data whose description
contains a VALUE clause is initialized to that defined value. Any item whose
description does not include a VALUE clause will be initialized, and contain an
undefined value.
When an INITIAL clause is present and when the program is called, an implicit
CLOSE statement executes for all files in the open mode associated with internal
file connectors.
12–4 Interprogram Communication
Two Contained Programs
IDENTIFICATION DIVISION.
PROGRAM-ID. MAIN-PROGRAM.
.
.
.
CALL SUB1.
CALL SUB2.
.
STOP RUN.
IDENTIFICATION DIVISION.
PROGRAM-ID. SUB1.
.
.
.
CALL SUB3.
EXIT PROGRAM.
END PROGRAM SUB1.
IDENTIFICATION DIVISION.
PROGRAM-ID. SUB2.
.
.
.
EXIT PROGRAM.
END PROGRAM SUB2.
END PROGRAM MAIN-PROGRAM.
IDENTIFICATION DIVISION.
PROGRAM-ID. SUB3.
.
.
.
CALL SUB4.
.
.
.
STOP RUN.
IDENTIFICATION DIVISION.
PROGRAM-ID. SUB4.
.
.
.
EXIT PROGRAM.
7
8
9
1 0
1 1

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the COBOL AAQ2G1FTK and is the answer not in the manual?

Subscribe to Our Youtube Channel

Table of Contents