TAA Tools
DSPWHRUSE       DISPLAY WHERE USED                     TAAWHRA

The Display  Where  Used command  provides a  subfile  of records  that
were output  by DSPPGMREF.   The records are ordered  by the referenced
object.  An option exists to add Query objects.

The  subfile provides  a convenient  means of  asking typical questions
such as:

      Which programs use FILEA?

      Which programs update FILEA?

      Which programs call PGMA?

To use DSPWHRUSE, you must  first create the files WHRUSEP  and WHRUSEL
which will  contain the output  from DSPPGMREF.  The  CRTWHRUSE command
(part of the same tool) should be used such as:

         CRTWHRUSE   LIBS(LIBA LIBB) WHRUSEPLIB(LIBC)

In  this case,  DSPPGMREF would be  used for  all programs  in LIBA and
LIBB.  The files  WHRUSEP and WHRUSEL would  be created in the  library
LIBC.  The CRTWHRUSE  command may also be used to refresh  the files at
any time.

To display the output, you would specify:

         DSPWHRUSE   WHRUSEPLIB(LIBC)

You can  have one set of  'where used' files for each  library or use a
single set  of files  for multiple  libraries.   You can  have as  many
sets of  'where used'  files as required,  but only  one set  may exist
per library.

The information  in the 'where  used' files is  as current as  the last
time  CRTWHRUSE  was run.   You  would normally  schedule a  night time
batch job to do CRTWHRUSE  on a regular basis such as daily  or weekly.

From the subfile  display, you can use F10 or F11  to reduce the number
of object references.

  **   F10  may be used  to flip/flop between  including those programs
       that reference the object for  'input only'.  In many cases  you
       may only  be interested  in the programs  that update  or output
       to the object.

  **   F11  may be used  to flip/flop between  including those programs
       that reference  the  object in  an  'unspecified' manner.    The
       usage  codes 00  and 08  are  shown on  the  subfile display  as
       'unspecified'.

       The  08 code  is  frequently used  by  CL programs  when  when a
       command such as OVR references a file.

       The  00  code  is frequently  used  by programs  when  they call
       another program.

From the  subfile  display, you  can  access more  detail  information.
The detail display includes:

  **   Information   about  the  referenced   object  (if   it  exists)
       including the text description and attribute.

  **   Information   about  the  using   program  (or  *SQLPKG  object)
       including information about the source used.

  **   A Function key to  access the source of  the using program.   If
       SEU exists, browse mode is used to display the source.

  **   A  Function key  to allow  the TAA  Tool DSPOBJD2  to display  a
       summary display of the using program.

System support of DSPPGMREF
---------------------------

Each  HLL  compiler  determines  what  it  will  place  in  the  Object
Information Repository  (OIR)  that  is  used  by  DSPPGMREF.    For  a
complete  list,  see  the  information   provided  with  the  DSPPGMREF
command.

The information  provided has changed  over time, so  a program created
on  a past release may not have  captured the information that would be
available if the program was recreated.

In general,  the following  object references  are captured  by CL  and
RPG programs.

         *FILE
         *PGM
         *DTAARA

If  the  name  used  within  the  program is  a  variable,  the  actual
information   cannot  be  determined.    If   the  file  name  used  is
overridden, the information provided by  the system may be  misleading.

If  an object  is accessed  using a  value  such as  *LIBL, the  actual
object may vary at run time.

You  should consider the information  provided by the system  as a good
starting point  for asking  'where  used' types  of questions,  but  it
should not be viewed as 100% reliable.

Query objects
-------------

An option  exists on CRTWHRUSE  to include  *QRYDFN and *QMQRY  objects
in the where used information.  The default is *NO.

If *YES  is specified, the  QRYUSE tool is  used to create  the QRYUSEP
and  QRYUSEL files in the same  library as specified for the WHRUSEPLIB
parameter.   After  converting  both  DSPPGMREF and  QRYUSE  data,  the
QRYUSE data is merged into the WHRUSEP file.

When  DSPWHRUSE  is  run,  the  Query objects  appear  along  with  any
program references.

