Clear Topic String

The Clear Topic String (MQCMD_CLEAR_TOPIC_STRING) command clears the retained message which is stored for the specified topic.


Required parameters

    TopicString (MQCFST)
    Topic String (parameter identifier: MQCA_TOPIC_STRING).

    The topic string to be cleared The maximum length of the string is MQ_TOPIC_STR_LENGTH.

    ClearType (MQCFIN)
    Clear type (parameter identifier: MQIACF_CLEAR_TYPE).

    Specifies the type of clear command being issued. The value must be:

    MQCLRT_RETAINED Remove the retained publication from the specified topic string.


Optional parameters

    Scope (MQCFIN)
    Scope of clearance (parameter identifier: MQIACF_CLEAR_SCOPE).

    Whether the topic string is to be cleared locally or globally. The value can be:

      MQCLRS_LOCAL
      The retained message is removed from the specified topic string at the local queue manager only.

    CommandScope (MQCFST)
    Command scope (parameter identifier: MQCACF_COMMAND_SCOPE). This parameter applies to z/OS only. Specifies how the command is executed when the queue manager is a member of a queue sharing group. We can specify one of the following:

    • blank (or omit the parameter altogether). The command is executed on the queue manager on which it was entered.
    • a queue manager name. The command is executed on the queue manager you specify, providing it is active within the queue sharing group. If you specify a queue manager name other than the queue manager on which it was entered, we must be using a queue sharing group environment, and the command server must be enabled.
    • an asterisk (*). The command is executed on the local queue manager and is also passed to every active queue manager in the queue sharing group.

    The maximum length is MQ_QSG_NAME_LENGTH.

Parent topic: Definitions of the Programmable Command Formats