OpenTP1 Version 7 TP1/Client User's Guide TP1/Client/W, TP1/Client/P

[Contents][Index][Back][Next]

6.7.1 CBLDCCLS('NOTIFY ') - Receiving one-way messages

Organization of this subsection
(1) Form
(2) Purpose
(3) Data area where the UAP sets values
(4) Data area for which a value is returned
(5) Status codes
(6) Note

(1) Form

(a) In a multi-thread environment
PROCEDURE DIVISION
 
CALL 'CBLDCCLS' USING identifier-1 identifier-2
 
DATA DIVISION
 
01 identifier-1.
   02 data-name-A PIC X(8)  VALUE 'NOTIFY '.
   02 data-name-B PIC X(5).
   02 FILLER     PIC X(3).
   02 data-name-C PIC S9(9) COMP VALUE ZERO.
   02 data-name-D PIC 9(4)  COMP.
   02 FILLER     PIC X(2).
   02 data-name-E PIC S9(9) COMP.
   02 data-name-F PIC X(64).
   02 data-name-G PIC X(8).
   02 FILLER     PIC 9(4)  COMP.
   02 FILLER     PIC X(2).
   02 data-name-I PIC X(256).
01 identifier-2.
   02 data-name-J PIC S9(9) COMP.
   02 data-name-K PIC X(n).
 
(b) In a single-thread environment
PROCEDURE DIVISION
 
CALL 'CBLDCCLT' USING identifier-1 identifier-2
 
DATA DIVISION
 
01 identifier-1.
   02 data-name-A PIC X(8)  VALUE 'NOTIFY '.
   02 data-name-B PIC X(5).
   02 FILLER     PIC X(3).
   02 data-name-C PIC S9(9) COMP VALUE ZERO.
   02 data-name-D PIC 9(4)  COMP.
   02 FILLER     PIC X(2).
   02 data-name-E PIC S9(9) COMP.
   02 data-name-F PIC X(64).
   02 data-name-G PIC X(8).
01 identifier-2.
   02 data-name-J PIC S9(9) COMP.
   02 data-name-K PIC X(n).
 

(2) Purpose

Waits for a message returned by the CBLDCRPC('CLTSEND ') request code issued on the server side. The program stops waiting for the message if a timeout occurs before receiving the message. The timeout is specified in data-name-E. On reception of the message, this program returns the status code, received message, host name of the message-originating server, and node identifier of the message-originating server, and control returns to the CUP. Before executing this program, you do not need to execute CBLDCCLS('CLTIN ') and CBLDCRPS('OPEN ').

(3) Data area where the UAP sets values

(4) Data area for which a value is returned

(5) Status codes

Status code Meaning
00000 Normal termination
02501 Invalid value for the data name. The request code (data-name-A) may be invalid.
02503 Unsuccessful initialization. Alternatively, the client environment definition is specified incorrectly.
02504 A necessary amount of buffer could not be allocated.
02506 Network error
02507 Timeout occurred during reception of the message.
02518 System error
02535 Different versions
02546 The received message is too large for the CUP-provided area. The part that does not fit is truncated. Values have already been set for data-name-F and data-name-G.
02547 The specified port number is already used.
02548 Invalid message received
02549 The one-way message reception status was canceled by CBLDCCLS('CANCEL '). Values have already been set for data-name-F, data-name-J, and data-name-K.

(6) Note

Specify a unique port number in data-name-D for each process or thread when multiple processes or multiple threads are executed simultaneously on the same machine. Do not specify a port number for use by the operating system or other programs even if one can be specified in data-name-D. If you specify a port number in this case, response data might not be received correctly. The port numbers used by the operating system differ depending on the operating system. For details, see the documentation of your operating system.