Copy MQ Subscription (CPYMQMSUB)
- Where allowed to run
- All environments (*ALL)
- Threadsafe
- Yes
The Copy MQ Subscription (CPYMQMSUB) command creates an MQ subscription of the same type and, for attributes not specified in the command, with the same attribute values as an existing subscription.
Parameters
Keyword | Description | Choices | Notes |
---|---|---|---|
FROMSUBID | From subscription identifier | Character value, *SAME | Optional, Key, Positional 3 |
FROMSUB | From subscription | Character value, *SAME | Optional, Key, Positional 2 |
TOSUB | To subscription | Character value | Required, Key, Positional 1 |
MQMNAME | Message Queue Manager name | Character value, *DFT | Optional, Key, Positional 4 |
REPLACE | Replace | *NO, *YES | Optional, Positional 5 |
TOPICSTR | Topic string | Character value, *NONE, *SAME | Optional, Positional 6 |
TOPICOBJ | Topic object | Character value, *NONE, *SAME | Optional, Positional 7 |
DEST | Destination | Character value, *NONE, *SAME | Optional, Positional 8 |
DESTMQM | Destination Queue Manager | Character value, *NONE, *SAME | Optional, Positional 9 |
DESTCRRLID | Destination Correlation Id | Character value, *NONE, *SAME | Optional, Positional 10 |
PUBACCT | Publish Accounting Token | Character value, *NONE, *SAME | Optional, Positional 11 |
PUBAPPID | Publish Application Id | Character value, *NONE, *SAME | Optional, Positional 12 |
SUBUSER | Subscription User Id | Character value, *CURRENT, *SAME | Optional, Positional 13 |
USERDATA | Subscription User Data | Character value, *NONE, *SAME | Optional, Positional 14 |
SELECTOR | Selector String | Character value, *NONE, *SAME | Optional, Positional 15 |
PSPROP | PubSub Property | *SAME, *NONE, *COMPAT, *RFH2, *MSGPROP | Optional, Positional 16 |
DESTCLASS | Destination Class | *SAME, *MANAGED, *PROVIDED | Optional, Positional 17 |
SUBSCOPE | Subscription Scope | *SAME, *ALL, *QMGR | Optional, Positional 18 |
VARUSER | Variable User | *SAME, *ANY, *FIXED | Optional, Positional 19 |
REQONLY | Request Publications | *SAME, *YES, *NO | Optional, Positional 20 |
PUBPTY | Publish Priority | 0-9, *SAME, *ASPUB, *ASQDEF | Optional, Positional 21 |
WSCHEMA | Wildcard Schema | *SAME, *CHAR, *TOPIC | Optional, Positional 22 |
EXPIRY | Expiry Time | 0-999999999, *SAME, *UNLIMITED | Optional, Positional 23 |
From subscription identifier (FROMSUBID)
Specifies the subscription identifier of the existing subscription to provide values for the attributes not specified in this command.
The possible values are:
- from-subscription-identifier
- Specify the 48 character hexadecimal string representing the 24 byte subscription identifier.
From subscription (FROMSUB)
Specifies the name of the existing subscription to provide values for the attributes not specified in this command.
The possible values are:
- from-subscription-name
- Specify a maximum of 256 bytes for the subscription name.
Note: Subscription names of greater than 256 bytes can be specified using MQSC.
To subscription (TOSUB)
The name of the new subscription to be created.
Note: Subscription names of greater than 256 bytes can be specified using MQSC.
If a subscription with this name already exists, REPLACE(*YES) must be specified.
The possible values are:
- to-subscription-name
- Specify a maximum of 256 bytes for name of the MQ subscription being created.
Note: Subscription names of greater than 256 bytes can be specified using MQSC.
Message Queue Manager name (MQMNAME)
Specifies the name of the Queue Manager.
The possible values are:
- *DFT
- Use the default Queue Manager.
- queue-manager-name
- The name of a Queue Manager.
Replace (REPLACE)
Specifies whether the new subscription should replace an existing subscription with the same name.
The possible values are:
- *NO
- This subscription does not replace any existing subscription with the same name or subscription identifier. The command fails if the subscription already exists.
- *YES
- Replace the existing subscription. If there is no subscription with the same name or subscription identifier, a new subscription is created.
Topic string (TOPICSTR)
Specifies the topic string associated with this subscription.
The possible values are:
- topic-string
- Specify a maximum of 256 bytes for the topic string.
Note: Topic strings of greater than 256 bytes can be specified using MQSC.
Topic object (TOPICOBJ)
Specifies the topic object associated with this subscription.
The possible values are:
- *SAME
- The attribute is unchanged.
- topic-object
- Specify the name of the topic object.
Destination (DEST)
Specifies the destination queue for messages published to this subscription.
The possible values are:
- *SAME
- The attribute is unchanged.
- destination-queue
- Specify the name of the destination queue.
Destination Queue Manager (DESTMQM)
Specifies the destination queue manager for messages published to this subscription.
The possible values are:
- *SAME
- The attribute is unchanged.
- *NONE
- No destination queue manager is specified.
- destination-queue
- Specify the name of the destination queue manager.
Destination Correlation Id (DESTCRRLID)
Specifies the correlation identifier for messages published to this subscription.
The possible values are:
- *SAME
- The attribute is unchanged.
- *NONE
- Messages are placed on the destination with a correlation identifier of MQCI_NONE.
- correlation-identifier
- Specify the 48 character hexadecimal string representing the 24 byte correlation identifier.
Publish Accounting Token (PUBACCT)
Specifies the accounting token for messages published to this subscription.
The possible values are:
- *SAME
- The attribute is unchanged.
- *NONE
- Messages are placed on the destination with an accounting token of MQACT_NONE.
- publish-accounting-token
- Specify the 64 character hexadecimal string representing the 32 byte publish accounting token.
Publish Application Id (PUBAPPID)
Specifies the publish application identity for messages published to this subscription.
The possible values are:
- *SAME
- The attribute is unchanged.
- *NONE
- No publish application identifier is specified.
- publish-application-identifier
- Specify the publish application identifier.
Subscription User Id (SUBUSER)
Specifies the user profile that owns this subscription.
The possible values are:
- *SAME
- The attribute is unchanged.
- *CURRENT
- The current user profile is the owner of the new subscription.
- user-profile
- Specify the user profile.
Subscription User Data (USERDATA)
Specifies the user data associated with the subscription.
The possible values are:
- *SAME
- The attribute is unchanged.
- *NONE
- No user data is specified.
- user-data
- Specify a maximum of 256 bytes for user data.
Note: User data of greater than 256 bytes can be specified using MQSC.
Selector String (SELECTOR)
Specifies the SQL 92 selector string to be applied to messages published on the named topic to select whether they are eligible for this subscription.
The possible values are:
- *SAME
- The attribute is unchanged.
- *NONE
- No selection string is specified.
- selection-string
- Specify a maximum of 256 bytes for selection string.
Note: Selection strings of greater than 256 bytes can be specified using MQSC.
PubSub Property (PSPROP)
Specifies the manner in which publish / subscribe related message properties are added to messages sent to this subscription.
The possible values are:
- *SAME
- The attribute is unchanged.
- *NONE
- Publish / subscribe properties are not added to the message.
- *COMPAT
- Publish / subscribe properties are added to the message to maintain compatibility with IBM MQ V6.0 Publish / Subscribe.
- *RFH2
- Publish / subscribe properties are added to the message within an RFH Version 2 header.
- *MSGPROP
- Publish / subscribe properties are added as message properties.
Destination Class (DESTCLASS)
Specifies whether this is a managed subscription.
The possible values are:
- *SAME
- The attribute is unchanged.
- *MANAGED
- The destination is managed.
- *PROVIDED
- The destination is a queue.
Subscription Scope (SUBSCOPE)
Specifies whether this subscription should be forwarded (as a proxy subscription) to other brokers, so that the subscriber will receive messages published at those other brokers.
The possible values are:
- *SAME
- The attribute is unchanged.
- *ALL
- The subscription will be forwarded to all queue managers directly connected via a publish / subscribe collective or hierarchy.
- *QMGR
- The subscription will only forward messages published on the topic within this queue manager.
Variable User (VARUSER)
Specifies whether user profiles other than the creator of the subscription can connect to it (subject to topic and destination authority checks).
The possible values are:
- *SAME
- The attribute is unchanged.
- *ANY
- Any user profiles can connect to the subscription.
- *FIXED
- Only the user profile that created the subscription can connect to it.
Request Publications (REQONLY)
Specifies whether the subscriber will poll for updates via MQSUBRQ API, or whether all publications are delivered to this subscription.
The possible values are:
- *SAME
- The attribute is unchanged.
- *YES
- Publications are only delivered to this subscription in response to an MQSUBRQ API.
- *NO
- All publications on the topic are delivered to this subscription.
Publish Priority (PUBPTY)
Specifies the priority of the message sent to this subscription.
The possible values are:
- *SAME
- The attribute is unchanged.
- *ASPUB
- The priority of the message sent to this subscription is taken from that supplied in the published message.
- *ASQDEF
- The priority of the message sent to this subscription is taken from the default priority of the queue defined as the destination.
- priority-value
- Specify a priority ranging from 0 through 9.
Wildcard Schema (WSCHEMA)
Specifies the schema to be used when interpreting wildcard characters in the topic string.
The possible values are:
- *SAME
- The attribute is unchanged.
- *TOPIC
- Wildcard characters represent portions of the topic hierarchy.
- *CHAR
- Wildcard characters represent portions of strings.
Expiry Time (EXPIRY)
Specifies the expiry time of the subscription. After a subscription's expiry time has elapsed, it becomes eligible to be discarded by the queue manager and will receive no further publications.
The possible values are:
- *SAME
- The attribute is unchanged.
- *UNLIMITED
- The subscription does not expire.
- expiry-time
- Specify an expiry time in tenths of a second ranging from 0 through 999999999.
Examples
None
Error messages
Unknown