TAA Tools
CHGRPGCPY       CHANGE RPG /COPY                       TAARPHU

The  Change RPG  /COPY  (CHGRPGCPY)  command  allows changes  to  /COPY
statements in  RPG for one, generic,  or all members of  a source file.
The  CHGRPGCPY2 exists  for RPGLE  source which  also handles /INCLUDE.
The default is OPTION(*CHECK) which  means no changes are made  and the
listing  describes what  changes  would be  made.   Selection  criteria
exists  for the file,  library, or  member names in  the existing /COPY
statement.

Only the  following types  of  formats are  provided for  (/INCLUDE  is
also provided for):

        /COPY MBR1
        /COPY SRCFIL,MBR1
        /COPY SRCLIB/SRFIL,MBR1

You must have *ALL authority to the source file to use CHGRPGCPY.

A typical  command to  change the  source file name  used in  all /COPY
statements in a QRPGSRC file would be:

             CHGRPGCPY  FILE(xxx/QRPGSRC) SELFILE(QRPGSRC)
                          NEWFILE(QRPGSRC2)

Because  the default is  OPTION(*CHECK), no changes  would be made.   A
listing would  be displayed  of  what changes  would  be made  when  an
existing /COPY  statement  used QRPGSRC  as the  file name.   Both  the
existing statement and the new statement would be listed.

Another typical  command would be  to to change the  source member CPY4
to CPY5 if the file is XYZ in library ABC:

             CHGRPGCPY  FILE(xxx/QRPGSRC) SELFILE(XYZ)
                          SELLIB(ABC) SELMBR(CPY4)
                          NEWMBR(CPY5)

For  RPGLE  source, the  copy statement  may be  either upper  or lower
case, but the characters must match.  For example, to change:

                C/copy mbr1

You would enter a command such as:

             CHGRPGCPY2 FILE(QRPGLESRC) SELMBR(mbr1)
                          NEWMBR(mbr2)

CHGRPGCPY escape messages you can monitor for
---------------------------------------------

      TAA9891    No members were found

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

CHGRPGCPY2 escape messages you can monitor for
----------------------------------------------

      TAA9891    No members were found

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

CHGRPGCPY Command parameters                          *CMD
----------------------------

   SRCMBR        The source  member to  be processed.   The default  is
                 *ALL for  all members in  the named file.   A specific
                 member  or a generic member name  may also be entered.

   SRCFILE       The  qualified  name   of  the   source  file  to   be
                 processed.   QRPGSRC  is  the  default.   The  library
                 qualifier defaults to *LIBL.

                 Specific names may be entered.

   SELFILE       The   file  name  to   be  selected   from  the  /COPY
                 statements.   *ALL is  the  default meaning  all  file
                 names will be  considered as well as  /COPY statements
                 that do not have a file name.

   SELLIB        The  library  name  to  be  selected  from  the  /COPY
                 statements.   *ALL is the  default meaning all library
                 names will be considered  as well as /COPY  statements
                 that do not have a library name.

   SELMBR        The  member  name  to   be  selected  from  the  /COPY
                 statements.   *ALL is  the default  meaning all member
                 names will be considered.

   NEWFILE       The name of the  new file to  be used in any  selected
                 /COPY statements.   *SAME  is the default  meaning the
                 existing  name  (if any)  is  used.   A  specific file
                 name may be entered.   *NONE may be specified  meaning
                 that  any selected  /COPY  statements will  be  output
                 without   a   file  name.      If  NEWFILE(*NONE)   is
                 specified, NEWLIB(*NONE) must also be used.

   NEWLIB        The  name  of  the  new  library  to  be  used  in any
                 selected  /COPY  statements.   *SAME  is  the  default
                 meaning  the  existing  name  (if  any) is  used.    A
                 specific  library name may  be entered.   *NONE may be
                 specified meaning that  any selected /COPY  statements
                 will be output without a library name.

   NEWMBR        The  name  of  the  new  member  to  be  used  in  any
                 selected  /COPY  statements.    *SAME  is the  default
                 meaning  the  existing  name  is  used.    A  specific
                 member name may be entered.

   OPTION        Whether  to list  only the  proposed  changes or  make
                 the changes.

                 *CHECK  is  the  default  meaning  only  the  proposed
                 changes are listed.

                 *CHANGE   may  be   specified  meaning   the  proposed
                 changes are made  to /COPY  statements and the  source
                 is updated.  A listing is also output.

                 The source  is not changed if no  /COPY statements are
                 found or the SELxxx criteria is not found.

   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.


