# MQRC 2037: Handle not open for input

Source: https://wndsoftware.com/mainframe-errors/mqrc-2037

### MQRC 2037: Handle not open for input

MQRC 2037 means an MQGET tried to consume a message through a handle not opened for input. Review the original MQOPEN and the consumer design.


#### Other names for this code

Also written as `RC2037`, `reason code 2037`, `MQ error 2037`, `MQRC_NOT_OPEN_FOR_INPUT`, `07F5`, `0x07F5`.


### What it means

The application has a handle, but that handle was not opened to retrieve messages destructively. MQOO_BROWSE and MQOO_OUTPUT serve other purposes. A queue name that is correct does not establish that the handle has the required capability.

IBM identifies the input open options as MQOO_INPUT_SHARED, MQOO_INPUT_EXCLUSIVE and MQOO_INPUT_AS_Q_DEF. Choose according to the application's concurrency requirements and queue definition.


#### A troubleshooting example

A viewer can display a message but its delete action fails with 2037. The browse handle was intentionally read-only in behavior. Decide whether deletion is an approved feature before changing the open options. If it is, obtain a separately owned input handle and test the complete consume-and-commit sequence on disposable messages. Include another consumer in the test so the chosen shared or exclusive input mode matches the real workload. Clearing the reason code without this design decision can turn a harmless viewer into a destructive tool.


### Common causes

- A browse tool switches to consumption using its browse-only handle.
- A factory returns a producer handle to code that expects a consumer.
- A conditional options mask leaves out the intended input option.


### How to find the problem

- Find the MQOPEN associated with the failing Hobj and capture its actual options. Include any wrapper or language framework setting.
- Check whether the operation is supposed to browse or remove the message. A mistaken destructive get may be the real application defect.
- Inspect the queue's input-sharing design before choosing an input mode. Coordinate with other consumers rather than defaulting to exclusive access.
- Exercise both the normal path and the branch that changes operation mode. Configuration-dependent bugs often disappear in a simple startup test.


### How to fix it

- For a real consumer, open the queue with the appropriate input option and retain that handle for its intended lifetime.
- For a viewer, keep the browse operation instead of granting destructive input simply to clear the error.
- Add an interface boundary between viewing and consuming. Test whether a message remains on the queue after each action and after rollback where applicable.


### What it looks like


```text
Illustrative diagnostic notes; not an IBM message template.
MQOPEN: MQOO_BROWSE
Later MQGET requests destructive input
Reason=2037
Check intended action before changing open options.
```


### IBM documentation

[IBM MQ 9.4: 2037 MQRC_NOT_OPEN_FOR_INPUT](https://www.ibm.com/docs/en/ibm-mq/9.4.x?topic=codes-2037-07f5-rc2037-mqrc-not-open-input). Use the documentation for your installed release.

[Report a correction to WND Software](https://wndsoftware.com/contact#message).

Technical reviewer: [Albert Joseph](https://wndsoftware.com/authors/albert-joseph), WND Software.

Updated 2026-10-23. IBM documentation checked for this article. Written in our own words. For the full reference, check IBM’s MQ documentation for your version.


### Related codes

[MQRC 2036 MQRC_NOT_OPEN_FOR_BROWSE Read →](https://wndsoftware.com/mainframe-errors/mqrc-2036)
[MQRC 2035 MQRC_NOT_AUTHORIZED Read →](https://wndsoftware.com/mainframe-errors/mqrc-2035)
[MQRC 2042 MQRC_OBJECT_IN_USE Read →](https://wndsoftware.com/mainframe-errors/mqrc-2042)

### Questions


#### Which input mode should I use?

Use shared, exclusive or queue-default input according to the queue and application concurrency design. Exclusive input is not a universal fix.


#### Is 2037 an authorization denial?

It identifies the handle's open mode. Authorization is a separate check; adding authority does not retrofit an existing handle.

[IBM MQ reason codes](https://wndsoftware.com/mainframe-errors/mq-reason-codes) · [MQRC 2036](https://wndsoftware.com/mainframe-errors/mqrc-2036) · [MQRC 2038](https://wndsoftware.com/mainframe-errors/mqrc-2038)

[← All error codes](https://wndsoftware.com/mainframe-errors/)
