TAA Tools
BRKMSGQN       BREAK MSGQ N TIMES AT MULT WORKSTATIONS     TAAMSGF

The  Break Message  Queue  N  times  at multiple  workstation  function
allows  multiple users to  be aware of  the messages that  have arrived
at  a specified message  queue.  For example,  in some environments you
may want multiple  users to  monitor and respond  to the messages  that
arrive at QSYSOPR or QSYSMSG.

Whether a  message queue is  in break mode  or not, multiple  users can
do  DSPMSG and respond  to messages on  the same queue.   This operates
on a  'first  come/only served'  basis.   If  a  2nd user  attempts  to
answer the same  message, the system provides an  error message stating
that the  message queue has changed.  If F10  is pressed, the reply can
be seen.

When a message  queue is in  break mode, only  the user who  has it  in
break mode can delete messages.

The system  does  not directly  support a  solution  to allow  multiple
users  to  be  put  into  *BREAK  mode  for  the  same  message  queue.
However,  it is possible  to achieve this  with the technique described
with this tool.

The following shows a picture of the concept:

         Message is
          sent to
             .
             .
             V
        ************                       ************
        *          *                       *          *
        *  QUEUE1  *                  . . >*  QUEUE2  *
        *          *                  .    *          *
        ************         WAKEUP   .    ************
       Break handling         msg     .    Break handling
       pgm sends msg  . . . . . . . . .    pgm displays QUEUE1
         and then
       displays QUEUE1


         Shared MSGQ                      Attention MSGQ

The following must be done:

  **   The  MSGQ to  be  shown  on multiple  workstations  (termed  the
       'Shared message queue')  must be set into break  mode and have a
       break  handling  program specified.   Sample  code  is provided,
       but a minor modification is needed.

  **   One or more message  queues (termed 'Attention message  queues')
       must exist  and be  in break mode  to accept  a message  sent by
       the  break handling program  of the  Shared message queue.   You
       may use a  normal workstation  message queue  for the  Attention
       message  queue,  but  a simple  approach  is  to  create  unique
       message  queues  for  each user  who  wants  to be  interrupted.
       These  message  queues  must  use  the  standard  break handling
       program provided.

       The same  Attention message  queue can  be  used to  send to  by
       multiple  Shared message queues.   For  example, you  might want
       to  have QSYSOPR and  some other message queue  as Shared queues
       where  either   queue   could   cause  a   break   on   multiple
       workstations.

The  TAAMSGFC program  is the  break  handling program  for the  Shared
message  queue.   The  source  must  be modified  as  described  in the
implementation instructions.    When  a  message  is  received  at  the
Shared  message  queue,  the  break  handling  program  will  send  the
special WAKEUP  message to the Attention message  queue(s) and then use
DSPMSG on the Shared message queue.

The  TAAMSGFC2 program is the break  handling program for the Attention
message queues.   It  is a  standard program and  does not  need to  be
modified.  When  a message is received at  the Attention message queue,
the  break handling program will check for  the special message text of
'WAKEUP'.  If  it is not  this text, the  Attention message queue  will
be displayed.  If  the WAKEUP message is read,  the program removes the
message and displays the Shared message queue.

The  TAAMSGFC2 program  reads all  of  the new  messages in  it's queue
every time a  message is received.   It then causes  either or both  of
the  Attention  message  queue  or  the  Shared  message  queue  to  be
displayed.

This allows for  the case where the user who is  assigned to one of the
Attention  message queues signs on  after several messages have already
been sent.   When  he places  the  Attention message  queue into  break
mode, the break  handling program is given control.   The program would
receive  all  of  the  messages  and  would  perform  a single  display
regardless of how many  messages existed.   All of the WAKEUP  messages
are removed each time  the break handling program is  made active.  The
non-WAKEUP  messages are left in  the queue under control  of the user.

See the later discussion for alternatives.

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

Only the  user who  has the  shared  message queue  in break  mode  can
delete messages from the queue.

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

The following TAA Tools must be on your system:

      STACK      Stack function

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

The  TAAMSGFC2  program  already  exists  and  does   not  need  to  be
modified.

The  source  for the  break  handling program  for  the Shared  message
queue  is in  member TAAMSGFC  in the file  QATTCL in  the TAA Archive.
Use CPYTAA  to copy  the source  from the  archive to  your own  member
(any  name may  be  used).   Modify  the source  (as  described in  the
source)  to send the WAKEUP message  to the Attention message queue(s).
Create the  program  with  the CRTCLPGM  command.   Any  name  for  the
program and any library may be used.

To  set  the  Shared  message  queue   into  break  mode,  specify  the
following and name the program you just created:

     CHGMSGQ    MSGQ(xxxx)  DLVRY(*BREAK) PGM(llll/pppp)

To  set the  Attention message  queue(s) into  break mode,  specify the
following:

     CHGMSGQ    MSGQ(yyyy)  DLVRY(*BREAK) PGM(TAATOOL/TAAMSGFC2)

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

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

                               CLP         TAAMSGFC       QATTCL
   TAAMSGFC2     *PGM          CLP         TAAMSGFC2      QATTCL

The TAAMSGFC program is not in object  form in TAATOOL.  You must  copy
the source, make changes,  and create the program in  your own library.

Alternatives
------------

It  is  possible to  filter  the  messages so  that  not every  message
causes  a wakeup  of the  Attention message  queues.  For  example, the
RCVMSG command  is  already specified  to return  the  values for  SEV,
RTNTYPE (the message  type) and MSGID.  These can  be used to determine
if  the  WAKEUP message  should  be sent.    For a  description  of the
RTNTYPE codes,  see the  help text  associated with  this parameter  on
RCVMSG.

For example,  you may only  want to  notify an Attention  Message queue
that  an inquiry type message  (RTNTYPE = '05') has  been received.  It
would also  be  possible to  use  a  status message  at  the  Attention
message queues instead  of using DSPMSG.   For example, you  might want
to  send the status  message to  include the  message text of  the last
message  that caused the WAKEUP  message to be sent.   This would allow
the user at the other  device to continue his processing (he  would not
be interrupted),  but could still determine  if there was a  reason for
him to display the details of the Shared message queue.
					

Added to TAA Productivity tools April 1, 1995


Home Page Up to Top