TAA Tools
SNDESCINF       SEND ESCAPE INFORMATION                TAAMSIM

The  Send Escape  Information  command  is designed  to  work in  a  CL
program  standard  error  handling routine  such  as  used  in the  TAA
Productivity  Tools.   You  must first  extract the  SENDER information
from an escape  message and specify it  on SNDESCINF.  SNDESCINF  sends
a  message with  the program,  library,  and MI  instruction where  the
escape message occurred.

See   the  DSPPGMSTMT  TAA   command  to  display   the  HLL  statement
associated with the MI instruction.

SNDESCINF is  intended for  OPM  CL programs  that use  the same  or  a
similar  standard   error  handling   routine  as   used  in   the  TAA
Productivity tools.

The  message is sent to  the program message queue  of the program that
uses SNDESCINF.   Assuming  the standard  error handling  routine  does
not remove the  message, the message  becomes a low level  message when
the escape  message is resent  and is likely  to remain in  the job log
(it  could only  be removed  by a program  in the  stack issuing RMVMSG
PGMQ(*ALLINACT) CLEAR(*ALL)).

If a CLLE program  uses SNDESCINF, the MI instruction is  not available
and no message is sent.

In  the following  sample  code, the  standard  error handling  routine
(see  the STDERR1  section) from  the TAASTDAC  member sends  a message
relating to the MI instruction that caused the error.

                        /********************************************/
                        /*                                          */
 STDERR1:               /*       Standard error handling            */
                        /*                                          */
                        /********************************************/
             IF         &XERRORSW SNDPGMMSG MSGID(CPF9999) +
                          MSGF(QCPFMSG) MSGTYPE(*ESCAPE)
             CHGVAR     &XERRORSW '1' /* Set to fail on error */
             RCVMSG     MSGTYPE(*EXCP) RMV(*NO) KEYVAR(&XKEYVAR) +
                          SENDER(&SENDER)
             SNDESCINF SENDER(&SENDER)
 STDERR2:    RCVMSG     MSGTYPE(*PRV) MSGKEY(&XKEYVAR) RMV(*NO) +
                          KEYVAR(&XKEYVAR2) MSG(&XMSG) +
                          MSGDTA(&XMSGDTA) MSGID(&XMSGID) +
                          RTNTYPE(&XRTNTYPE) MSGF(&XMSGF) +
                          SNDMSGFLIB(&XMSGFLIB)
             IF         (&XRTNTYPE *NE '02') GOTO STDERR3
             IF         (&XMSGID *NE ' ') SNDPGMMSG +
                          MSGID(&XMSGID) MSGF(&XMSGFLIB/&XMSGF) +
                          MSGDTA(&XMSGDTA) MSGTYPE(*DIAG)
             IF         (&XMSGID *EQ ' ') SNDPGMMSG +
                          MSG(&XMSG) MSGTYPE(*DIAG)
             RMVMSG     MSGKEY(&XKEYVAR2)
 STDERR3:    RCVMSG     MSGKEY(&XKEYVAR) MSGDTA(&XMSGDTA) +
                          MSGID(&XMSGID) SENDER(&SENDER) +
                          MSGF(&XMSGF) SNDMSGFLIB(&XMSGFLIB)
             SNDPGMMSG  MSGID(&XMSGID) MSGF(&XMSGFLIB/&XMSGF) +
                          MSGDTA(&XMSGDTA) MSGTYPE(*ESCAPE)
             ENDPGM


The RCVMSG  command specifies  the SENDER  information  be returned  in
the  &SENDER variable.    RCVMSG  must also  specify  SENDERFMT(*SHORT)
which  is the  default.  The  SNDESCINF command  follows and  is passed
the SENDER  information.    The  DCL for  &SENDER  must  specify  *CHAR
LEN(80).

The message sent would be read as:

        Escape message from xxxx in yyyy at MI yyyy.

Disadvantages of the previous standard error handling routine
-------------------------------------------------------------

The standard error handling  code provided in member TAASTDAC  prior to
Oct  2003 worked  well  in most  situations, but  had  disadvantages as
follows:

  **   There  was  no  indication  of  where  the  escape  message  had
       occurred.   The program level  MONMSG command  just branched  to
       the  standard error  handling routine.    In most  cases it  was
       fairly  obvious  where the  error occurred,  but  some ambiguous
       situations could occur.

  **   The program higher in the  stack could remove any messages  sent
       to it, thus  causing the loss of the  original information about
       the program that received an escape message.

  **   If  a program higher in  the stack 'bubbled up'  the message, it
       was  somewhat  misleading  in  that  it  did  not  receive   the
       original escape message.

SNDESCINF solves these problems,  by adding a message when  each escape
occurs.   If escape  messages are 'bubbled  up', a message  will appear
for each program that uses the technique.

SNDESCINF escape messages you can monitor for
---------------------------------------------

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

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

   SENDER        The  information  must  have  been  returned  from the
                 RCVMSG command  using SENDERFMT(*SHORT)  and a DCL  of
                 *CHAR LEN(80).

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

The  command is only  of value  for OPM  programs.   If a  CLLE program
uses  the command,  no message  is sent because  the MI  instruction is
not available.

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

The following TAA Tools must be on your system:

     RTVPGMSTK2      Retrieve program stack 2

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

None, the tool is ready to use.

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

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

   SNDESCINF     *CMD                   TAAMSIM       QATTCMD
   TAAMSIMC      *PGM       CLP         TAAMSIMC      QATTCL
					

Added to TAA Productivity tools October 15, 2003


Home Page Up to Top