DSPWHRUSE command parameters                          *CMD
----------------------------

   OBJ           The  object to 'position  to' in  the subfile display.
                 The default  is the  first record  in the  file.   You
                 may immediately 'position to' any object.

                 The  'position   to'  function  also  exists   on  the
                 subfile display.

   WHRUSEPLIB    The   library  containing  the   WHRUSEP  and  WHRUSEL
                 files.   The  files  must have  been  created  by  the
                 CRTWHRUSE command.

   OBJNAM        A  *YES/*NO  parameter that  determines  whether  only
                 object names  will be included.   *YES is  the default
                 which  means that variable names  such as *VARIABLE or
                 *  or  unusual  conditions  which  are   described  as
                 numbers (1  or -1)  will not be  included.   The first
                 letter of the object name must be A-Z, $, #, or @.

                 *NO displays all the entries.

CRTWHRUSE command parameters                          *CMD
----------------------------

   LIBS          Up  to 40  libraries may  be named.   Each  library is
                 accessed with  DSPPGMREF  to capture  the  information
                 provided  by the  system about  the  objects that  are
                 referenced by programs.

                 You  may have  more than 40  libraries using  the same
                 WHRUSEP file  by using  CRTWHRUSE multiple  times  and
                 specifying the REPLACE(*NO) option.

   WHRUSEPLIB    The  library   containing  the  WHRUSEP   and  WHRUSEL
                 files.   This is  the library  that will  be described
                 on the DSPWHRUSE command.

   REPLACE       Whether  to replace  the data  in the  WHRUSEP file at
                 the beginning  of the command.   The  default is  *YES
                 which  causes the  file to  be  cleared.   *NO may  be
                 specified  when you  have multiple  CRTWHRUSE commands
                 all adding data to the same file.

   NOOBJS        The action to  take if no objects  exist in a  library
                 named on  the LIBS parameter.   The default  is *ERROR
                 which   will   cause   the   command   to   abnormally
                 terminate.    *IGNORE  may  be  specified  which  will
                 allow the  command to  continue (a diagnostic  message
                 is sent).

   QUERY         Whether to  include the *QRYDFN and  *QMQRY objects in
                 the where used information.  The default is *NO.

                 If  *YES  is specified,  the  QRYUSE tool  is  used to
                 create  the QRYUSEP  and  QRYUSEL  files in  the  same
                 library  as specified  for  the WHRUSEPLIB  parameter.
                 After  converting both DSPPGMREF and  QRYUSE data, the
                 QRYUSE data is merged into the WHRUSEP file.

                 When  DSPWHRUSE  is  run,  the  Query  objects  appear
                 along with any program references.

   SRCLIB        The source library  of the DDS source  for the WHRUSEP
                 files.   This is the  source to create  the files that
                 will be used you contain  your data.  Unless you  have
                 made a specific change, use the default.

                 *TAAARC is the  default to access the source  from the
                 TAA Archive.   A specific library may  also be used if
                 you  have first copied the  source from the Archive to
                 your library.   The source file  name QATTDDS must  be
                 used.

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

The  information is  only as  current as  the last  time  CRTWHRUSE was
run.

The  information from  the system is  not necessarily  complete and may
be misleading.  See the prior discussion.

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

The following TAA Tools must be on your system:

     CHKNAM          Check name
     DSPOBJD2        Display object description nbr 2
     DSPSRCMBR       Display source member
     EDTVAR          Edit variable
     EXTLST          Extract list
     RTVILEMODA      Retrieve ILE module attributes
     SNDCOMPMSG      Send completion message
     SNDDIAGMSG      Send diagnostic message
     SNDESCMSG       Send escape message
     SNDSTSMSG       Send status message
     WRTSRC          Write source

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

None, the tool is ready to use.

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

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

   DSPWHRUSE     *CMD                   TAAWHRA       QATTCMD
   CRTWHRUSE     *CMD                   TAAWHRA2      QATTCMD
   TAAWHRAC      *PGM       CLP         TAAWHRAC      QATTCL
   TAAWHRAC2     *PGM       CLP         TAAWHRAC2     QATTCL
   TAAWHRAC3     *PGM       CLP         TAAWHRAC3     QATTCL
   TAAWHRAR      *PGM       RPG         TAAWHRAR      QATTRPG
   TAAWHRAR12    *PGM       RPG         TAAWHRAR12    QATTRPG
   TAAWHRAD      *FILE      DSPF        TAAWHRAD      QATTDDS
   TAAWHRAP      *FILE      PF          TAAWHRAP      QATTDDS
   TAAWHRAL      *FILE      LF          TAAWHRAL      QATTDDS
                                        TAAWHRAL2     QATTDDS

The TAAWHRAP  file  is the  source used  for  WHRUSEP.   The  TAAWHRAL2
source is  copied during the use  of CRTWHRUSE and added  when creating
the  file  WHRUSEL.   The  TAAWHRAL file  is  used to  help  create the
TAAWHRAR program.

Structure
---------

DSPWHRUSE   Cmd
   TAAWHRAC   CL pgm
     TAAWHRAR   RPG Pgm
       TAAWHRAD   Display file
       TAAWHRAC3  CL Pgm

CRTWHRUSE   Cmd
   TAAWHRAC2   CL pgm
     TAAWHRAR12   RPG pgm - Merges in QRYUSE information
					

Added to TAA Productivity tools May 1, 1996


Home Page Up to Top