TAA Tools
DSPRPGCPY       DISPLAY RPG /COPY                      TAARPHV

The Display RPG /COPY  tool provides two commands.   DSPRPGCPY provides
a display  or list of the /COPY and/or  /INCLUDE statements from one or
more  RPG type source members (including  RPGLE, RPGMOD etc.) in one or
more source files.   An  outfile is optional  which will allow  further
analysis by the  DSPRPGCPY2 command which prints or lists  the use of a
specific  member named on  /COPY or  /INCLUDE statements.   A query may
also be written.

Only  fixed form  RPG  type  of  source  is  valid.    The  IFS  naming
convention  for /COPY  or /INCLUDE  is not  fully supported.   See  the
comments on the supported syntax.

For a change capability, see the CHGRPGCPY command.

The  output file  for DSPRPGCPY  is always RPGCPYP  which uses  a model
file of TAARPHVP and a format name of RPGRCD.

A typical DSPRPGCPY command would be:

            DSPRPGCPY   SRCFILE(xxx/*ALL)

All source  files in  the named  library would  be determined  and  all
members would  be output to an  internal file in  QTEMP.  All  RPG type
source members  (see the SRCTYPE parameter) would  be checked for /COPY
and /INCLUDE statements.  If found, a line would be listed.

Because  the default  for the OUTPUT  parameter is *,  the spooled file
would be displayed and then deleted.

An outfile may  be specified to  output one record  for each /COPY  and
/INCLUDE statement found such as:

            DSPRPGCPY   SRCFILE(xxx/*ALL) OUTPUT(*OUTFILE)
                          OUTLIB(QTEMP)

You  could then  use the  DSPRPGCPY2 command  (requires the  outfile of
DSPRPGCPY)  to   provide  a  listing  of  all  source  statements  that
reference a specific  member on the /COPY  or /INCLUDE statements  such
as:

            DSPRPGCPY2  SCNMBR(MBRA)

Only those  /COPY or /INCLUDE  statements that refer  to MBRA  would be
listed.

RPGCPYP  Outfile
----------------

Specifying  OUTPUT(*OUTFILE)   for  the  DSPRPGCPY  command  causes  an
additional prompt  for  the  OUTLIB, OUTMBR,  and  REPLACE  parameters.
The  output  file  is  always  RPGCPYP  which  uses  a  model  file  of
TAARPHVP.  You can display the format using DSPFMT TAARPHVP.

If a listing  is output (no outfile), the value  of the COPY or INCLUDE
statement is shown.

When  an outfile is requested, the  data describing the COPY or INCLUDE
is placed  in the  RPLONG field.   The values  in the  COPY or  INCLUDE
statement  are  parsed  into  the  3 fields  RPCPYL  (library),  RPCPYF
(file), and RPCPYM (member) and are folded to upper case.

Some  values may be blank if  they are not described in  the source.  A
member name must exist.  The  RPG definition is that a blank file  name
equates to QRPGSRC or  QRPGLESRC depending on the source  type used.  A
blank  library  name equates  to  *LIBL.   The  three  values  are used
during program creation (not during execution).

Supported syntax
----------------

The RPGLE  /COPY  and  /INCLUDE  statements  can  appear  in  any  case
including mixed such as:


      /COPY MBRA
      /copy mbra
      /CopY mBrA
      /INCLUDE mbra
      /include MBRA
      /inCLude mBra

The supported valid  syntax requires a member  name.  A source  file is
optional.   If a library  qualifier is used,  it must be  followed by a
slash  (/)  and  then  the source  file  name.   If  a  source  file is
specified, a comma (,) must be used prior to the member name.


      /COPY member
      /COPY srcfile,member
      /COPY srclib/srcfile,member
      /INCLUDE member
      /INCLUDE srcfile,member
      /INCLUDE srclib/srcfile,member

An IFS name such as:

      /COPY /libx.lib/filey.file/mbrz.mbr

will be listed  (the number of  bytes is limited to  75 bytes).   If an
outfile is requested,  the library and file fields will  be blank.  The
member name will contains *BADSYNTAX.

DSPRPGCPY escape messages you can monitor for
---------------------------------------------

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

DSPRPGCPY2 escape messages you can monitor for
----------------------------------------------

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

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

   SRCFILE       The  source  file  name to  be  checked.    A specific
                 name, a generic  name, or the  special value *ALL  may
                 be specified.

                 The library qualifier  defaults to *LIBL.   A specific
                 name, *LIBL,  *ALL, or *ALLUSR may  be specified.  You
                 must have *ALLOBJ  special authority  to specify  *ALL
                 or *ALLUSR.

   TYPE          The type  to  search for.   *BOTH  is  the default  to
                 search for both /COPY and /INCLUDE.

                 /COPY  or  /INCLUDE  may  be  used  to  search  for  a
                 specific value.

                 /INCLUDE  statements  only  exist  in  RPGLE  types of
                 source,  but  it  is  not  an  error  to   search  for
                 /INCLUDE in RPG types.

   SRCTYPE       The  type  of source  to  be  checked.   *ALL  is  the
                 default to search for all RPG types.

                 A  maximum  of  6 entries  may  be  entered  for *RPG,
                 *RPGLE,  *RPGMOD,  *SQLRPG,  *SQLRPGLE,  and   *RPG38.
                 Note that RPG36 is not included.

   SRCMBR        The member  of the  source to be  processed.   *ALL is
                 the default for all source members.

                 A generic or specific member may be named.

                 *ALL  must be  used if the  SRCFILE parameter  is *ALL
                 or a generic name.   *ALL must be  used if an  OMITLIB
                 is named.

   MBRTXT        A *YES/*NO  value that  determines whether the  member
                 text will  be listed if a /COPY  or /INCLUDE is found.
                 The   value   is   ignored   if   OUTPUT(*OUTFILE)  is
                 specified.

                 *NO  is  the default  meaning  that  only  the  member
                 name, file, and library are listed.

                 *YES  may be specified  to cause  an extra  line which
                 includes the member text.

   OMITLIB       A  list  of  up to  50  libraries  or  generic library
                 names that should be omitted.   *NONE is the  default.

                 An omit  list may not  be entered for  LIB(*CURLIB) or
                 if  only non-generic  libraries are specified  for the
                 LIB parameter.   For example, if  LIB(ABC DEF GHI)  is
                 specified, an OMITLIB may not be used.

                 Any library entered is checked for existence.

                 No check occurs to  see if an omit library  would have
                 been  selected.     For  example,   if  LIB(*LIBL)  is
                 entered  with OMITLIB(ABC)  and library ABC  is not on
                 the library list, no error occurs.

   OUTPUT        How to  output  the  results.   *  is the  default  to
                 display  the spooled  file if  the command  is entered
                 interactively.   The spooled file  is deleted after it
                 is displayed.

                 If the  command  is  entered  in batch  or  *PRINT  is
                 specified, the  spooled file  is output  and retained.

                 *OUTFILE  may be specified  to create  the output file
                 RPGCPYP which uses  the format of  the TAARPHVP  file.

   OUTLIB        The  library  in  which  the   RPGCPYP  file  will  be
                 placed.   The default is  *LIBL.  If  the RPGCPYP file
                 does  not already exist, a  library must be specified.

   OUTMBR        The member  of the RPGCPYP  file to be  used.  If  the
                 member does  not exist, it  is added.  The  default is
                 RPGCPYP.

   REPLACE       A  *YES/*NO  value for  whether the  member  should be
                 cleared before writing records  into it.  The  default
                 is *YES.

                 *NO  may  be  specified to  add  records  to  existing
                 data.


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

   SCNMBR        The  member name  to be scanned  for.   When DSPRPGCPY
                 is run,  the  value  in the  RPGCPYP  file  for  field
                 RPCPYM  is  folded  to upper  case.    The  value  for
                 SCNMBR is also folded to upper case.

   RPGCPYPLIB    The library  where the RPGCPYP file exists.   *LIBL is
                 the  default.  The  file must have  been output by the
                 DSPRPGCPY OUTPUT(*OUTFILE) function.

   RPGCPYPMBR    The  member of  the  RPGCPYP  file.    *FIRST  is  the
                 default.   A specific member of *LAST  may be entered.

   OUTPUT        How  to  output the  results.    * is  the  default to
                 display the  spooled file  if the  command is  entered
                 interactively.  The  spooled file is deleted  after it
                 is displayed.

                 If  the  command  is entered  in  batch  or *PRINT  is
                 specified, the spooled  file is  output and  retained.


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

You must  have *ALLOBJ  special authority  to specify  *ALL or  *ALLUSR
for the source file library.

Only fixed form RPG source is supported.

The  IFS  naming  convention   for  /COPY  or  /INCLUDE  is  not  fully
supported.  See the previous comments on the supported syntax.

RPG36 source types are not supported.

Valid syntax must exist.

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

The following TAA Tools must be on your system:

     CHKALLOBJ       Check *ALLOBJ special authority
     CHKDBFMBR       Check data base file member
     DUPTAADBF       Duplicate TAA data base file
     EDTVAR          Edit variable
     EXTLST          Extract list
     EXTLST2         Extract list 2
     HLRMVMSG        HLL remove message
     RTVDAT          Retrieve date
     RTVFMT          Retrieve format
     RSNLSTMSG       Resend last message
     RTVSYSVAL3      Retrieve system value 3
     SNDCOMPMSG      Send completion message
     SNDESCINF       Send escape information
     SNDESCMSG       Send escape message
     SNDSTSMSG       Send status message
     TRNVAL          Translate value

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

None, the tool is ready to use.

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

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

   DSPRPGCPY     *CMD                   TAARPHV       QATTCMD
   DSPRPGCPY2    *CMD                   TAARPHV2      QATTCMD
   TAARPHVC      *PGM       CLP         TAARPHVC      QATTCL
   TAARPHVC2     *PGM       CLP         TAARPHVC2     QATTCL
   TAARPHVR      *PGM       RPG         TAARPHVR      QATTRPG
   TAARPHVR2     *PGM       RPG         TAARPHVR2     QATTRPG
   TAARPHVP      *FILE      PF          TAARPHVP      QATTDDS

Structure
---------

DSPRPGCPY   Cmd
   TAARPHVC   CL pgm
     TAARPHVR   RPG Pgm

DSPRPGCPY2  Cmd
   TAARPHVC2   CL pgm
     TAARPHVR2   RPG Pgm
					

Added to TAA Productivity tools October 15, 2010


Home Page Up to Top