You can display the number of messages in STOQs by using the WQ command or the STOQ_WQ library procedure.
Using the WQ (Display STOQ Count) Command in MARC
The WQ command has the following forms:
|
Form |
Function |
|---|---|
|
WQ <queue name> |
Displays the message count for the STOQ with the specified queue name. |
|
WQ = |
Displays the message counts for all STOQs currently in memory. |
The following is an example WQ command:
WQ MSGQA
The following response indicates that there are seven messages waiting in MSGQA:
MSGQA 7
The following response indicates that there no messages waiting in MSGQA, but a program has issued a receive request for that STOQ and is waiting for a message to arrive.
MSGQA 0 (WTG)
Using the STOQ_WQ Library Procedure
The following are the ALGOL declarations for the STOQ_WQ library procedure:
LIBRARY EVASUPPORT (LIBACCESS = BYFUNCTION,
FUNCTIONNAME = “EVASUPPORT.”);
PROCEDURE STOQ_WQ(WQDATA);
EBCDIC ARRAY WQDATA[0];
LIBRARY EVASUPPORT;The parameter WQDATA serves the following two purposes:
-
The user program initializes this array with the STOQ name or an equal sign (=).
-
The system returns the response to the STOQ_WQ action in this same array.
The parameter WQDATA serves two purposes. The user program should initialize this array with a six-byte queue name or an equal sign (=). The system also returns the response to the STOQ_WQ action in this array. The response consists of one or more entries that have the following format:
|
Length |
Content |
|---|---|
|
6 bytes |
The STOQ name |
|
3 bytes |
The number of messages that were in the queue. This is a six-digit number stored in packed decimal form. |
|
3 bytes |
The number of user programs that are waiting on this STOQ. This is a six-digit number stored in packed decimal form. |
|
1 byte |
For the process associated with the following mix number, specifies the STOQ operation the process is waiting on. A value of 0 indicates a send operation, and a value of 1 indicates a receive operation. |
|
5 bytes |
The mix number of a process waiting on this STOQ. |
The last two fields are repeated for each process that is waiting on this STOQ. Then the overall format is repeated for the next STOQ, if any. The final entry is followed by a null character (48”00”).

