Delete Channel

The Delete Channel (MQCMD_DELETE_CHANNEL) command deletes the specified channel definition.


Required parameters

    ChannelName (MQCFST)
    Channel name (parameter identifier: MQCACH_CHANNEL_NAME).

    The name of the channel definition to be deleted. The maximum length of the string is MQ_CHANNEL_NAME_LENGTH.


Optional parameters

None of the following attributes are applicable to MQTT channels unless specifically mentioned in the parameter description.

    ChannelType (MQCFIN)
    The type of channel (parameter identifier: MQIACH_CHANNEL_TYPE). This parameter is currently only used with MQTT Telemetry channels, and is required when deleting a Telemetry channel. The only value that can currently be given to the parameter is MQCHT_MQTT.
    ChannelTable (MQCFIN)
    Channel table (parameter identifier: MQIACH_CHANNEL_TABLE).

    Specifies the ownership of the channel definition table that contains the specified channel definition.

    The value can be any of the following values:

      MQCHTAB_Q_MGR
      Queue manager table.

      MQCHTAB_Q_MGR is the default. This table contains channel definitions for channels of all types except MQCHT_CLNTCONN.

      MQCHTAB_CLNTCONN
      Client-connection table.

      This table only contains channel definitions for channels of type MQCHT_CLNTCONN.

    This parameter is not applicable to MQ Telemetry.

    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, you 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.

    QSGDisposition (MQCFIN)
    Disposition of the object within the group (parameter identifier: MQIA_QSG_DISP). This parameter applies to z/OS only. Specifies the disposition of the object to which you are applying the command (that is, where it is defined and how it behaves). The value can be any of the following values:

      MQQSGD_COPY
      The object definition resides on the page set of the queue manager that executes the command. The object was defined by a command using the parameter MQQSGD_COPY. Any object residing in the shared repository, or any object defined by a command using the parameter MQQSGD_Q_MGR, is not affected by this command.

      MQQSGD_GROUP
      The object definition resides in the shared repository. The object was defined by a command using the parameters MQQSGD_GROUP. Any object residing on the page set of the queue manager that executes the command (except a local copy of the object) is not affected by this command. If the command is successful, the following MQSC command is generated and sent to all active queue managers in the queue sharing group to delete local copies on page set zero:
      DELETE CHANNEL(name) QSGDISP(COPY)
      
      The deletion of the group object takes effect regardless of whether the generated command with QSGDISP(COPY) fails.

      MQQSGD_Q_MGR
      The object definition resides on the page set of the queue manager that executes the command. The object was defined by a command using the parameter MQQSGD_Q_MGR. Any object residing in the shared repository, or any local copy of such an object, is not affected by this command.

      MQQSGD_Q_MGR is the default value.

This command might return the following error codes in the response format header, in addition to the values shown on page Error codes applicable to all commands.


Error codes

    Reason (MQLONG)
    The value can be any of the following values:

      MQRCCF_CHANNEL_NOT_FOUND
      Channel not found.

      MQRCCF_CHANNEL_TABLE_ERROR
      Channel table value not valid.