RECEIVE - Accept temporarily-stored data

Format

DATA DIVISION (communication description entry) specification

CD  communication-description-name
   FOR {INPUT|I-O} STORAGE
   [STATUS  KEY  IS  data-name-1] .

01 unique-name-1.
  02 data-name-2  PIC  9(4) COMP.
  02 data-name-3  PIC  X(4).
  02 data-name-4  PIC  X(n).

PROCEDURE DIVISION specification

RECEIVE  communication-description-name  {MESSAGE|SEGMENT}
  INTO  unique-name-1.

Description

RECEIVE enables the following CALL interface facility:

Items specified in the communication description entry

FOR clause

Specify INPUT STORAGE or I-O STORAGE.

STATUS KEY clause

Specify this clause to receive a status code. If this clause is omitted, a status code cannot be received.

Items specified in the communication statement

MESSAGE, SEGMENT

Specify MESSAGE or SEGMENT.

unique-name-1

Specify the data item indicating the area for receiving temporary-stored data. The following figure shows the format of unique-name-1 after the message is received:

[Figure]

Status codes

Status codesStatus codes
00000Normal termination.
72000The RECEIVE statement that receives temporary-stored data cannot be used from an SPP.
72013Temporary-stored data exceeding the receive area length was received. The excess portion was truncated because the data exceeds 32,761 bytes.
72036The value specified for the receive area length is less then 7 bytes.
72101RECEIVE statement that receives the temporary-stored data was used by an MHP which is not continuous-inquiry-response type (type=cont).
72106RECEIVE statement that receives the temporary-stored data was used before RECEIVE statement that receives the first segment.
72107RECEIVE statement that receives the temporary-stored data was used after DISABLE statement that terminates the continuous inquiry response.
Other than the aboveAn unprecedented error (e.g., program damage) occurred.