TAA Tools
DSPRPGUSE       DISPLAY RPG USED                       TAARPGU

The  Display RPG  Used  command provides  a  method of  displaying  the
programs that  use an RPG  field.  The  CRTRPGUSE command must  be used
first  to create or  refresh a data  base file.   DSPRPGUSE provides an
indication of  whether  the program  'uses'  or 'changes'  each  field.
Both internally and externally defined fields are supported.

To  begin  you  must  specify  the  CRTRPGUSE  command  to  create  the
required data base files.  A typical command would be:

             CRTRPGUSE   LIBS(ABC DEF ...) RPGUSEPLIB(xxx)

The  command identifies  where the  data base  files should  be created
and also the  libraries where  the RPG  programs exist.   For the  best
results, you  will want to ensure  that any Externally  Described Files
used by the programs can be accessed using the library list.

For  each program  in  the described  libraries, the  source  member is
accessed and the  field information  is extracted.   The source  member
must still exist in  the file and member where the  program was created
from.   The source  files do  not have to  be on  the library list.   A
spooled   file  is  output  identifying  each  program  that  has  been
accessed and whether any errors exist.

If the program  is an RPGLE  type, the source  for the entry  module is
used.   If a multi-module  program exists, an error  indication appears
as only the first module has been considered.

CRTRPGUSE  is a long running command and  should be submitted to batch.

At the end of CRTRPGUSE, the  RPGUSEP and RPGUSEL data base files  will
be built and are ready for access.

A typical Display command would be:

             DSPRPGUSE     FIELD(xxx)

A subfile  display would appear with  one record for each  program that
uses or  changes the field.   An option exists to  display more details
about the field  and Command keys  are available to  use SEU in  browse
mode against  the source  used to  create the program  or the  DSPOBJD2

Ordering of the subfile records

When the subfile appears, the data is ordered as follows:

         - Field name
         - Type (such as character or decimal)
         - Length
         - Decimal positions
         - Usage ('Changes' appear before 'Use only')

If  you have  unique field  names used  for externally  described data,
the  information can  be very  helpful.   If you  have not  used unique
field names,  the  ordering of  the  records based  on the  length  and
decimal positions may assist you.

Other comments

Only RPG programs  are supported, but any type of RPG  (OPM or ILE) may
be  used.  The RTVRPGFLD tool  is used to determine  field usage.  This
tool has some restrictions.

Usage is determined by  the RPG operation that  uses the field and  any
display file use.   For example, the field used in a  COMP operation is
a  'Use only'  function.   A field  used as  a result  field of  an ADD
operation is  considered  'Changed'.    A  field  which  is  'both'  or
'input' in  a display file  is considered changed.   See the  RTVRPGFLD
command for further details.

The data  to be analyzed will only  be as current as the  last time the
CRTRPGUSE  command  was  run.   An  off  shift use  of  CRTRPGUSE  on a
regularly scheduled basis will probably be adequate for most needs.

You may  have multiple  RPGUSEP files,  but only  one per  library.   A
typical  solution would  be to  have one  set of  files for  each major

If  you regularly  move the source  member after  creating the program,
CRTRPGUSE will not  be effective.   You could consider  the use of  the
CHGOBJD2 tool  which will allow you  to change the program  to describe
where the source exists.

CRTRPGUSE Command parameters                          *CMD

   LIBS          The  libraries to  be accessed for  RPG programs.   Up
                 to 40 libraries may be  described.  For best  results,
                 you  should  ensure  that   the  Externally  Described
                 files referenced  by the programs can be  found on the
                 library list.

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

   RPGUSEPLIB    The library  where the  RPGUSEP and RPGUSEL  data base
                 files  exist or will be  created in.   If the files do
                 not exist, a library must  be specified and the  files
                 are automatically created.

                 If the  files already exist,  *LIBL or *CURLIB  may be
                 used instead of the actual library.

   REPLACE       Whether  to replace  the data in  the RPGUSEP  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  CRTRPGUSE commands
                 all adding data to the same file.

   RQDEXTDSC     Determines  whether  any  externally  described  files
                 are required.  *NO  is the default.  If  an Externally
                 Described  file is  specified in  the source,  it will
                 be  accessed to determine  the field  definitions.  If
                 the file  cannot be  found, the  output  of the  field
                 information may be misleading.

                 *YES may be  specified in which case  if an Externally
                 Described  file  does not  exist,  no  fields will  be
                 converted and  an  error  will  be  indicated  in  the
                 spooled listing.

   NOPGMS        The action to  take if no  program 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).

   SRCLIB        The  source library of the DDS  source for the RPGUSEP
                 files.  This  is the source to  create the files  that
                 will be  used to 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

DSPRPGUSE Command parameters                          *CMD

   FIELD         The  field name to position  to first when the subfile
                 is displayed.    If no  field  is entered,  the  first
                 field in the file is displayed.

                 If  the  field  name  specified does  not  exist,  the
                 subfile  will appear with the  first record just prior
                 to the value of the field name.

                 A 'Position To'  option exists  within the subfile  to
                 allow access to any field.

   RPGUSEPLIB    The  library   containing  the  RPGUSEP   and  RPGUSEL
                 files.    The  files must  have  been  created by  the
                 CRTRPGUSE command.


The source for  the RPG programs  must exist where  the program  object
specifies the source used to create the program.

The RTVRPGFLD  tool is used  to determine the  definition and usage  of
the fields.  This tool has restrictions.

To  ensure  the  proper handling  of  externally  described files,  the
libraries  containing any  referenced files  must exist  on the library


The following TAA Tools must be on your system:

     CPYTAA          TAA Archive
     DSPOBJD2        Display object description 2
     DSPSRCMBR       Display source member
     EDTVAR          Edit variable
     EXTLST          Extract list
     HLRMVMSG        HLL remove message
     RTVFLDA         Retrieve field attributes
     RTVRPGFLD       Retrieve RPG field
     RTVSYSVAL3      Retrieve system value 3
     SNDCOMPMSG      Send completion message
     SNDDIAGMSG      Send diagnostic message
     SNDESCMSG       Send escape message
     SNDSTSMSG       Send status message
     WRTSRC          Write source


None, the tool is ready to use.

Objects used by the tool

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

   CRTRPGUSE     *CMD                   TAARPGU       QATTCMD
   DSPRPGUSE     *CMD                   TAARPGU2      QATTCMD
   TAARPGUC      *PGM       CLP         TAARPGUC      QATTCL
   TAARPGUC2     *PGM       CLP         TAARPGUC2     QATTCL
   TAARPGUC9     *PGM       CLP         TAARPGUC9     QATTCL
   TAARPGUR      *PGM       RPG         TAARPGUR      QATTRPG
   TAARPGUR2     *PGM       RPG         TAARPGUR2     QATTRPG
   TAARPGUP      *FILE      PF          TAARPGUP      QATTDDS
   TAARPGUL      *FILE      LF          TAARPGUL      QATTDDS


   TAARPGUC   CL pgm

   TAARPGUC2   CL pgm
     TAARPGUR    RPG Pgm
       TAARPGUD    Display file
       TAARPGUC9   CL Pgm

Added to TAA Productivity tools October 1, 1996

Home Page Up to Top