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

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

6.6.6 CBLDCCLS('ASMRECV ') - Receiving assembled 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) Notes

(1) Form

(a) In a multi-thread environment
PROCEDURE DIVISION
 
CALL 'CBLDCCLS' USING identifier-1 identifier-2 identifier-3
 
DATA DIVISION
01 identifier-1.
   02  data-name-A  PIC X(8) VALUE 'ASMRECV[Figure]'.
   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 S9(9) COMP.
01 identifier-2.
   02  data-name-E  PIC S9(9) COMP.
   02  data-name-F  PIC X(n).
01 identifier-3.
   02  data-name-G  PIC 9(9) COMP.
 
(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 'ASMRECV[Figure]'.
   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 S9(9) COMP.
01 identifier-2.
   02  data-name-E  PIC S9(9) COMP.
   02  data-name-F  PIC X(n).
 

(2) Purpose

Uses the message assembly facility to receive messages. When this facility is used, the statement receives four-byte message information, and then receives data equivalent to the size set in the message information. The statement then stores the data in data-name-F. The four-byte message information is not stored in data-name-F. The length of the received message is stored in data-name-E. The message length stored in data-name-E does not include the message information length.

If Y is specified for DCCLTDELIVERYCHECK of the client environment definition, the statement also uses the message delivery confirmation facility. In this case, the statement receives 11-byte message information, and then receives data equivalent to the size set in the message information. The function then stores the data in data-name-F. The 11-byte message information is not stored in data-name-F. The length of the received message is stored in data-name-E. The message length stored in data-name-E does not include the message information length. If the received message information includes a response request, the function sends 11-byte message information, and then returns control to the CUP.

Before executing CBLDCCLS('ASMRECV '), make sure that you execute CBLDCRPS('OPEN ') in which 8 or 16 is specified in data-name-C.

(3) Data area where the UAP sets values

If a divided message arrives, the statement repeats the receive processing until the entire message arrives. The timeout specified by this argument is applied every time the statement attempts a reception. If you want to use the value of this argument as the maximum response wait time for the client, specify the 00000002 option for DCCLTOPTION of the client environment definition.

(4) Data area for which a value is returned

(5) Status codes

Status code Meaning
00000 Normal termination
02501 Invalid argument
02502 Possible causes are as follows:
  • CBLDCRPS('OPEN ') has not been executed.
  • CBLDCRPS('OPEN ') has been executed, but 8 or 16 is not specified for data-name-C.
02504 Insufficient memory
02506 A network error occurred. The connection is released.
02507 Message reception timed out. The connection is released.
02518 A system error occurred. If the error is a network error, the connection is released.
02538 Insufficient resource
02542 The remote system released the connection.
02544 The client ID specified for data-name-G differs from the one received by CBLDCCLS('CLTIN ') or CBLDCCLS('EXCLTIN ').
02546 The area prepared by the CUP was too small to receive the message from the remote system. The connection is released.
02548 An invalid message was received. The connection is released.

(6) Notes