OpenTP1 Version 7 Programming Reference COBOL Language

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

CBLDCMCF('RECEIVE ') - Receive a message

Format

PROCEDURE DIVISION specification

CALL  'CBLDCMCF'  USING unique-name-1 unique-name-2
                        unique-name-3

DATA DIVISION specification

01  unique-name-1.
    02  data-name-A   PIC X(8) VALUE 'RECEIVE '.
    02  data-name-B   PIC X(5).
    02  FILLER       PIC X(3).
    02  data-name-C   PIC X(4).
    02  data-name-D   PIC X(4).
    02  data-name-E   PIC 9(8).
    02  data-name-F   PIC 9(8).
    02  data-name-G    PIC 9(9)  COMP.
    02  data-name-H   PIC X(4).
    02  data-name-I    PIC X(4).
    02  data-name-J    PIC X(4).
    02  data-name-K   PIC X(4).
    02  data-name-L   PIC X(8).
    02  data-name-M1  PIC X(4).
    02  data-name-M2  PIC X(8).
    02  data-name-M3  PIC X(4).
    02  data-name-M4  PIC 9(9)  COMP.
    02  data-name-M5  PIC 9(9)  COMP.
    02  data-name-M6  PIC X(1).
    02  data-name-M7  PIC X(1).
    02  data-name-N   PIC X(14).
01  unique-name-2.
    02  data-name-O   PIC X(4).
    02  data-name-P   PIC X(8).
    02  data-name-Q   PIC X(8).
    02  data-name-R   PIC X(8).
    02  data-name-T   PIC X(28).
01  unique-name-3.
    02  data-name-U   PIC 9(x)  COMP.
    02  data-name-V   PIC X(x).
    02  data-name-W   PIC X(n).

Description

CBLDCMCF('RECEIVE ') receives a segment of a message. When a whole logical message is received, call CBLDCMCF('RECEIVE ') as many times as there are segments.

CBLDCMCF('RECEIVE ') can receive the following messages:

When receiving a message which is sent from the remote system via a protocol, the syntax of CBLDCMCF('RECEIVE ') varies from one protocol to another. For the syntax of CBLDCMCF('RECEIVE ') which receives a message from the remote system, see the applicable OpenTP1 Protocol manual.

The maximum length of a single segment that can be received is 1 megabyte. Note that the actual value might be smaller depending on the protocol. For details, see the applicable OpenTP1 Protocol manual.

The figure below shows the format of the receive message area (area indicated with unique-name-3).

[Figure]

Data areas whose values are set in the UAP

data-name-A

Specify VALUE 'RECEIVE[Figure]' for the request code indicating that the message was received.

data-name-C

Specify whether the first segment of the message is received with one of the following:

'FRST': Specify 'FRST' to receive the first segment. If the message comprises only a single segment, also specify 'FRST'.

'SEG[Figure]': Specify 'SEG[Figure]' to receive an intermediate segment or the last segment.

data-name-D

Specify space.

data-name-G

Specify the length of the receive segment area.

data-name-H, data-name-I, data-name-J, data-name-K, data-name-L, data-name-M1, data-name-M2, data-name-M3

Specify space.

data-name-M4, data-name-M5

Specify 0.

data-name-M6

Specify space.

data-name-M7

Specify the buffer format to be used:

'1': Specify '1' to use buffer format 1. In general, buffer format 1 is used.

'2': Specify '2' to use buffer format 2.

Space: '1' (buffer format 1) is assumed as default.

data-name-N

Specify LOW-VALUE.

data-name-O

Specify space.

data-name-P [when an intermediate segment or the last segment is received]

Specify the input logical terminal name. Specify the logical terminal name returned when the first segment is received.

data-name-Q

This area is used by the MCF.

data-name-R

Specify space.

data-name-T

Specify LOW-VALUE.

data-name-V

With buffer format 1: PIC X(8)

With buffer format 2: PIC X(2)

This area is used by the MCF.

Data areas to which values are returned from OpenTP1

data-name-B

A status code of 5 digits is returned.

data-name-E

The date when the message is received is returned in the format of YYYYMMDD (where YYYY is year, MM is month, and DD is day).

data-name-F

The time when the message is received is returned in the format of HHMMSS00 (where HH indicates hours, MM indicates minutes, SS indicates seconds, and 00 is fixed).

data-name-P [when the first segment is received]

The input logical terminal name is returned.

Specify the returned logical terminal name for data-name-P when an intermediate segment or the last segment is received.

data-name-U

With buffer format 1: PIC 9(9)
The length of the receive segment is returned.

With buffer format 2: PIC 9(4)
(The length of the receive segment + 4) is returned.

data-name-W

The contents of the receive segment are returned.

Status codes

Status code Explanation
00000 Normal termination.
71000 CBLDCMCF('RECEIVE ') for receiving the first segment was called more than once. To receive an intermediate segment or the last segment, call CBLDCMCF('RECEIVE ') with 'SEG ' specified for data-name-C.
71001 CBLDCMCF('RECEIVE ') for receiving the next segment was called after the last segment of the message was received. CBLDCMCF('RECEIVE ') called immediately before receives a message completely. If CBLDCMCF('RECEIVE ') is called again after this status code is returned, the status code 72000 is returned.
71002 An error occurred during input processing for the message queue.
The message queue is in shutdown state.
71108 The local memory for processes became insufficient.
72000 Return at MHP execution:
BLDCMCF('RECEIVE ') for receiving an intermediate segment or the last segment was called before CBLDCMCF('RECEIVE ') for receiving the first segment was called. To receive the first segment, call CBLDCMCF('RECEIVE ') with FRST specified for data-name-C.
CBLDCMCF('RECEIVE ') was called again after the status code 71001 was returned.
Return at SPP execution:
CBLDCMCF('RECEIVE ') cannot be called from an SPP.
72001 The logical terminal name specified for data-name-P is invalid.
72013 A segment exceeding the length of the receive area was received. The excess portion was truncated.
A segment exceeding 32,767 bytes was received in the case of buffer format 2. The excess portion was truncated.
72016 The value specified for data-name-D is invalid.
The value specified for data-name-N or data-name-T is invalid.
The value specified for data-name-M7 is invalid.
72024 The value specified for data-name-O is invalid.
72025 The value specified for data-name-C is invalid.
72028 The value specified for data-name-A is invalid.
72036 The segment receive area is insufficient. Allocate an area of 9 bytes or more for buffer format 1; 5 bytes or more for buffer format 2.
Other than the above An unprecedented error (e.g., program damage) occurred.