MainframeKit

2080

MQRC_TRUNCATED_MSG_FAILED (X'0820')MQ REASON CODE

MQGET found a message bigger than the program's buffer and left it on the queue, because truncation was not allowed.

MOST LIKELY

The buffer size in the program is smaller than the largest message.

FIRST CHECK

Read DataLength after the call: it tells you the full message size.

TRY IT ▸

MainframeKit assistant

What it means

The buffer passed on MQGET is too small for the message. The program did not set the option to accept truncated messages, so the message stays on the queue. MQ returns the real length in DataLength and fills the buffer with as much as fits. The completion code is a warning, not a failure.

Typical causes

  • The buffer size in the program is smaller than the largest message.
  • Senders started sending bigger messages than before.
  • The program uses a fixed buffer from an old copybook or structure.

How to fix it

  1. Read DataLength after the call: it tells you the full message size.
  2. Allocate a buffer at least that big and issue MQGET again.
  3. Size the buffer to the queue's MAXMSGL if messages can vary.
  4. Only use MQGMO_ACCEPT_TRUNCATED_MSG if you really want to discard the rest of the message.

Example

Illustrative only; names and values are invented.

MQGET warning  CompCode=1  Reason=2080  BufferLength=1024  DataLength=8192