What it means
Not every option fits every object. You cannot open a remote queue definition for input, open a process object for output, or delete a queue on close that is not dynamic. When the options and the object type do not fit, the call fails with 2045.
Typical causes
- The program opens a remote queue definition with an input, browse or inquire option.
- The program opens a non-queue object, such as a process or namelist, with a queue option.
- ObjectQMgrName names a remote queue manager, so input options are not allowed.
- MQCLOSE asks to delete a queue that is not a dynamic queue.
How to fix it
- Check which object type the name resolves to with DISPLAY QUEUE(name) TYPE.
- Use output-only options for remote or cluster queues; read from the queue on the queue manager that hosts it.
- Leave ObjectQMgrName blank when you mean the local queue manager.
- On close, only use the delete option on dynamic queues, or fix the model queue's definition type.
Example
Illustrative only; names and values are invented.
MQOPEN failed CompCode=2 Reason=2045 Queue=APP.REMOTE.QUEUE Options=INPUT_SHARED