COBOL Manual for TNS/E Programs (H06.03+)
Process Initiation, Communication, and
Management
HP COBOL Manual for TNS/E Programs—520347-003
31-11
Example of Simple Interprocess Communication
The bold text in Example 31-6 is significant. Note that, in PITCHER, the file for
CATCHER is opened for I-O even though it is being used only for output. If you open a
process with the OUTPUT or EXTEND attribute, HP COBOL handles the process as a
printer device and tries to advance it to the next page—an operation that is
meaningless (and fatal) to CATCHER.
Figure 31-4. $RECEIVE From PITCHER to CATCHER
Example 31-6. PITCHER Code (page 1 of 2)
IDENTIFICATION DIVISION.
PROGRAM-ID. PITCHER.
AUTHOR. JO COBOL.
INSTALLATION. TRANSACTIONS ANONYMOUS.
DATE-WRITTEN. 29 FEBRUARY 1988.
DATE-COMPILED.
*************************************************************
* This program illustrates the transmission of messages to *
* another COBOL program, CATCHER, whose process name is *
* $CATCH. *
* *
* Records entered at this process's home terminal are sent *
* $CATCH. *
*************************************************************
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. HP TXP.
OBJECT-COMPUTER. HP TXP.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT REPORT-OUT
ASSIGN TO "$CATCH"
ORGANIZATION IS SEQUENTIAL
ACCESS MODE IS SEQUENTIAL.
"PITCHER" $CATCH
text line
VST712.vsd










