TAA Tools
CRTRPGENT       CREATE RPG ENTRY PARAMETERS            TAARPHS

The Create RPG  Entry Parameters command  creates the *ENTRY  PLIST and
PARM  statements for an  RPG or RPGLE  source member.   The information
is  extracted from a CALL and parameter  list from a program (CLP, RPG,
or  single module  RPGLE/CLLE)  or  from  the keywords  of  a  command.
After  adding  an RPG  source  member, CRTRPGENT  may  be  used to  add
records for the *ENTRY PLIST and PARM statements.

This  simplifies building  the  proper interface  between a  program or
command which invokes an RPG program.

To perform  the inverse  function of  creating the  call and  parameter
list to call a program, see the CRTRPGCALL command.

To use  CRTRPGENT, the  source for  the program  or command must  still
exist  where the  object was created  from.   This prevents the  use of
CRTRPGENT if a system program or command is specified.

A typical use of  CRTRPGENT is where  you want to do  a call from  PGMA
to an RPG or  RPGLE program named PGMB.   PGMA could be a CLP,  RPG, or
single  module RPGLE/CLLE program.   Assume,  you have  already created
PGMA with a call and parameter list to PGMB.

A  source  member must  exist  for PGMB  and  the source  type  (RPG or
RPGLE) defines  how the PLIST  and PARM  statements will be  formatted.
After ensuring  that the  PGMB source member  exists, use  CRTRPGENT to
generate  the required *ENTRY PLIST and  PARM statements needed to pass
the parameters from  PGMA.   Assume that  PGMA is an  RPG program  with
the following statements:

     C                     CALL 'PGMB'
     C                     PARM           PARM1   5
     C                     PARM           PARM2  10
     C                     PARM           PARM3   30

Any externally  described files used by  the program must exist  on the
library list.

It  is not  necessary to define  the lengths  of the parameters  on the
PARM statement.  As  long as the definitions  exist within the  source,
CRTRPGENT will  find the definitions.   The source  member to be  added
to must be of type RPG or RPGLE.

After adding  a member for PGMB  (assume it is an RPG  type), you would
enter:

            CRTRPGENT   SRCMBR(PGMB) OBJ(PGMA) OBJTYPE(*PGM)

The following statements would be added to the PGMB member:

     C           *ENTRY    PLIST
     C                     PARM           PARM1   5
     C                     PARM           PARM2  10
     C                     PARM           PARM3   30

You  will probably  need to move  these statements to  the proper place
within the source.

Another typical  example is where  you want  an RPG program  to be  the
CPP of a command.

Assume  you created the  command CMD1  using command  definition source
and it  has the following keywords KWD1, KWD2,  and KWD3.  You then add
a member to the QRPGSRC file named RPG1 and enter:

            CRTRPGENT   SRCMBR(CMD1) OBJ(RPG1) OBJTYPE(*CMD)

The following statements would be added to the RPG1 member:

     C           *ENTRY    PLIST
     C                     PARM           KWD1   nn
     C                     PARM           KWD2   nn
     C                     PARM           KWD3   nn

The length  and  decimal positions  would  be  specified based  on  the
definition in  the command  source.   Keyword types  *DATE, *TIME,  and
*PNAME are changed to TYPE(*CHAR).

Note  that if a parameter  is defined by QUAL  or ELEM statements, only
the passed in parameter is defined.

CRTRPGENT escape messages you can monitor for
---------------------------------------------

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

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

   SRCMBR        The source member  to have CL  statements for PGM  and
                 DCLs written to.  The member must exist.

                 The  source  type   of  the  member  (RPG   or  RPGLE)
                 determines how  the PLIST and PARM  statements will be
                 formatted.

   OBJ           The  qualified  name  of  the  object  to  create  the
                 *ENTRY PLIST  and PARM  statements from.   The  object
                 must  be a  *CMD or  *PGM.   If a  *PGM type,  it must
                 have  an attribute of CLP,  RPG, or RPGLE/CLLE (single
                 module).

                 The source  member  used  to create  the  object  must
                 still exist where  the object was created  from.  This
                 prevents  the  use  of  naming  a  system  program  or
                 command.

                 The library qualifier defaults  to *LIBL.  A  specific
                 library or *CURLIB may also be used.

   OBJTYPE       The type  of object  to access  the definitions  from.
                 Only  *PGM and *CMD  objects are  supported.   *PGM is
                 the default.

   SRCFILE       The  qualified name of  the source file  where the RPG
                 or RPGLE  member  exists  which will  have  statements
                 added to.  QRPGSRC is the default.

                 The library  qualifier defaults to *LIBL.   A specific
                 library, or *CURLIB may also be used.

   CALLNAME      The  value in  Factor 2 to  identify the  CALL Op code
                 to be used  or the  source sequence  number where  the
                 CALL  exists.    Three  possible entry  types  may  be
                 made:

                 1) The  default is *FIRSTCALL which  should be used if
                 you want the first  or only CALL in  the source.   For
                 OBJTYPE(*CMD), *FIRSTCALL must be used.

                 2) The  name  of the  program on  the CALL  statement.
                 The first  value that matches will be  used.  For RPG,
                 the  string of data  is used to  scan against Factor 2
                 of a  CALL  Operation code.   For  CL,  the string  of
                 data is  used to  scan the name  in the  PGM parameter
                 of a CALL command.

                 If  you have  a literal  as the program  name, specify
                 the literal value.   If you have a  field name as  the
                 program name, specify  the field name.   This value is
                 intended  for  when  there is  a  unique  Call in  the
                 program that is not the first CALL operation.

                 3) The statement number  of the CALL  operation.  A  6
                 digit entry must  be used with all digits  entered and
                 no   decimal  point.     For  example,  if   the  CALL
                 operation  is  at  statement  150.00  in  SEU, specify
                 015000 as the statement number.

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

The source used to create  the program named in the PGM  parameter must
still  exist where the  program was  created from.   This  prevents the
use  of  CRTRPGENT  when  the  named  object  is  a  system program  or
command.

The number of RPG parameters is  limited to 100.  The source member  to
be added to must be of type RPG or RPGLE.

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

The following TAA Tools must be on your system:

     CHKOBJ3         Check object 3
     EDTVAR          Edit variable
     HLRMVMSG        HLL Remove message
     RSNLSTMSG       Resend last message
     RTVCLPCALL      Retrieve CLP call
     RTVDAT          Retrieve date
     RTVDBFA         Retrieve data base file attributes
     RTVRPGCALL      Retrieve RPG call
     RTVOBJTYPD      Retrieve object type description
     SNDCOMPMSG      Send completion message
     SNDDIAGMSG      Send diagnostic message
     SNDESCINF       Send escape information
     SNDESCMSG       Send escape message
     SNDSTSMSG       Send status message

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

None, the tool is ready to use.

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

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

   CRTRPGENT     *CMD                   TAARPHS       QATTCMD
   TAARPHSC      *PGM       CLP         TAARPHSC      QATTCL
   TAARPHSR      *PGM       RPG         TAARPHSR      QATTRPG
					

Added to TAA Productivity tools June 30, 2007


Home Page Up to Top