The RTVPGMA command allows you to extract one or more parameters from
an existing program into a CL program. This can be used for various
functions in working with programs. An option exists to return the
source information for single module ILE programs. See the
RTVILEPGMA and RTVILEMODA commands for additional information about
ILE programs.
RTVPGMA uses the API QCLRPGMI to access the information.
A typical use of the command is to extract the USRPRF parameter to
determine if the program adopts authority:
DCL &USRPRF *CHAR LEN(10)
.
.
RTVPGMA PGM(PGMA) USRPRF(&USRPRF)
IF (&USRPRF *NE '*OWNER') DO .....
The command parameters may be prompted for with the command. The
value in the parenthesis for each parameter describes the length and
type of field to be specified in your CL program to receive the
parameter.
Command parameters *CMD
------------------
PGM The qualified program name. The library defaults to
*LIBL.
RTNLIB An optional return variable that will contain the
library name where the program was found. The value
may be helpful if the program is accessed without a
specific library name. If specified, the variable
must be declared as *CHAR LEN(10).
TYPE An optional return variable that will contain the
type of program (OPM or ILE). If specified, the
variable must be declared as *CHAR LEN(3).
OPTIMIZE An optional return variable that will contain the
value of *OPTIMIZE or *NOOPTIMIZE for whether the
program has been optimized. If specified, the
variable must be declared as *CHAR LEN(11).
OBSERV An optional return variable that will contain the
value of *ALL, *NONE, *UNOB (*UNOBS) for whether
observability has been removed. If specified, the
variable must be declared as *CHAR LEN(5).
USRPRF An optional return variable that will contain the
value of *USER or *OWNER. *OWNER means the program
will adopt the owners authority. If specified, the
variable must be declared as *CHAR LEN(10).
USEADPAUT An optional return variable that will contain the
value of *YES or *NO for whether the program allows
any adopted authority from higher in the program
stack to be used. If specified, the variable must
be declared as *CHAR LEN(4).
This differs from the USRPRF information which
determines whether the program will adopt the owners
authority.
LOGCLPGM An optional return variable that will contain the
value of *YES or *NO based on the LOG parameter of a
CL program. If specified, the variable must be
declared as *CHAR LEN(4).
ALWRTVSRC An optional return variable that will contain the
value of *YES or *NO based on the ALWRTVSRC
parameter of a CL program. If specified, the
variable must be declared as *CHAR LEN(4).
FIXDECDTA An optional return variable that will contain the
value of *YES or *NO based on the FIXDECDTA
parameter of certain HLL programs. If specified,
the variable must be declared as *CHAR LEN(4).
The FIXDECDTA value can only be set by certain types
of HLLs and can be seen by the DSPPGM command. This
is not the same as the IGNDECERR parameter on
CRTRPGPGM. The RPG function cannot be seen by
DSPPGM or accessed via RTVPGMA. It can be seen
using the TAA tool DSPRPGIGN.
TEXT An optional return variable that will contain the
text description of the program. If specified, the
variable must be declared as *CHAR LEN(50).
OWNER An optional return variable that will contain the
owner of the program. If specified, the variable
must be declared as *CHAR LEN(10).
ATTR An optional return variable that will contain the
attribute of the program such as CLP, RPG, etc. If
specified, the variable must be declared as *CHAR
LEN(10).
CRTDAT An optional return variable that will contain the
create date of the program in the form
cyymmddhhmmss. If specified, the variable must be
declared as *CHAR LEN(13).
ILESNGMOD A *YES/*NO option for whether the source information
(such as source member name) should be filled for
single module ILE programs. *NO is the default
meaning the source information will be blank for ILE
programs.
*YES may be specified to return the source
information for single module ILE programs. See the
return values for SRCDAT, SRCMBR, SRCFILE, and
SRCLIB.
A value of *YES is ignored for OPM programs and
multi-module ILE programs.
SRCDAT An optional return variable that will contain the
last source change date of the member used to create
the program in the form cyymmddhhmmss. The field is
blank for multi-module ILE programs. If a single
module ILE program is specified with
ILESNGMOD(*YES), the last source change date from
the member is used. If specified, the variable must
be declared as *CHAR LEN(13).
SRCMBR An optional return variable that will contain the
name of the source member used to create the
program. The field is blank for multi-module ILE
programs. If a single module ILE program is
specified with ILESNGMOD(*YES), the source member
used to create the the module is returned. If
specified, the variable must be declared as *CHAR
LEN(10).
SRCFILE An optional return variable that will contain the
name of the source file used to create the program.
The field is blank for multi-module ILE programs.
If a single module ILE program is specified with
ILESNGMOD(*YES), the source file used to create the
module is returned. If specified, the variable must
be declared as *CHAR LEN(10).
SRCLIB An optional return variable that will contain the
name of the source file library used to create the
program. The field is blank for multi-module ILE
programs. If a single module ILE program is
specified with ILESNGMOD(*YES), the source library
used from the module is returned. If specified, the
variable must be declared as *CHAR LEN(10).
COMPILER An optional return variable that will contain the
name of the compiler used to create the program. In
general, this is the release ID of the system when
the program was created. If specified, the variable
must be declared as *CHAR LEN(14).
MINRLS An optional return variable that will contain the
release ID of the minimum release version that the
program is capable of running on. If specified, the
variable must be declared as *CHAR LEN(6).
DOMAIN An optional return variable that will contain the
domain the program may run in. The values are
S=System, and U=User. If specified, the variable
must be declared as *CHAR LEN(1).
PGMSTATE An optional return variable that will contain the
program state. The values are I=Inherit, S=System,
and U=User. If specified, the variable must be
declared as *CHAR LEN(1).
CONVRQD An optional return variable that will contain a Y or
N for whether conversion is required (to RISC).
This parameter is only meaningful on a RISC system
(release V3R6 or later). If specified, the variable
must be declared as *CHAR LEN(1).
MAXPARMS An optional return variable that will contain the
maximum number of parameters that may be passed to
the program. A -1 is returned if the program is not
observable. If specified, the variable must be
declared as *DEC LEN(5 0).
MINPARMS An optional return variable that will contain the
minimum number of parameters that may be passed to
the program. A -1 is returned if the program is not
observable. If specified, the variable must be
declared as *DEC LEN(5 0).
SIZE An optional return variable that will contain the
size of the program in bytes. If specified, the
variable must be declared as *DEC LEN(11 0).
SRTSEQTBL An optional return variable that will contain the
sort sequence table name used when the program was
created. The value will be blank if none was used
when the program was created. If specified, the
variable must be declared as *CHAR LEN(10).
SRTSEQTBLL An optional return variable that will contain the
sort sequence table library name used when the
program was created. The value will be blank if
none was used when the program was created. If
specified, the variable must be declared as *CHAR
LEN(10).
LANGID An optional return variable that will contain the
language ID used when the program was created. The
value will be blank if none was used when the
program was created. If specified, the variable
must be declared as *CHAR LEN(10).
NBRMODS An optional return variable that will contain the
number of modules if the TYPE is ILE. If specified,
the variable must be declared as *DEC LEN(5 0).
NBRSRVPGMS An optional return variable that will contain the
number of service programs if the TYPE is ILE. If
specified, the variable must be declared as *DEC
LEN(5 0).
NBRCPYRGTS An optional return variable that will contain the
number of copyrights if the TYPE is ILE. If
specified, the variable must be declared as *DEC
LEN(5 0).
ACTGRP An optional return variable that will contain the
activation group name that the program runs in, if
the TYPE is ILE. Possible values are *NEW,
*DFTACTGRP, *CALLER, the activation group name, or
blank for OPM programs. If specified, the variable
must be declared as *CHAR LEN(30).
Prerequisites
-------------
None.
Implementation
--------------
None, the tool is ready to use.
Objects used by the tool
------------------------
Object Type Attribute Src member Src file
------ ----- --------- ---------- -----------
RTVPGMA *CMD TAAPGMA QATTCMD
TAAPGMAC *PGM CLP TAAPGMAC QATTCL
|