AFFINITY keyword option
A shared queue message may have an affinity that indicates that a specific IMS must process it. Use the AFFINITY keyword with the SELECT and REJECT subcommands to select or reject messages with a specific affinity. Consider the following when specifying the AFFINITY keyword:
- For a non-XRF system, the affinity is the IMSID. For an XRF system, the affinity is the first seven characters of the RSENAME.
- The AFFINITY keyword allows a seven-character affinity mask. If you specify a mask, Message Advisor only returns destinations with an affinity that matches the mask. Message Advisor does NOT return destinations without an affinity (i.e., Message Advisor treats AFFINITY=* the same as it treats AFFINITY=?*).
- The following special values are allowed for the AFFINITY keyword:
- &EXISTS matches only destinations with affinity to the current IMS and which CAN be created on the current IMS. &EXISTS is not allowed on SELECT or REJECT subcommands with the REQUEUE command.
- &IMS matches only destinations with affinity for the current IMS. &IMS is not allowed on SELECT or REJECT subcommands with the REQUEUE EXTRACT command.
- &NONE matches only destinations with no affinity. You can also specify AFFINITY=' ' to return only destinations with no affinity.
&ORPHAN matches only destinations with affinity to the current IMS and which CANNOT be created on the current IMS. &ORPHAN is not allowed on SELECT or REJECT subcommands with the REQUEUE command.
- You can specify a list of affinities for the AFFINITY keyword value. The list can include the special values. For example, AFFINITY=(&NONE,IMSA) returns only destinations with no affinity or with affinity to IMSA.
- If you do not specify the AFFINITY keyword, Message Advisor returns all destinations which otherwise match, with or without an affinity.
- Local queue destinations (on non-shared queues systems or on shared queues systems) are considered to have no affinity and will only match a blank or a SELECT subcommand without an affinity.
- AFFINITY is a message-related keyword when used on a SELECT or REJECT subcommand with the REQUEUE command, but is a destination-related keyword for all other commands.
- If you specify &EXISTS or &ORPHAN, processing occurs as follows:
- Message Advisor performs a FNDEST CREATE for destinations that it finds on the shared queues with an affinity for the current IMS.
- If Message Advisor cannot find or create the destination, the destination matches &ORPHAN.
- If Message Advisor finds or creates the destination but the destination is not of the correct type for that queue, the destination matches &ORPHAN.
- For queue 7 and queue 9, the destination will also match &ORPHAN if the shared queues token does not match the IMS token.
- Destinations that exist or that Message Advisor can create as the correct type match &EXISTS.
The intent of the above processing is to allow finding messages on the shared queues which can no longer be processed, and are thus 'orphaned.'
Related topic