Opening objects using the MQOPEN call

Use this information to learn about opening objects using the MQOPEN call.

As input to the MQOPEN call, you must supply:
  • A connection handle. For CICS® applications on z/OS®, you can specify the constant MQHC_DEF_HCONN (which has the value zero), or use the connection handle returned by the MQCONN or MQCONNX call. For other programs, always use the connection handle returned by the MQCONN or MQCONNX call.
  • A description of the object that you want to open, using the object descriptor structure (MQOD).
  • One or more options that control the action of the call.
The output from MQOPEN is:
  • An object handle that represents your access to the object. Use this on input to any subsequent MQI calls.
  • A modified object-descriptor structure, if you are creating a dynamic queue (and it is supported on your platform).
  • A completion code.
  • A reason code.

Scope of an object handle

The scope of an object handle (Hobj) is the same as the scope of a connection handle (Hconn).

This is covered in Scope of MQCONN or MQCONNX and Shared (thread independent) connections with MQCONNX. However, there are additional considerations in some environments:
CICS
In a CICS program, you can use the handle only within the same CICS task from which you made the MQOPEN call.
IMS and z/OS batch
In the IMS and batch environments, you can use the handle within the same task, but not within any subtasks.

Descriptions of the parameters of the MQOPEN call are given in MQOPEN.

The following sections describe the information that you must supply as input to MQOPEN.

Identifying objects (the MQOD structure)

Use the MQOD structure to identify the object that you want to open. This structure is an input parameter for the MQOPEN call. (The structure is modified by the queue manager when you use the MQOPEN call to create a dynamic queue.)

For full details of the MQOD structure, see MQOD.

For information about using the MQOD structure for distribution lists, see Using the MQOD structure under Distribution lists.