TAA Tools
DEBUG           DEBUGGING TECHNIQUE                    TAADBGF

The  Debug tool  is  not code,  but  rather a  technique  to assist  in
debugging.    It can  also  be  used for  any  function  where you  are
repeating  several commands on a command  entry display.  It allows you
to quickly  execute  a  command that  you  had  entered earlier  in  an
interactive job.   The  Debug tool  uses the FAVCMD  tool to  store the


Assume  you debugging program ABC.   Anyone of the debugging techniques
may be used  such as the system  STRDBG command, or  the TAA tools  BKP
or TRCDBG.   You must specify UPDPROD(*YES) as the  FAVCMD tool updates
information  about the last usage.   Assume that to  debug ABC you must
repeatedly execute a series of commands such as:

            STRSEU    ....
            CRTCLPGM  ...
            DLTF     /* Delete of some file to test against */
            CALL     /* User program to create the test file */
            STRDBG   ....    UPDPROD(*YES)
            CALL     PGM(ABC) PARM(....)
            DSPxxx   /* Display the results */

Since many of the  commands can have a  complex set of parameters,  you
don't want  to  key the  commands over  and  over, but  rather use  the
system function to duplicate a command.

If  you  operate from  a  menu  type of  display,  this  means you  are
repeatedly  pressing  F9  to  retrieve  the  command  that  you entered
previously.  If  you operate from the  full command entry display,  you
probably need  to roll  back, position the  cursor, and then  press F9.
With  either  technique,  you  must then  press  Enter  to  execute the
command that has been duplicated.

Instead of this approach,  you can use the  FAVCMD tool to capture  the
commands and then quickly recall and execute them when needed.

If you  do not  have a  FAVCMD file set  up, you  should create  one in
your normal library (so *LIBL may be used on the FAVCMD commands).

             CRTFAVCMD  FAVCMDPLIB(xxx)

This creates the FAVCMDP and FAVCMDL files in the named library.

Then  for each command  in the repetitive  set, you assign  an ID after
issuing the command.  For example, you could enter:

             STRSEU     SRCFILE(xxx/QCLSRC) SRCMBR(yyy)
             ADDFAVCMD  FAVID(SEU)

ADDFAVCMD  accesses  the  previous  *RQS  message  type  and  adds  the
command to the FAVCMDP file with a unique ID.

For each command  in the iterative  process, you would assign  a unique
ID such as:

             CRTCLPGM   ...
             ADDFAVCMD  FAVID(CRT)
             DLTF       /* Delete of some file to test against */
             CALL       /* User program to create the test file */
             ADDFAVCMD  FAVID(CRT)
             STRDBG     ....
             ADDFAVCMD  FAVID(DBG)
             CALL       PGM(ABC) PARM(....)
             ADDFAVCMD  FAVID(ABC)
             DSPxxx     /* Display the results */
             ADDFAVCMD  FAVID(DSP)

Once the commands  are in the file, you can  use the FAVCMD function to
access  and execute  the commands  that have  been stored.   The second
time you need to iterate, you could enter:

             FV          SEU
             FV          CRT
             FV          DLTF
             FV          CRT
             FV          DBG
             FV          ABC
             FV          DSP

The FV  command is  a  "synonym" for  the EXCFAVCMD  command.   FV  and
EXCFAVCMD  have identical  parameters  and they  use  the same  command
processing  program.   Either command  extracts the stored  command and
executes it using QCMDEXC.


The EXCFAVCMDL command allows you to execute two or more ID's
such as the following from the previous example:


You may  also follow EXCFAVCMDL  with ADDFAVCMD  and assign  an ID  for

Maintaining the FAVCMD file

You can  maintain the FAVCMDP  file using WRKFAVCMD.   It will  let you
add, change, or delete entries.

The  ADDFAVCMD command  supports a  REPLACE parameter  so that  you can
replace the stored command for an  existing ID.  For example, the  next
use  of SEU  is probably  for  a different  source member.    So for  a
member  you know  you will  probably have  to make  interactive changes
to, you just do it once and then use ADDFAVCMD with REPLACE(*YES).

The  RMVFAVCMD  command  will  let  you  remove  an  entry,  but  it is
probably simpler to either replace it or use WRKFAVCMD.

Shorthand commands

The favorite command  function can also be  used to allow you  to enter
your  own shorthand  abbreviation  of  a command  name  that you  enter
frequently.    For  example,  you  could  use  DOP  instead  of  DSPMSG

Added to TAA Productivity tools January 15, 2014

Home Page Up to Top