MQRC 2080: Message too large for the buffer
MQRC 2080 (MQRC_
Other names for this code
Also written as RC2080, reason code 2080, MQ 2080, MQ error 2080, MQRC_TRUNCATED_MSG_FAILED, 0820, 0x0820, truncated message failed, MQGMO_ACCEPT_TRUNCATED_MSG, MQJE001 Reason 2080.
What it means
MQGET copies the message into the buffer the program passes, up to BufferLength bytes. If the message is longer and the get options don't include MQGMO_
The call still gives the program what it needs to recover. DataLength holds the full length of the message, the buffer holds as much of the message as fit, and the message descriptor (MQMD) is filled in. For a browse, the browse cursor doesn't move. The program can allocate a bigger buffer and get the message again.
If the program sets MQGMO_
Common causes
- The program uses a fixed buffer sized for typical messages, and a larger message arrived, for example after a sender added fields or started batching records.
- A COBOL or PL/I copybook defines a buffer for the old record layout, and the sending system now writes longer records.
- The program passes BufferLength smaller than the buffer it actually allocated.
- An unexpected message arrives on the queue, such as a report message or a message from a different application.
How to find the problem
- Log DataLength after the 2080. It gives the real length of the message, so you can compare it with BufferLength.
- Browse the message with
amqsbcgordmpmqmsgon distributed MQ, or a browse tool on z/OS, and check its format, put application name and length. - Check where BufferLength is set in the program and whether it matches the size of the buffer area.
- Check the MAXMSGL of the queue to know the largest message the program could ever receive.
How to fix it
- On 2080, allocate a buffer of at least DataLength and issue the get again. Match on the MsgId just returned in the MQMD, or use the browse cursor, so you get the same message and not the next one.
- Size the starting buffer to the largest message the application expects, or to the queue's MAXMSGL if storage allows.
- Fix copybooks or record definitions when the message layout changes, and recompile every program that reads the queue.
- Use MQGMO_
ACCEPT_ TRUNCATED_ MSG only when losing the end of a message is acceptable. Otherwise data is silently dropped.
IBM documentation
IBM documentation: MQRC 2080. Use the documentation for your installed release.
Related codes
Questions
Is the message lost after MQRC 2080?
No. Without MQGMO_ACCEPT_TRUNCATED_MSG the message stays on the queue, so the program can get it again with a larger buffer.
What is the difference between 2079 and 2080?
2080 means the get failed and the message is still on the queue. 2079 means the program accepted truncation, the message was removed and only the part that fit was returned.
Why is 2080 a warning and not a failure?
Because the call did return useful output, the MQMD, part of the data and the full length. The program can act on that and retry.