DELETE SUB (delete a durable subscription)

Use the MQSC command DELETE SUB to remove a durable subscription from the system. For a managed destination, any unprocessed messages left on the destination are removed.

Using MQSC commands

For information on how you use MQSC commands, see Performing local administration tasks using MQSC commands.

[z/OS]You can issue this command from sources CR. For an explanation of the source symbols, see Sources from which you can issue MQSC commands on z/OS®.

Synonym: DEL SUB

DELETE SUB

Read syntax diagramSkip visual syntax diagram DELETE SUB ,(subscription-name)SUBID(id) CMDSCOPE(' ')1CMDSCOPE(qmgr-name)1CMDSCOPE(*)2 IGNSTATE(NO)3IGNSTATE(YES)
Notes:
  • 1 Valid only on z/OS.
  • 2 Valid only on z/OS when the queue manager is a member of a queue sharing group.
  • 3 Valid only on AIX®, Linux®, and Windows.

Usage notes for DELETE SUB

  • You can specify either the name, the identifier, or both, of the subscription you want to delete.

    Examples of valid forms:

    
      DELETE SUB(xyz)
      DELETE SUB SUBID(123)
      DELETE SUB(xyz) SUBID(123)
    
  • Successful completion of the command does not mean that the action completed. To check for true completion, see the DELETE SUB step in Checking that async commands for distributed networks have finished.

Parameter descriptions for DELETE SUB

subscription-name
The local name of the subscription definition to be deleted.
[z/OS]CMDSCOPE
This parameter applies to z/OS only and specifies how the command runs when the queue manager is a member of a queue sharing group.
CMDSCOPE must be blank, or the local queue manager, if QSGDISP is set to GROUP.
' '
The command runs on the queue manager on which it was entered. This is the default value.
qmgr-name
The command runs on the queue manager you specify, providing the queue manager is active within the queue sharing group.

You can specify a queue manager name other than the queue manager on which the command was entered, only if you are using a queue sharing group environment and if the command server is enabled.

*
The command runs on the local queue manager and is also passed to every active queue manager in the queue sharing group. The effect of this is the same as entering the command on every queue manager in the queue sharing group.

You cannot use CMDSCOPE as a filter keyword.

SUBID( string )
The internal, unique key identifying a subscription.
[MQ 9.2.1 Dec 2020][AIX, Linux, Windows]IGNSTATE
This parameter allows you to specify whether you want the command to return an error code if the object is already in the state the command moves it to.
A value of YES means the return code and message are the same as if the MQSC object has not been deleted.

A value of NO means that the return code is zero, even if the object has been deleted. This is the default value.