MYQ MY QUEUE TAASPCT |
The MY Q tool is a series of commands that lets you send and receive
entries to a simple queue. This allows one program to place the
entries on the queue and a second (or the same) program to receive
them in a loop or by an entry number. Entries are 2000 bytes in
length. The queue is a *USRSPC object that can contain up to 8,000
entries. All commands default the name of the queue to MYQ in QTEMP.
A specific queue and library may be named.
A typical series of commands in the first program would be:
DCL &ENTRY *CHAR LEN(.. up to 2000 ..)
.
CRTMYQ /* Creates a *USRSPC to hold 1000 entries */
.
LOOP: /* Your code to build &ENTRY */
SNDMYQ ENTRY(&ENTRY)
/* Your code to test whether to loop back */
GOTO LOOP
The second (or same) program would also have a loop:
DCL &ENTRY *CHAR LEN(2000)
.
LOOP: RCVMYQ RTNENTRY(&ENTRY)
MONMSG MSGID(TAA9893) EXEC(DO) /* No more entries */
GOTO ENDPGM
ENDDO /* No more entries */
/* Your processing of an entry */
/* Your code to test whether to loop back */
GOTO LOOP
The DSPMYQ command will display or print a listing of the entries.
The first 100 bytes of each entry are listed. DSPMYQ may be used to
assist in testing.
The TAA DSPUSRSPC command may also be used to assist in testing.
MYQ Commands
------------
CRTMYQ Creates a queue (*USRSPC object)
SNDMYQ Sends an entry to the queue
RCVMYQ Receives an entry from the queue
RTVMYQA Retrieves the attributes of a queue
DLTMYQ Deletes a queue
CLRMYQ Clears a queue
DSPMYQ Displays or prints the first of all 100 bytes
of all entries
Layout of user space
--------------------
1 - 10 **CRTMYQ**
12 - 20 Position of next entry for SND
21 - 30 Position of entry for RCV *NEXT or *PRV
101 - 2100 First entry
2101 - 4100 Second entry
. .
RCVMYQ escape messages you can monitor for
------------------------------------------
TAA9893 No more entries exist.
TAA9894 ENTNBR(*LAST), but no entries exist
Escape messages from based on functions will be re-sent from RCVMYQ
and the other commands.
CRTMYQ Command parameters *CMD
-------------------------
MYQ The qualified name of the queue. MYQ is the default
in library QTEMP. A specific name or library may
also be used. *CURLIB may be used for the library
name.
MAXENT The maximum number of entries. 1,000 is the minimum
and the default. 8,000 is the maximum. Each entry
is 2000 bytes in length.
SNDMYQ Command parameters *CMD
-------------------------
ENTRY The entry to be sent. Up to 2000 bytes may be
entered. A data structure may be used.
MYQ The qualified name of the queue. The queue must
have been created by CRTMYQ. MYQ is the default in
library QTEMP. A specific name or library may also
be used. *LIBL or *CURLIB may be used for the
library name.
RCVMYQ Command parameters *CMD
-------------------------
ENTNBR The entry number to be retrieved. *NEXT is the
default meaning the next entry based on the last
request by RCVMYQ. If there has been no previous
request, the first entry is returned.
A specific number may be entered for a specific
entry.
*FIRST may be entered for the first entry.
*LAST may be entered for the last entry. Using
*LAST causes the cursor to move. If you follow
*LAST with *NEXT, there will be no more entries and
an error will occur.
RTNENTRY The return entry. A data structure may be used.
This is an optional return variable that if used
must be specified as *CHAR LEN(2000).
RTNENTNBR The return entry number. As entries are added to
the queue by SNDMYQ, each is assigned a consecutive
number. The number may be used to retrieve a
specific entry. This is an optional return variable
that if used must be specified as *DEC LEN(5 0).
MYQ The qualified name of the queue. The queue must
have been created by CRTMYQ. MYQ is the default in
library QTEMP. A specific name or library may also
be used. *LIBL or *CURLIB may be used for the
library name.
RTVMYQA Command parameters *CMD
--------------------------
NBRENTRY The total number of entries that have been sent to
the queue by SNDMYQ. This is an optional return
variable that if used must be specified as *DEC
LEN(5 0).
SIZE The size of the queue (*USRSPC object). This is an
optional return variable that if used must be
specified as *DEC LEN(9 0).
MYQ The qualified name of the queue. The queue must
have been created by CRTMYQ. MYQ is the default in
library QTEMP. A specific name or library may also
be used. *LIBL or *CURLIB may be used for the
library name.
DLTMYQ Command parameters *CMD
-------------------------
MYQ The qualified name of the queue. The queue must
have been created by CRTMYQ. MYQ is the default in
library QTEMP. A specific name or library may also
be used. *LIBL or *CURLIB may be used for the
library name.
CLRMYQ Command parameters *CMD
-------------------------
MYQ The qualified name of the queue. The queue must
have been created by CRTMYQ. MYQ is the default in
library QTEMP. A specific name or library may also
be used. *LIBL or *CURLIB may be used for the
library name.
DSPMYQ Command parameters *CMD
-------------------------
MYQ The qualified name of the queue. The queue must
have been created by CRTMYQ. MYQ is the default in
library QTEMP. A specific name or library may also
be used. *LIBL or *CURLIB may be used for the
library name.
OUTPUT How to output the results. * is the default to
display the spooled file if the command is entered
interactively. The spooled file is deleted after it
is displayed.
If the command is entered in batch or *PRINT is
specified, the spooled file is output and retained.
Restrictions
------------
None.
Prerequisites
-------------
The following TAA Tools must be on your system:
CHGUSRSPC Change user space
CLRUSRSPC Clear user space
CRTUSRSPC Create user space
EDTVAR Edit variable
RTVSYSVAL3 Retrieve system value 3
RTVUSRSPC Retrieve user space
RTVUSRSPCA Retrieve user space attributes
SNDCOMPMSG Send completion message
SNDESCINF Send escape information
SNDESCMSG Send escape message
Implementation
--------------
None, the tool is ready to use.
Objects used by the tool
------------------------
Object Type Attribute Src member Src file
------ ---- --------- ---------- ----------
CRTMYQ *CMD TAASPCT QATTCMD
SNDMYQ *CMD TAASPCT2 QATTCMD
RCVMYQ *CMD TAASPCT3 QATTCMD
RTVMYQA *CMD TAASPCT4 QATTCMD
DLTMYQ *CMD TAASPCT5 QATTCMD
CLRMYQ *CMD TAASPCT6 QATTCMD
DSPMYQ *CMD TAASPCT7 QATTCMD
TAASPCTC *PGM CLP TAASPCTC QATTCL
TAASPCTC2 *PGM CLP TAASPCTC2 QATTCL
TAASPCTC3 *PGM CLP TAASPCTC3 QATTCL
TAASPCTC4 *PGM CLP TAASPCTC4 QATTCL
TAASPCTC5 *PGM CLP TAASPCTC5 QATTCL
TAASPCTC6 *PGM CLP TAASPCTC6 QATTCL
TAASPCTC7 *PGM CLP TAASPCTC7 QATTCL
TAASPCTR7 *PGM RPG TAASPCTR7 QATTRPG
Structure
---------
CRTMYQ Cmd
TAASPCTC CL pgm
SNDMYQ Cmd
TAASPCTC2 CL pgm
RCVMYQ Cmd
TAASPCTC3 CL pgm
RTVMYQA Cmd
TAASPCTC4 CL pgm
DLTMYQ Cmd
TAASPCTC5 CL pgm
CLRMYQ Cmd
TAASPCTC6 CL pgm
DSPMYQ Cmd
TAASPCTC7 CL pgm
TAASPCTR7 RPG pgm
|
Added to TAA Productivity tools May 15, 2008