Interprogram Communication
12.4 Accessing Another Program’s Data Division
Figure 12–2 Transfer of Control Flow from a Main Program to Multiple Subprograms
Sharing Execution Control
from a Main Program to Multiple Subprograms
IDENTIFICATION DIVISION.
PROGRAM−ID. MAINPROG.
ENVIRONMENT DIVISION.
DATA DIVISION.
PROCEDURE DIVISION.
BEGIN.
CALL "SUB".
STOP RUN.
IDENTIFICATION DIVISION.
PROGRAM−ID. SUB.
ENVIRONMENT DIVISION.
DATA DIVISION.
PROCEDURE DIVISION.
BEGIN.
CALL "SUBA".
EXIT PROGRAM.
IDENTIFICATION DIVISION.
PROGRAM−ID. SUBA.
ENVIRONMENT DIVISION.
DATA DIVISION.
PROCEDURE DIVISION.
BEGIN.
CALL "SUBB".
EXIT PROGRAM.
IDENTIFICATION DIVISION.
PROGRAM−ID. SUBB.
ENVIRONMENT DIVISION.
DATA DIVISION.
PROCEDURE DIVISION.
BEGIN.
ZK−1474−GE
.
.
.
EXIT PROGRAM.
1
2
10
3
4
5
9
6
8
7
•
The GLOBAL clause (see Section 12.5.2)
12.4.1 The USING Phrase
To access a calling program’s Data Division, use a CALL statement in the calling
program and a Procedure Division USING phrase in the called program. The
USING phrases of both the CALL statement and the Procedure Division header
must contain an equal number of data names. (See Figure 12–3.)
Interprogram Communication 12–9
Содержание COBOL AAQ2G1FTK
Страница 22: ......
Страница 30: ......
Страница 94: ......
Страница 110: ......
Страница 146: ......
Страница 180: ......
Страница 194: ...Processing Files and Records 6 1 Defi...
Страница 300: ......
Страница 490: ......
Страница 516: ......
Страница 517: ......
Страница 530: ......
Страница 534: ......
Страница 590: ......
Страница 620: ......