CHGRPGCPY2 Command parameters                         *CMD
-----------------------------

   SRCMBR        The source  member to  be processed.   The default  is
                 *ALL for  all members in  the named file.   A specific
                 member  or a generic member  name may also be entered.

   SRCFILE       The  qualified   name  of  the   source  file  to   be
                 processed.   QRPGLESRC  is the  default.   The library
                 qualifier defaults to *LIBL.

                 Specific names may be entered.

   SELFILE       The   file  name  to   be  selected   from  the  /COPY
                 statements.   *ALL is  the  default meaning  all  file
                 names  will  be  considered  as   well  as  /COPY  and
                 /INCLUDE statements that do not have a file name.

   SELLIB        The  library name  to be selected  from the  /COPY and
                 /INCLUDE statements.    *ALL is  the  default  meaning
                 all  library  names  will be  considered  as  well  as
                 /COPY  and  /INCLUDE statements  that  do  not have  a
                 library name.

   SELMBR        The  member  name to  be selected  from the  /COPY and
                 /INCLUDE statements.    *ALL  is the  default  meaning
                 all member names will be considered.

   NEWFILE       The name  of the new file  to be used  in any selected
                 /COPY  and /INCLUDE statements.   *SAME is the default
                 meaning  the existing  name  (if  any)  is  used.    A
                 specific  file name  may  be entered.    *NONE may  be
                 specified   meaning  that   any  selected   /COPY  and
                 /INCLUDE statements  will  be output  without  a  file
                 name.   If NEWFILE(*NONE) is  specified, NEWLIB(*NONE)
                 must also be used.

   NEWLIB        The  name  of  the  new  library  to be  used  in  any
                 selected  /COPY  and  /INCLUDE statements.    *SAME is
                 the default  meaning  the existing  name  (if any)  is
                 used.    A  specific  library  name  may  be  entered.
                 *NONE  may  be  specified  meaning  that any  selected
                 /COPY and /INCLUDE statements  will be output  without
                 a library name.

   NEWMBR        The  name  of  the  new  member  to  be  used  in  any
                 selected  /COPY  and /INCLUDE  statements.    *SAME is
                 the default  meaning the  existing name  is used.    A
                 specific member name may be entered.

   OPTION        Whether  to list  only the  proposed  changes or  make
                 the changes.

                 *CHECK  is  the  default  meaning  only  the  proposed
                 changes are listed.

                 *CHANGE   may  be   specified  meaning   the  proposed
                 changes are  made  to  /COPY and  /INCLUDE  statements
                 and  the  source  is  updated.    A  listing  is  also
                 output.

                 The  source is  not  changed if  no /COPY  or /INCLUDE
                 statements are  found or  the SELxxx  criteria is  not
                 found.

   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 *ALL authority to the source file to use CHGRPGCPY.

Only the previously described formats are provided for.

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

The following TAA Tools must be on your system:

     CHKNAM          Check name
     CHKOBJ3         Check object 3
     CVTMBRLST       Convert member list
     HLRMVMSG        HLL Remove message
     RSNLSTMSG       Resend last message
     RTVDAT          Retrieve date
     RTVDBFA         Retrieve data base file attributes
     RTVSYSVAL3      Retrieve system value 3
     SNDCOMPMSG      Send completion message
     SNDESCINF       Send escape information
     SNDESCMSG       Send escape message

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

None, the tool is ready to use.

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

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

   CHGRPGCPY     *CMD                   TAARPHU       QATTCMD
   CHGRPGCPY2    *CMD                   TAARPHU2      QATTCMD
   TAARPHUC      *PGM       CLP         TAARPHUC      QATTCL
   TAARPHUC2     *PGM       CLP         TAARPHUC2     QATTCL
   TAARPHUR      *PGM       RPG         TAARPHUR      QATTRPG
   TAARPHUR2     *PGM       RPGLE       TAARPHUR2     QATTRPG
   TAARPHUR3     *PGM       RPGLE       TAARPHUR3     QATTRPG

Structure
---------

CHGRPGCPY  Cmd
  TAARPHUC   CL
    TAARPHUR   RPG

CHGRPGCPY2  Cmd
  TAARPHUC2  CL
    TAARPHUR2  RPGLE
    TAARPHUR3  RPGLE
					

Added to TAA Productivity tools January 15, 2010


Home Page Up to Top