TAA Tools
CRTCLPENT       CREATE CLP ENTRY PARAMETERS            TAACLRY

The  Create CLP  Entry  Parameters  command  creates the  PGM  and  DCL
statements for  a CLP source  member using the call  and parameter list
from  a program  (CLP, RPG,  or single  module RPGLE/CLLE) or  from the
keywords of  a command.   After adding  a CL  source member,  CRTCLPENT
may  be used  to add  records for  the PGM  and DCL  statements.   This
simplifies  building the proper interface between  a program or command
which invokes a CL program.

To perform the inverse function of  creating a CALL and DCLs to call  a
program, see the CRTCLPCALL command.

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

A typical use of  CRTCLPENT is where  you want to do  a call from  PGMA
to a  CL  program named  PGMB.   PGMA could  be  a CLP,  CLLE, RPG,  or
single  module  RPGLE  program.   Assume,  you  already  have the  call
operation  and parameter list  coded in PGMA  that you want  to pass to
PGMB.

To use CRTCLPENT, a  source member of type  CLP or CLLE must  exist for
PGMB.  After  adding the PGMB source member,  use CRTCLPENT to generate
the  required  PGM and  DCL statements  needed  to pass  the parameters
from PGMA.   Assume  the  PGMA is  an RPG  program with  the  following
statements:

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

It is  not necessary  to define the  lengths of  the parameters  on the
PARM  statement.  As long  as the definitions exist  within the source,
CRTCLPENT will find the definitions.

After adding a member for PGMB, you would enter:

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

The following statements would be added to the PGMB member:

             PGM        PARM(&PARM1 &PARM2 &PARM3)
             DCL        VAR(&PARM1) TYPE(*CHAR) LEN(5)
             DCL        VAR(&PARM2) TYPE(*CHAR) LEN(10)
             DCL        VAR(&PARM3) TYPE(*DEC) LEN(3 0)

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

Another typical use is  where you have created a user  command and want
to start coding the CPP.

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 QCLSRC file named CMD1 and enter:

            CRTCLPENT   SRCMBR(CMD1) OBJ(CMD1) OBJTYPE(*CMD)

The PGM and DCL statements would be added to member CMD1 as follows:

             PGM        PARM(&KWD1 &KWD2 &KWD3)
             DCL        VAR(&KWD1) ...
             DCL        VAR(&KWD2) ...
             DCL        VAR(&KWD2) ...

The TYPE and  LEN parameters would be  added based on their  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.

CRTCLPENT 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.

   OBJ           The qualified  name of  the object  to create  the PGM
                 and  DCL 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 CRTCLPENT  when 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  CLP
                 member  exists which  will have  statements added  to.
                 QCLSRC 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  150.00 in  SEU,  specify 015000  as  the
                 statement number.

   VARKWD        Whether to use  the VAR and TYPE keywords  for the DCL
                 commands.  *YES is the default.

                 *NO  may be specified  to use only  the keyword values
                 (the LEN keyword is used).

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

The source  for the  program  or command  must  still exist  where  the
object was created from.   This prevents the use of  CRTCLPENT when the
named object is a system program or command.

The number of command definition keywords is limited to 45.

The number of CLP parameters is limited to 100.

The source member to be added to must be a type CLP or CLLE.

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

The following TAA Tools must be on your system:

     CHKOBJ3         Check object 3
     EDTVAR          Edit variable
     RSNLSTMSG       Resend last message
     RTVCLPCALL      Retrieve CLP call parameters
     RTVCMDA         Retrieve command attributes
     RTVCMDPARM      Retrieve command parameters
     RTVDAT          Retrieve date
     RTVDBFA         Retrieve data base file
     RTVPGMA         Retrieve program attributes
     RTVRPGCALL      Retrieve RPG call parameters
     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
   ------        ----    ---------      ----------    ----------

   CRTCLPENT     *CMD                   TAACLRY       QATTCMD
   TAACLRYC      *PGM       CLP         TAACLRYC      QATTCL
   TAACLRYR      *PGM       RPG         TAACLRYR      QATTRPG
					

Added to TAA Productivity tools June 30, 2007


Home Page Up to Top