TAA Tools
RTVPGMREFL      RETRIEVE PROGRAM REFERENCED LIBRARIES  TAAPGNW

The  Retrieve Program  Referenced Libraries  command  retrieves from  a
program  type   object  the  list  of  libraries   used  by  externally
described  files when  the program was  created.   The system DSPPGMREF
command is  used  to determine  the  files used  by  the program.    An
option exists  to add  the libraries  to the library  list if  they are
not  already on the list.   RTVPGMREFL can  be helpful when re-creating
a program or module.

A typical use of the RTVPGMREFL is as follows:

             DCL        &USRLIBL *CHAR LEN(2750)
              .
             RTVJOBA    USRLIBL(&USRLIBL)
             RTVPGMREFL OBJ(xxx) OBJTYPE(*PGM) ADDLIBLE(*YES)
                        /***********************************/
                        /*                                 */
                        /*   Your processing with the      */
                        /*   libraries used by xxx now     */
                        /*   on the library list           */
                        /*                                 */
                        /***********************************/
             RTNLIBL    USRLIBL(&USRLIBL)

The RTVJOBA command  returns the  current user portion  of the  library
list.   The RTVPGMREFL  command determines  the libraries  used by  the
program's  externally described  files.  The  unique library  names are
added to the  library list  if not  already present.   Your  processing
then occurs  followed  by the  TAA RTNLIBL  command  which returns  the
library list as it was when RTVJOBA was used.

Only file  objects are considered  by RTVPGMREFL.  If  the library name
is  a variable, it  is not added to  the library list.   By default, an
escape message will occur if a used library no longer exists.

RTVPGMREFL escape messages you can monitor for
----------------------------------------------

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

RTVPGMREFL Command parameters                         *CMD
-----------------------------

   OBJ           The qualified name  of the program object  to retrieve
                 from.    The  library  value  defaults to  *LIBL.    A
                 specific library or *CURLIB may also be used.

   OBJTYPE       The  object  type  to  retrieve  from.    *PGM is  the
                 default.    *MODULE,  *SRVPGM,   or  *SQLPKG  may   be
                 specified.

   LIBSUSED      The  libraries  used  by  externally  described  files
                 found in  the program.  The  DSPPGMREF command is used
                 to determine the  files and libraries.   Each  library
                 position is  11  bytes with  the library  name in  the
                 first  10.  If  a variable name  is used, the  name is
                 preceded  by  an  '&' and  the  name may  take  all 11
                 positions.

                 If  the  same  library  is  used  by  more   than  one
                 externally described  file, its name  will appear only
                 once in the list.

                 This  is  an optional  return parameter  that  if used
                 must be specified as *CHAR LEN(2750).

   ADDLIBLE      A *YES/*NO  parameter  for whether  to add  a  library
                 used by  an externally  described file to  the current
                 library list.

                 *YES  is the default.   If the  library already exists
                 on the  library  list,  no  change  occurs.    If  the
                 library is a variable, it is bypassed.

                 Typical processing  would be to  use RTVJOBA  with the
                 USRLIBL  parameter   to  retrieve  the   current  list
                 before  the use  of RTVPGMREFL,  perform your required
                 function, and then  restore the current list  with the
                 TAA RTNLIBL command.

                 *NO may be  specified to not add any  libraries to the
                 current library list.

   LIBEXIST      An  optional return  variable  that will  contain *YES
                 or *NO  for whether  all libraries  that  are used  by
                 externally  described files  still  exist.   If  used,
                 the  return   variable  must  be  specified  as  *CHAR
                 LEN(4).

   VARLIBNAM     An optional  return variable  that will  contain  *YES
                 or  *NO for  whether  any  of  the libraries  used  by
                 externally  described files  contain a  variable name.
                 If  used,  the return  variable  must be  specified as
                 *CHAR LEN(4).

   QTEMP         An optional  return variable  that  will contain  *YES
                 or *NO  for whether the  QTEMP library was used  by an
                 externally  described  file.    If  used,  the  return
                 variable must be specified as *CHAR LEN(4).


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

Because the  RTVPGMREFL command  may return  variables, RTVPGMREFL  may
only be used in a CL program.

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

The following TAA Tools must be on your system:

     CHKOBJ3         Check object 3
     RSNLSTMSG       Resend last 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
   ------        ----    ---------      ----------    ----------

   RTVPGMREFL    *CMD                   TAAPGNW       QATTCMD
   TAAPGNWC      *PGM       CLP         TAAPGNWC      QATTCL
					

Added to TAA Productivity tools September 15, 2007


Home Page Up to Top