ALTER SUB

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


Use MQSC commands

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

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

We can issue this command from sources CR. For an explanation of the source symbols, see Sources from which we can issue MQSC commands on z/OS .

Synonym: ALT SUB


ALTER SUB

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 forms are valid for the command:
    ALT SUB(xyz)
    ALT SUB SUBID(123)
    ALT SUB(xyz) SUBID(123)
    
  2. Although permitted on the DEFINE command, we cannot alter the following fields using ALTER SUB:

    • TOPICOBJ
    • TOPICSTR
    • WSCHEMA
    • SELECTOR
    • SUBSCOPE
    • DESTCLAS
    • SUBLEVEL

  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. 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: IBM 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.

    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.

      ' '
      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.

      We can specify a queue manager name, other than the queue manager on which the command was entered, only if we 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 setting this value is the same as entering the command on every queue manager in the queue sharing group.

    We 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.

    If this byte string is enclosed in quotation marks, characters in the range A-F must be specified in uppercase.

    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. We must define the channels to the remote queue manager, for example, the XMITQ, and a sender channel. If we 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.

    If this byte string is enclosed in quotation marks, characters in the range A-F must be specified in uppercase.

    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.

      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.

    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. The USERDATA is stored in the RFH2 header in the mqps folder with the key Sud.
    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. 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.

Parent topic: MQSC commands


Related information