TAA Tools
ABORT           ABORT                                  TAAMSHY

The Abort  command is  designed for  use in  a HLL program  to end  the
program by sending  the TAA9861 message as an escape.   ABORT is both a
command  and a program name.  An intended  use of the program is when a
CALL error  has occurred  and  you want  to recover  from  one or  more
specific  error  conditions,  but  not  others.    After  handling  the
specific error conditions, just call ABORT.

A  typical use  of  the function  in RPG  would be  to include  the RPG
status data  structure  from the  RPGSTSDS  tool  and then  handle  the
error indicator on the CALL:

     C*  Place some command to be run in the CMD parameter
     C                     CALL 'QCMDEXC'              20
     C                     PARM           CMD   200
     C                     PARM 200       CMDLEN 155
     C* If error exists check further.
     C   20                DO
     C* If STMSID (field in RPG Status DS) is CPFXXXX do unique code
     C          STMSID     IFEQ 'CPFXXXX'
     C*    Unique code for this condition
     C                     ENDIF
     C* Any other condition, use ABORT program
     C                     CALL 'ABORT'
     C                     ENDDO

If CPFXXXX  caused the error, the  program has some recovery  or bypass
code.   If  it is  some other error,  the ABORT  program is  called and
ends the program by sending an escape message.

Different message text is used for the TAA9861 message:

       - No previous message exists.
       - The previous message is not an escape message
       - The previous messages is an escape message


The SNDJLG  program (part  of  the SNDJLGMSG)  tool provides  a  simple
means  of sending  a message  to  the job  log.   A  good  use of  this
function  in  combination with  ABORT  is when  the  program reaches  a
point where something is not provided for.

For  example, assume you  have separate routines for  some code type in
a data record and come across a code that is not supported.

A solution is to send a message and then abort:

     C            'BadType'CAT  TYPE:1    MSG   256
     C                     CALL 'SNDJLG'
     C                     PARM           MSG
     C                     CALL 'ABORT'

Use with ILE

ABORT may also be used from  an ILE program.  ILE programs are  made up
of modules.   When one of  the modules calls ABORT,  the escape message
is sent to the program previous to the one that called ABORT.

This  happens regardless of how many modules  are in the call stack for
the same program.

Comparison with CL MONMSG Command

The CL MONMSG  command allows you to  monitor for specific  conditions.
Any other conditions would cause a program abnormal termination.

The CALL operation in HLLs do not have this capability.

Once you decide to  handle one error, you must handle them  all.  Since
so  many unusual situations can  occur, ABORT provides a  good means of
abnormally terminating the program.

ABORT escape messages you can monitor for

      TAA9861    Abort function was used.

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

Command parameters                                    *CMD





The following TAA Tools must be on your system:

     RTVPGMNAM       Retrieve program name


None, the tool is ready to use.

Objects used by the tool

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

   ABORT         *CMD                   TAAMSHY       QATTCMD
   TAAMSHYC      *PGM       CLP         TAAMSHYC      QATTCL
   ABORT         *PGM       CLP         TAAMSHYC      QATTCL

Added to TAA Productivity tools April 23, 2001

Home Page Up to Top