COBOL Manual for TNS and TNS/R Programs
Input and Output Concepts
HP COBOL Manual for TNS and TNS/R Programs—522555-006
26-11
Intercepting Operating System Messages
An HP COBOL process ignores operating system messages unless you arrange to
have it intercept them. To have an HP COBOL process intercept operating system
messages, you must include REPORT and MESSAGE SOURCE clauses in its
RECEIVE-CONTROL paragraph.
The MESSAGE SOURCE clause provides a mechanism through which a COBOL
program can discover the sender of each message received. During the successful
execution of a read operation on $RECEIVE, the $RECEIVE mechanism places a set
of values into the storage space designated in the MESSAGE SOURCE clause.
If the value of SYSTEM-FLAG is -1, the message came from the operating system.
For more information about the MESSAGE SOURCE phrase, see MESSAGE
SOURCE Phrase. For more information about the Receive-Control paragraph, see
Section 31, Process Initiation, Communication, and Management.
Figure 26-1. MESSAGE SOURCE Format
Non-CRE Environment
01 SOURCE-MESSAGE.
05 SYSTEM-FLAG PICTURE S9
USAGE IS COMPUTATIONAL.
05 ENTRY-NUMBER PICTURE 999
USAGE IS COMPUTATIONAL.
05 FILLER PICTURE X(4).
05 PROCESS-ID.
10 PROCESS-NAME PICTURE X(6).
10 CPU-PIN PICTURE X(2).
05 FILLER PICTURE X(16).
CRE
01 SOURCE-MESSAGE.
05 SYSTEM-FLAG PICTURE S9
USAGE IS COMPUTATIONAL.
05 ENTRY-NUMBER PICTURE 999
USAGE IS COMPUTATIONAL.
05 FILLER PICTURE X(4).
05 PHANDLE PICTURE X(20).
05 FILLER PICTURE X(4).