TAA Tools
RMVMSGQMSG      REMOVE MESSAGE QUEUE MESSAGES          TAAMSIB

The Remove  Message Queue  Messages command  removes selected  messages
from a  message queue.  The  intent is to provide  a 'cleanup facility'
for  message queues such as QSYSOPR.   Different selection criteria can
be used.

If  too  many messages  exist  for  the  use  of  RMVMSGQMSG,  see  the
DLTMSGQMSG tool.

The API  QGYOLMSG is used  by the sub  tool CVTMSGQ2.  This  API states
that new  messages cannot be added or removed  while the API is in use.
In a test, an  error did not occur when  messages were added while  the
API was being used.  You may experience a different result.

A typical command would be:

             RMVMSGQMSG    MSGQ(QSYSOPR) SELECT(*NOTNEEDRPY)
                             ENDDAT(*TODAY) ENDTIM(100000)

All messages would be removed that meet the criteria:

  **   *NOTNEEDRPY  prevents removing  any Inquiry  messages that  have
       not been replied to.

  **   The End  Date and Time identify when  to stop removing messages.
       In the example, no messages  would be removed after 10:00:00  on
       the current  day.   Any  messages prior  to this  date and  time
       would be considered for removal.

Not  used on  the sample  command is  the ability  to  clear a  list of
specific message IDs.

RMVMSGQMSG escape messages you can monitor for
----------------------------------------------

      TAA9893    An *EXCL lock cannot be obtained.

Escape messages from based on functions will be re-sent.

RMVMSGQMSG Command parameters                        *CMD
-----------------------------

   MSGQ          The  qualified  name of  the  message queue  to remove
                 messages from.   The library value defaults  to *LIBL.
                 *CURLIB may also be used.

   SELECT        The message  selection to  be performed.   The default
                 is   *NOTNEEDRPY  to  prevent   removing  any  Inquiry
                 messages that need a reply.

                 *ALL may be specified to remove all types.

   ENDDAT        The end date to identify  the last date for a  message
                 to be  removed.  The  ENDDAT and ENDTIM  identify when
                 to  stop removing  messages.   Any messages  that were
                 sent  prior  to  this  time  will  be  considered  for
                 removal.

                 The default is *PRVDAY meaning the previous day.

                 *TODAY may be specified to mean the current date.

                 A specific date in job format may be entered.

   ENDTIM        The end time to  identify the last time for  a message
                 to  be removed.   The  default is  *LAST.   A specific
                 time may be entered in HHMMSS format.

   MSGID         A  list  of  up  to  40  specific  message  IDs  to be
                 removed.  The default is *ALL.


Restrictions
------------

None.

Prerequisites
-------------

The following TAA Tools must be on your system:

     ADDDAT2         Add date 2
     CHKOBJ3         Check object 3
     CVTMSGQ2        Convert message queue 2
     EDTVAR          Edit variable
     EXTLST2         Extract list 2
     SNDCOMPMSG      Send completion message
     SNDJLGMSG       Send job log message
     SNDSTSMSG       Send status message

Implementation
--------------

None, the tool is ready to use.

Objects used by the tool
------------------------

   Object        Type    Attribute      Src member    Src file
   ------        ----    ---------      ----------    ----------

   RMVMSGQMSG    *CMD                   TAAMSIB       QATTCMD
   TAAMSIBC      *PGM       CLP         TAAMSIBC      QATTCL
					

Added to TAA Productivity tools August 15, 2001


Home Page Up to Top