Materialize Queue Messages (MATQMSG)


Op Code (Hex) Operand 1 Operand 2 Operand 3
033B Receiver Queue Message selection template
Operand 1: Space pointer.

Operand 2: System pointer.

Operand 3: Character(16) scalar.

Bound program access

Built-in number for MATQMSG is 45. MATQMSG ( receiver : address queue : address of system pointer message_selection_template : address )

Description

Materialize selected messages on a queue. One or more messages on the queue specified by operand 2 are selected according to information provided in operand 3 and materialized into operand 1. The number of messages materialized and the amount of key and message text data materialized for each message is governed by the message selection template.

Note that the list of messages on a queue is a dynamic attribute and may be changing on a continual basis. The materialization of messages provided by this instruction is just a picture of the status of the queue at the point of interrogation by this instruction. As such, the actual status of the queue may differ from that described in the materialization when subsequent instructions use the information in the template as a basis for operations against the queue.

Operand 1 specifies a space that is to receive the materialized attribute values.

Operand 2 is a system pointer identifying the queue from which the messages are to be materialized.

Operand 3 is a character (16) scalar specifying which messages are to be materialized.

The operand 1 space pointer must address a 16-byte boundary. The materialization template has the following format:

Offset
Dec Hex
Field Name
Data Type and Length
0 0
Materialization size specification
Char(8)
0 0
Number of bytes provided for materialization
Bin(4)
4 4
Number of bytes available for materialization
Bin(4)
8 8
Materialization data
Char(4)
8 8 Count of messages available for materialization Bin(4)
12 C
Queue data
Char(12)
12 C
Count of messages on the queue
Bin(4)
16 10
Maximum message size
Bin(4)
20 14
Key size
Bin(4)
24 18
Reserved
Char(8)
32 20
Message data
[*] Char(*)



(repeated for each message)


32 20
Message attributes
Char(16)
32 20
Message enqueue time
Char(8)
40 28
Message length
Bin(4)
44 2C
Reserved
Char(4)
48 30
Message key
Char(*)
* *
Message text
Char(*)
* *
--- End ---

The first 4 bytes of the materialization identify the total number of bytes provided for use by the instruction. This value is supplied as input to the instruction and is not modified by the instruction. A value of less than 8 causes the materialization length invalid  (hex 3803) exception to be signaled.

The second 4 bytes of the materialization identify the total number of bytes available to be materialized. The instruction materializes as many bytes as can be contained in the area specified as the receiver. If the byte area identified by the receiver is greater than that required to contain the information requested, then the excess bytes are unchanged. No exceptions are signaled in the event that the receiver contains insufficient area for the materialization, other than the materialization length invalid  (hex 3803) exception described previously.

The count of messages available for materialization is the number of messages available to be materialized.

The count of messages on the queue is the current number of messages on the queue.

The maximum message size and key size are values specified when the queue was created. If the queue is not a keyed queue, the value materialized for the key size is zero.

The length of the message key and message text fields is determined by values supplied in operand 3, message selection data. If the length supplied in operand 3 exceeds the actual data length, the remaining space will be padded with binary zeros.

The message selection template identified by operand 3 must be at least 16 bytes and must be on a 16-byte boundary. The format of the message selection template is as follows:

Offset
Dec Hex
Field Name
Data Type and Length
0 0
Message selection
Char(2)
0 0
Type
Bits 0-3



0001 = All messages
0010 = First
0100 = Last
1000 = Keyed

All other values are reserved



0 0
Key relationship (if needed)
Bits 4-7



0010 = Greater than
0100 = Less than
0110 = Not equal
1000 = Equal
1010 = Greater than or equal
1100 = Less than or equal

All other values are reserved



0 0
Reserved
Bits 8-15
2 2
Lengths
Char(8)
2 2
Number of key bytes to materialize
Bin(4)
6 6
Number of message text bytes to materialize
Bin(4)
10 A Materialize options Char(1)
10 A Enqueue and dequeue mode Bit 0
0 = Blocked mode
1 = Concurrent mode



10 A Reserved Bits 1-7
11 B Reserved Char(5)
16 10
Key (if needed)
Char(*)
* *
--- End ---

The message selection type must not specify keyed if the queue was not created as a keyed queue.

Both of the fields specified under lengths must be zero or an integer multiple of 16. The maximum value allowed for the key length is 256. The maximum value allowed for the message text is 65,536.

The enqueue and dequeue mode field indicates whether or not MATQMSG blocks out all other activity to the queue during the materialize. If a value of binary 0 is specified, MATQMSG blocks out all other activity to the queue during the materialize. If a value of binary 1 is specified, MATQMSG allows concurrent enqueue (ENQ instruction) and dequeue (DEQ instruction) activity to the queue during the materialize.

In the following cases, the value specified for enqueue and dequeue mode is ignored and activity to the queue is blocked during the materialize:

Usage Note

On all current and foreseen implementations of the machine, concurrent mode includes overhead which may slow the materialize down. However, concurrent dequeues from the same queue by other threads during a long-running materialize could see a performance gain. Therefore, concurrent mode is recommended when it is necessary to maintain dequeue performance during potentially long running materialize operations.

Authorization Required

Lock Enforcement

Exceptions

06 Addressing

08 Argument/Parameter

0A Authorization

10 Damage Encountered

1A Lock State

20 Machine Support

22 Object Access

24 Pointer Specification

2E Resource Control Limit

32 Scalar Specification

36 Space Management

38 Template Specification

44 Protection Violation