ALTER SUB

Use the MQSC command ALTER SUB to alter the characteristics of an existing subscription.

Using MQSC commands

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

IBM® i UNIX and Linux® Windows z/OS®
X X X CR

Parameters not specified in the ALTER SUB command result in the existing values for those parameters being left unchanged.

For an explanation of the symbols in the z/OS column, see Using commands on z/OS.

Synonym: ALT SUB

ALTER SUB

Read syntax diagramSkip visual syntax diagram ALTER SUB (string)SUBID(string) CMDSCOPE(' ')CMDSCOPE(qmgr-name)1CMDSCOPE(*)12DEST(string)DESTCORL(string)DESTQMGR(string)EXPIRY(integerUNLIMITED)PSPROP(NONECOMPATMSGPROPRFH2)PUBACCT(string)PUBAPPID(string)PUBPRTY(ASPUBASQDEFinteger)REQONLY(NOYES)SUBUSER(string)USERDATA(string)VARUSER(ANYFIXED)
Notes:
  • 1 Valid only on z/OS when the queue manager is a member of a queue-sharing group.
  • 2 Valid only on z/OS.

Usage notes for ALTER SUB

  1. The following are valid forms of the command:
    
    ALT SUB(xyz)
    ALT SUB SUBID(123)
    ALT SUB(xyz) SUBID(123)
    
  2. Although permitted on the DEFINE command, you cannot alter the following fields using DEFINE SUB (REPLACE):
    • TOPICOBJ
    • TOPICSTR
    • WSCHEMA
    • SELECTOR
    • SUBSCOPE
    • DESTCLAS
  3. At the time the ALT SUB command processes, no check is performed that the named DEST or DESTQMGR exists. These names are used at publishing time as the ObjectName and ObjectQMgrName for an MQOPEN call. These names are resolved according to the IBM MQ name resolution rules.
  4. [V8.0.0.6 Jan 2017]Subscriptions with a SUBTYPE of PROXY cannot be modified. Attempts to modify a proxy subscription by using the PCF interface return MQRCCF_SUBSCRIPTION_IN_USE. MQSC reports the following message:
    AMQ8469: WebSphere MQ subscription SYSTEM.PROXY in use.

Parameter descriptions for ALTER SUB

(string)
A mandatory parameter. Specifies the unique name for this subscription, see SUBNAME property.
[z/OS]CMDSCOPE
[z/OS] This parameter applies to z/OS only and specifies how the command is processed when the queue manager is a member of a queue-sharing group.
' '
The command is processed on the queue manager on which it was entered. This is the default value.
qmgr-name
The command is processed 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 is processed on the local queue manager and is also passed to every active queue manager in the queue-sharing group. The effect of setting this value is the same as entering the command on every queue manager in the queue-sharing group.

You cannot use CMDSCOPE as a filter keyword.

DEST( string )
The destination for messages published to this subscription; this parameter is the name of a queue.
DESTCORL( string )
The CorrelId used for messages published to this subscription.

A blank value (default) results in a system generated correlation identifier being used.

If set to ' 000000000000000000000000000000000000000000000000 ' (48 zeros) the CorrelId set by the publishing application will be maintained in the copy of the message delivered to the subscription, unless messages are propagated across a publish/subscribe hierarchy.

Note: It is not possible to set the DESTCORL property programmatically with JMS.
DESTQMGR( string )
The destination queue manager for messages published to this subscription. You must define the channels to the remote queue manager, for example, the XMITQ, and a sender channel. If you do not, messages do not arrive at the destination.
EXPIRY
The time to expiry of the subscription object from the creation date and time.
( integer )
The time to expiry, in tenths of a second, from the creation date and time.
UNLIMITED
There is no expiry time. This is the default option supplied with the product.
PSPROP
The manner in which publish subscribe related message properties are added to messages sent to this subscription.
NONE
Do not add publish subscribe properties to the message.
COMPAT
Publish subscribe properties are added within an MQRFH version 1 header unless the message was published in PCF format.
MSGPROP
Publish subscribe properties are added as message properties.
RFH2
Publish subscribe properties are added within an MQRFH version 2 header.
PUBACCT( string )
Accounting token passed by the subscriber, for propagation into messages published to this subscription in the AccountingToken field of the MQMD.
PUBAPPID( string )
Identity data passed by the subscriber, for propagation into messages published to this subscription in the ApplIdentityData field of the MQMD.
PUBPRTY
The priority of the message sent to this subscription.
ASPUB
Priority of the message sent to this subscription is taken from the priority supplied in the published message.
ASQDEF
Priority of the message sent to this subscription is taken from the default priority of the queue defined as a destination.
(integer)
An integer providing an explicit priority for messages published to this subscription.
REQONLY
Indicates whether the subscriber polls for updates using the MQSUBRQ API call, or whether all publications are delivered to this subscription.
NO
All publications on the topic are delivered to this subscription. This is the default value.
YES
Publications are only delivered to this subscription in response to an MQSUBRQ API call.
This parameter is equivalent to the subscribe option MQSO_PUBLICATIONS_ON_REQUEST.
SUBLEVEL( integer )
The level within the subscription hierarchy at which this subscription is made. The range is zero through 9.
SUBUSER( string )
Specifies the user ID that is used for security checks that are performed to ensure that publications can be put to the destination queue associated with the subscription. This ID is either the user ID associated with the creator of the subscription or, if subscription takeover is permitted, the user ID that last took over the subscription. The length of this parameter must not exceed 12 characters.
USERDATA( string )
Specifies the user data associated with the subscription. The string is a variable length value that can be retrieved by the application on an MQSUB API call and passed in a message sent to this subscription as a message property.
[V8.0.0.7 Jul 2017]From IBM MQ 8.0.0, Fix Pack 7, an IBM MQ classes for JMS application can retrieve the subscription user data from the message by using the constant JMS_IBM_SUBSCRIPTION_USER_DATA in the JmsConstants interface with the method javax.jms.Message.getStringProperty(java.lang.String). For more information, see Retrieval of user subscription data.
VARUSER
Specifies whether a user other than the subscription creator can connect to and take over ownership of the subscription.
ANY
Any user can connect to and takeover ownership of the subscription.
FIXED
Takeover by another USERID is not permitted.