TAA Tools
RTVRPGPARM      RETRIEVE RPG PARAMETERS                TAARPGR

The Retrieve RPG  Parameters command returns the information  about the
parameters  that  are  passed   into  RPG.    The  parameter  name  and
attributes   of  each  parameter  defined   on  the  *ENTRY  PLIST  are
returned.  The source member must be named.

A typical command would be:

             DCL        &RTNPRM *CHAR LEN(1000)
             DCL        &RTNVAL *CHAR LEN(1000)
             DCL        &NBRPRM *DEC LEN(3 0)
              .
             RTVRPGPARM MBR(&SRCMBR) SRCFILE(&SRCLIB/&SRCF) +
                          RTNPRM(&RTNPRM) RTNVAL(&RTNVAL) +
                          NBRPRM(&NBRPRM)

The RTNPRM parameter  has the names  of each parameter specified  after
the  *ENTRY PLIST.   The  parameter  is designed  for array  processing
with  each name 10 bytes long.   There is room  for 100 parameters (the
system limits the number  to a smaller value).   The array is built  in
inverse  order (the  first parameter  is  at element  100 in  positions
991-1000, the  second parameter is at element  99 in positions 981-990,
etc.

The RTNVAL  parameter  has  the  attributes of  the  parameters.    The
parameter  is   designed  for  array   processing  with  each   set  of
attributes as  a data structure 10  bytes long.  The array  is built as
an  alternating array  for the field  names in RTNPRM.   The definition
of the 10 byte data structure is defined in the RTVRPGFLD tool.

The  RTVRPGFLD tool  is  used to  retrieve  the  information.   It  has
restrictions regarding the RPG source.

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

   MBR           The source member name.  It must be an RPG type.

   SRCFILE       The  qualified source  file name  of the  source file.
                 QRPGSRC  is the  default in  *LIBL.  *CURLIB  may also
                 be used as a library qualifier.

   RTNPRM        A required return  variable that  must be declared  as
                 *CHAR LEN(1000).

                 The value  will contain the  names of  the parameters.
                 The value  is designed for array  processing with each
                 name  10  bytes   long.    There   is  room  for   100
                 parameters  (the  system   limits  the  number   to  a
                 smaller value).   The array is built  in inverse order
                 (the  first parameter  is at element  100 in positions
                 991-1000, the  second parameter  is at  element 99  in
                 positions 981-990, etc.

   RTNVAL        A required  return variable  that must be  declared as
                 *CHAR LEN(1000).

                 The   value  will   contain  the  attributes   of  the
                 parameters.    The   value  is   designed  for   array
                 processing  with each  set  of  attributes as  a  data
                 structure  10 bytes long.   The  array is built  as an
                 alternating array  for  the  field  names  in  RTNPRM.
                 The  definition  of  the 10  byte  data  structure  is
                 defined in the RTVRPGFLD tool.

   NBRPRM        An  optional  return variable  that  will contain  the
                 number  of parameters in  the RTNPRM value.   If used,
                 NBRPRM must  be  specified as  *DEC  LEN(3 0).    This
                 value  is useful  if  you  are writing  a  DO loop  to
                 process the parameter information.

   NBRFLD        An  optional  return variable  that  will  contain the
                 number of fields  defined in  the source  member.   If
                 used, NBRFLD must be specified as *DEC LEN(5 0).

   RQDEXTDSC     Determines  whether  any  externally  described  files
                 are   required.    *YES   is  the  default.     If  an
                 Externally  Described   file  is   specified  in   the
                 source,  it must  exist  on  the  library list  or  an
                 escape message will occur.

                 *NO may  be specified in  which case if  an Externally
                 Described  file exists,  the field  specifications are
                 used.   If  an  Externally  Described  file  does  not
                 exist,  no error  occurs,  but  the information  about
                 some of the fields may be missing.

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

The  RTVRPGFLD tool is  used internally to determine  the attributes of
the fields.  RTVRPGFLD has restrictions regarding the RPG source.

Because RTVRPGPARM  returns variables,  it may  only be  used  in a  CL
program.

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

The following TAA Tools must be on your system:

     HLRMVMSG        HLL Remove message
     RTVRPGFLD       Retrieve RPG field descriptions
     SNDESCMSG       Send escape message

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

None, the tool is ready to use.

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

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

   RTVRPGPARM    *CMD                   TAARPGR       QATTCMD
   TAARPGRC      *PGM       CLP         TAARPGRC      QATTCL
   TAARPGRR      *PGM       RPG         TAARPGRR      QATTRPG
					

Added to TAA Productivity tools August 1, 1996


Home Page Up to Top