Rules for validating MQI options

This section lists the situations that produce an MQRC_OPTIONS_ERROR reason code from an MQOPEN, MQPUT, MQPUT1, MQGET, MQCLOSE, or MQSUB call.


MQOPEN call

For the options of the MQOPEN call:

  • At least one of the following must be specified:

    • MQOO_BROWSE
    • MQOO_INPUT_EXCLUSIVE 1
    • MQOO_INPUT_SHARED 1
    • MQOO_INPUT_AS_Q_DEF 1
    • MQOO_INQUIRE
    • MQOO_OUTPUT
    • MQOO_SET
    • MQOO_BIND_ON_OPEN 2
    • MQOO_BIND_NOT_FIXED 2
    • MQOO_BIND_ON_GROUP 2
    • MQOO_BIND_AS_Q_DEF 2

  • Only one of the following is allowed:

    • MQOO_READ_AHEAD
    • MQOO_NO_READ_AHEAD
    • MQOO_READ_AHEAD_AS_Q_DEF
  1. Only one of the following is allowed:

    • MQOO_INPUT_EXCLUSIVE
    • MQOO_INPUT_SHARED
    • MQOO_INPUT_AS_Q_DEF
  2. Only one of the following is allowed:

    • MQOO_BIND_ON_OPEN
    • MQOO_BIND_NOT_FIXED
    • MQOO_BIND_ON_GROUP
    • MQOO_BIND_AS_Q_DEF
    Note: The options that are listed previously are mutually exclusive. However, as the value of MQOO_BIND_AS_Q_DEF is zero, specifying it with either of the other two bind options does not result in reason code MQRC_OPTIONS_ERROR. MQOO_BIND_AS_Q_DEF is provided to aid program documentation.

  • If MQOO_SAVE_ALL_CONTEXT is specified, one of the MQOO_INPUT_* options must also be specified.
  • If one of the MQOO_SET_*_CONTEXT or MQOO_PASS_*_CONTEXT options are specified, MQOO_OUTPUT must also be specified.
  • If MQOO_CO_OP is specified, MQOO_BROWSE must also be specified
  • If MQOO_NO_MULTICAST is specified, MQOO_OUTPUT must also be specified.


MQPUT call

For the put-message options:

  • The combination of MQPMO_SYNCPOINT and MQPMO_NO_SYNCPOINT is not allowed.
  • Only one of the following is allowed:

    • MQPMO_DEFAULT_CONTEXT
    • MQPMO_NO_CONTEXT
    • MQPMO_PASS_ALL_CONTEXT
    • MQPMO_PASS_IDENTITY_CONTEXT
    • MQPMO_SET_ALL_CONTEXT
    • MQPMO_SET_IDENTITY_CONTEXT
  • Only one of the following is allowed:

    • MQPMO_ASYNC_RESPONSE
    • MQPMO_SYNC_RESPONSE
    • MQPMO_RESPONSE_AS_TOPIC_DEF
    • MQPMO_RESPONSE_AS_Q_DEF
  • MQPMO_ALTERNATE_USER_AUTHORITY is not allowed (it is valid only on the MQPUT1 call).


MQPUT1 call

For the put-message options, the rules are the same as for the MQPUT call, except for the following:

  • MQPMO_ALTERNATE_USER_AUTHORITY is allowed.
  • MQPMO_LOGICAL_ORDER is not allowed.


MQGET call

For the get-message options:

  • Only one of the following is allowed:

    • MQGMO_NO_SYNCPOINT
    • MQGMO_SYNCPOINT
    • MQGMO_SYNCPOINT_IF_PERSISTENT
  • Only one of the following is allowed:

    • MQGMO_BROWSE_FIRST
    • MQGMO_BROWSE_MSG_UNDER_CURSOR
    • MQGMO_BROWSE_NEXT
    • MQGMO_MSG_UNDER_CURSOR
  • MQGMO_SYNCPOINT is not allowed with any of the following:

    • MQGMO_BROWSE_FIRST
    • MQGMO_BROWSE_MSG_UNDER_CURSOR
    • MQGMO_BROWSE_NEXT
    • MQGMO_LOCK
    • MQGMO_UNLOCK
  • MQGMO_SYNCPOINT_IF_PERSISTENT is not allowed with any of the following:

    • MQGMO_BROWSE_FIRST
    • MQGMO_BROWSE_MSG_UNDER_CURSOR
    • MQGMO_BROWSE_NEXT
    • MQGMO_COMPLETE_MSG
    • MQGMO_UNLOCK
  • MQGMO_MARK_SKIP_BACKOUT requires MQGMO_SYNCPOINT to be specified.
  • The combination of MQGMO_WAIT and MQGMO_SET_SIGNAL is not allowed.
  • If MQGMO_LOCK is specified, one of the following must also be specified:

    • MQGMO_BROWSE_FIRST
    • MQGMO_BROWSE_MSG_UNDER_CURSOR
    • MQGMO_BROWSE_NEXT
  • If MQGMO_UNLOCK is specified, only the following values are allowed:

    • MQGMO_NO_SYNCPOINT
    • MQGMO_NO_WAIT


MQCLOSE call

For the options of the MQCLOSE call:

  • The combination of MQCO_DELETE and MQCO_DELETE_PURGE is not allowed.
  • Only one of the following is allowed:

    • MQCO_KEEP_SUB
    • MQCO_REMOVE_SUB


MQSUB call

For the options of the MQSUB call:

  • At least one of the following must be specified:

    • MQSO_ALTER
    • MQSO_RESUME
    • MQSO_CREATE
  • Only one of the following is allowed:

    • MQSO_DURABLE
    • MQSO_NON_DURABLE
    Note: The options that are listed previously are mutually exclusive. However, as the value of MQSO_NON_DURABLE is zero, specifying it with MQSO_DURABLE does not result in reason code MQRC_OPTIONS_ERROR. MQSO_NON_DURABLE is provided to aid program documentation.
  • The combination of MQSO_GROUP_SUB and MQSO_MANAGED is not allowed.
  • MQSO_GROUP_SUB requires MQSO_SET_CORREL_ID to be specified.
  • Only one of the following is allowed:

    • MQSO_ANY_USERID
    • MQSO_FIXED_USERID
  • MQSO_NEW_PUBLICATIONS_ONLY is allowed in combination with:

    • MQSO_CREATE
    • MQSO_ALTER, if MQSO_NEW_PUBLICATIONS_ONLY was set on the original subscription
  • The combination of MQSO_PUBLICATIONS_ON_REQUEST and SubLevel greater than 1 is not allowed.
  • Only one of the following is allowed:

    • MQSO_WILDCARD_CHAR
    • MQSO_WILDCARD_TOPIC
  • MQSO_NO_MULTICAST requires MQSO_MANAGED to be specified.