QPOSITION keyword and relative position


The relative position that is selected when you specify the QPOSITION keyword depends on the type of queue, as follows:

  • For non-shared queues, the relative position selected depends on whether you specify the QUEUE keyword on the same SELect or REJect subcommand that includes the QPOSITION keyword. If you do not specify the QUEUE keyword or if you specify QUEUE=ALL, the position is relative to all messages for the destination (regardless of the queue). If you specify any other value for the QUEUE keyword, the position is relative to the beginning of each queue. For example, if a destination has two messages on queue 1 and ten messages on queue 3, then 'QUEUE=3,QPOSITION=6' refers to the sixth message on queue 3. 'QUEUE=ALL,QPOSITION=6' refers to the fourth message on queue 3 (the sixth message overall). For transactions, Message Advisor assumes that suspend queue messages follow all other messages.
  • For shared client queues the position is relative to a specific key and queue type. If a destination has messages on different queue types (for example, the transaction ready queue and the transaction suspend queue), there will be more than one message in each position. You should specify the QTYPE keyword unless you want to process both queues.
  • For shared private queues, the position is relative to each queue type, regardless of key. Since the position of the messages is random, private queue messages should not normally be selected by position. The QPOSITION keyword is not allowed with shared private queues if you also specify the KEY keyword, and QPOSITION=LAST is never allowed for private queues.


Parameter

Description

nn

selects or rejects messages for a specific position on a queue

Warning

Note

nn is a value that you specify.

(nn,nn)

selects or rejects messages for a range of positions on a queue

Warning

Note

nn,nn is a value that you specify.

FIRST

when specified in the first position, indicates the first message on the queue

LAST

when specified in the second position, indicates the last message on the queue

Warning

Note

You can use * as an alias for LAST.

Because queues are not static, it is possible (but not likely) for more than one message to match if you specify QPOSITION=LAST. If a new message is added to the end of a queue while the last message is being processed, both may match as the last message. If the last message is dequeued while the penultimate message is being scanned, there may be no match.




 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*

Message Advisor for IMS 1.7