The Status Message tool provides a solution for turning certain
message IDs sent to a message queue into status messages.
To invoke the function for your *USRPRF message queue, specify within
your job:
STRSTSMSG MSGQ(*USRPRF)
By default, the following messages will be sent as status messages:
CPF1240 Batch job ended normally
CPF1241 Batch job ended abnormally
TAA9851 TAA Tool message (see later discussion)
The status messages are not removed from the queue.
It is possible that you will not see or notice a status message. For
example, two messages may arrive almost simultaneously or you are
switching to a Group job.
DSPMSG is still a useful function to review the messages and to
remove messages. The advantage of the STSMSG tool is that you will
probably see most of the messages without being interrupted.
The default for STRSTSMSG is to use the *USRPRF message queue. This
is the default message queue assigned for SBMJOB so that the CPF1240
and CPF1241 messages produced by the batch job will be handled as
status messages.
You can also set the *WRKSTN message queue or any message queue on
the MSGQ parameter.
Message Handling Review
-----------------------
When a message is sent to your message queue, you normally have two
choices to deal with the message:
** Use *BREAK mode and interrupt your job.
** Use *HOLD or *NOTIFY mode and continually check the message
queue to determine what messages exist.
If you are busy keying, neither of these choices is ideal. If you
are programming and normally submit many batch jobs, the
interruptions can degrade productivity. If the message queue is in
break mode, you can lose keystrokes when a message arrives.
It is possible to turn the received messages into status messages.
This provides you with the important information without interrupting
your work flow. A break handling program is needed. The STRSTSMSG
command sets your workstation message queue to a standard break
handling program.
Default use of STRSTSMSG
------------------------
If no STSMSG data area exists, defaults are used when you specify
STRSTSMSG.
The following messages will be turned into status messages:
CPF1240 Batch job ended normally
CPF1241 Batch job ended abnormally
TAA9851 TAA Tool message (see later discussion)
Another message (TAA9852) is always ignored. It does not become a
status message and will never cause the DSPMSG function.
Any other message IDs will by default cause the DSPMSG function.
Defining your own rules
-----------------------
The defaults occur if a data area by the name of STSMSG does not
exist on the library list. You can create a STSMSG data area that is
system wide or one for your own personal use. The first one found,
determines how the message IDs will be handled.
The data area must be created with the CONARR TAA Tool:
CRTCONARR DTAARA(xxx/STSMSG) TEXT('Used by STSMSG tool)
ENTLEN(7) ENTTXT('Message ID')
You edit the data area with the EDTCONARR command:
EDTCONARR DTAARA(xxx/STSMSG)
If you want certain message IDs in addition to the defaults described
previously, you must enter the default message IDs:
CPF1240
CPF1241
TAA9851
You can then add your own message IDs.
If you do not want one or more of the default message IDs, do not
enter it.
You cannot change the following by using entries in the data area:
- All inquiry messages cause DSPMSG
- TAA9852 is ignored (left in the message queue)
TAA9851 and TAA9852 message IDs
-------------------------------
Two special messages exist in the TAAMSGF tool in TAATOOL for use by
other TAA Tools or for your application use. Both message IDs
contain no text and insert the value passed as MSGDTA. They are
similar to the CPF9897 or CPF9898 message IDs. Any message data that
is sent is the entire message.
** TAA9851. By default, the message is sent as a status message.
You may change this as described previously.
** TAA9852. The message ID is always ignored. The intent of
this message is when you want to sent multiple messages, but
only want to break or cause a status message on the final
message. You would send all but the last message as TAA9852.
STRSTSMSG escape messages you can monitor for
---------------------------------------------
TAA9891 The message queue could not be allocated
Escape messages from based on functions will be re-sent.
Command parameters *CMD
------------------
MSGQ The qualified name of the message queue to be
handled by a break program that will send certain
messages as status messages.
The default is *USRPRF. This is the default message
queue assigned for SBMJOB so that the CPF1240 and
CPF1241 messages produced by the batch job will be
handled as status messages.
The special value *WRKSTN may also be used.
The library defaults to *LIBL. *CURLIB may also be
used.
Using the CPP Directly
----------------------
The old form of the tool did not support the STRSTSMSG command. You
may still use this form to set the break handling program as:
CHGMSGQ MSGQ(xxxx) DLVRY(*BREAK) PGM(TAATOOL/TAAMSGDC)
Restrictions
------------
If the user has specified CHGJOB BRKMSG(*HOLD), the break handling
program will not be invoked.
Prerequisites
-------------
The following TAA Tools must be on your system:
CONARR Constant array
Implementation
--------------
None, the tool is ready to use.
You must specify the STRSTSMSG command in your job.
If you want to add additional message IDs to be treated as status
messages, see the previous instructions.
Objects used by the tool
------------------------
Object Type Attribute Src member Src file
------ ----- --------- ---------- -----------
TAAMSGD *CMD TAAMSGD QATTCMD
TAAMSGDC *PGM CLP TAAMSGDC QATTCL
TAAMSGDC2 *PGM CLP TAAMSGDC2 QATTCL
Note that TAAMSGDC2 is the CPP. This is done for compatibility
reasons when the tool did not support a command, but only the
TAAMSGDC program.
|