MainframeKit

2045

MQRC_OPTION_NOT_VALID_FOR_TYPE (X'07FD')MQ REASON CODE

MQOPEN or MQCLOSE used an option that does not make sense for this kind of object or queue.

MOST LIKELY

The program opens a remote queue definition with an input, browse or inquire option.

FIRST CHECK

Check which object type the name resolves to with DISPLAY QUEUE(name) TYPE.

TRY IT ▸

MainframeKit assistant

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

  1. Check which object type the name resolves to with DISPLAY QUEUE(name) TYPE.
  2. Use output-only options for remote or cluster queues; read from the queue on the queue manager that hosts it.
  3. Leave ObjectQMgrName blank when you mean the local queue manager.
  4. 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