Compaq AAQ2G1FTK Marine Radio User Manual


 
Interprogram Communication
12.5 Communicating with Contained COBOL Programs
IDENTIFICATION DIVISION.
PROGRAM-ID. MAINPROG.
.
.
.
DATA DIVISION.
FILE SECTION.
FD CUSTOMER-FILE
GLOBAL
.
.
.
Any special registers associated with a GLOBAL file are also global.
12.5.2.3 Sharing USE Procedures
The USE statement specifies declarative procedures to handle input/output
errors. It also can specify procedures to be executed before the program processes
a specific report group.
More than one USE AFTER EXCEPTION procedure in any given program can
apply to an input/output operation when there is one procedure for file name
and another for the applicable open mode. In this case, only the procedure for
file name executes. Figure 12–5 shows that FILE-NAME-PROBLEM SECTION
executes.
Figure 125 Sharing USE Procedures
IDENTIFICATION DIVISION.
PROGRAMID. MAINPROGRAM.
.
.
.
PROCEDURE DIVISION.
DECLARATIVES.
.
.
.
IDENTIFICATION DIVISION.
PROGRAMID SUB1.
.
.
.
PROCEDURE DIVISION.
DECLARATIVES.
FILENAMEPROBLEM SECTION.
USE AFTER STANDARD ERROR PROCEDURE ON FILENAME.
.
.
.
FILEINPUTPROBLEM SECTION.
USE AFTER STANDARD ERROR PROCEDURE ON INPUT.
.
.
.
END DECLARATIVES.
000BEGIN.
OPEN INPUT FILENAME.
.
.
.
END PROGRAM SUB1
END PROGRAM MAINPROGRAM.
ZK1429AGE
2
1
1216 Interprogram Communication