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
- Read DataLength after the call: it tells you the full message size.
- Allocate a buffer at least that big and issue MQGET again.
- Size the buffer to the queue's MAXMSGL if messages can vary.
- 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