TAA Tools
SBMPARMS    EXTRACT PARMS FROM SOURCE AND ADD TO CRT CMDS   TAASRCD

This function  allows you to  store the CRT  command parameters in  the
corresponding  source member  as comment  lines.   For  example, assume
you   want  to  always  create  an   RPG  program  with  the  parameter
USRPRF(*OWNER).   You would  enter the  first source  statement of  the
program as:

          F*PARMS USRPRF(*OWNER)

The function  works with either  the Programmer Menu or  the Programmer
Development Manager (PDM).

An  option also allows you  to specify REPLACE(*NO)  which will cause a
program object to  be deleted  before the create  command is  submitted
to  batch.   To  take this  option,  you  must create  a  data area  as
described later.

A  unique  special  value *EARRLS  (earliest  release)  exists for  the
TGTRLS  parameter.    This  typically  allows  a  create  for  the  2nd
previous release.  For  example, if you are on V7R5M0,  you may specify
TGTRLS(*EARRLS)  and create an  object for  V7R3M0.  The  TAA RTVPRVRLS
command  is used  to determine  the earliest  release an object  can be
created for.

An  option  also  exists  to  include  the  CHGPGM  or  CHGMOD  command
parameters within the source.  A typical statement would be:

          F*CHGPGM RMVOBS(*ALL) USEADPAUT(*NO)

The  *PARMS or  *CHGPGM statements  can be  mixed in  any order.   Both
commands  are assembled based on the source  statements read and run in
the sequence of CRT followed by CHGPGM (or CHGMOD).

Use with the Programmer Menu
----------------------------

To use the Programmer  menu, you would specify  the exit program  which
is specified  on the STRPGMMNU command.   The EXIT parameter  should be
specified as:

         STRPGMMNU    .....  EXITPGM(TAATOOL/TAASRCDC)

The  exit program (TAASRCDC) is  passed the contents  of the programmer
menu display.   If F4 has  been used (prompt  for command  parameters),
the CRT  command is  submitted to  batch and will  be executed  without
change.  If  F4 is not used, the CRT command is  used as a parameter to
the TAASRCDC2 program which is submitted to batch.

Use with PDM
------------

PDM  allows an  alternative to  define a user  option.   When the 'Work
with  Members using  PDM'  display  occurs,  you can  use  the  special
function keys to create your own option.

When  a user  option is  specified, you  cannot prompt  for  the CRTxxx
command  to be submitted.  All of  the command parameters which are not
passed from PDM, must be in the source.

You must  first consider  where you  want to  place the  options.   The
default is the  QAUOOPT file in QGPL.   You can see  which options file
is being used by specifying F18 'Change defaults'.

If you  do not want to  use the default, then you  must create your own
file.  A typical  solution would be to  use CRTDUPOBJ to duplicate  the
existing QAUOOPT  file in  QGPL to a  library of  your choice  (use the
same  name of  QAUOOPT).  Then  use the  'Change Defaults'  display and
modify the library for the QAUOOPT file.

After  you have  selected which  file to  use, the 'Work  With Members'
display should appear.   You can  use the F16  key for 'User  Options'.
This  will display  the 'Work  with User-Defined  Options'  display and
you  will see the  existing options.   To create a  new option, specify
F6.

A display will  appear named  'Create User-Defined Options'.   You  can
enter  a  2  character  ID  for  the   option.    You  may  choose  any
characters,  but a  typical entry  would be  'CP' (Create  with parms).
The command you  key in should  be as follows  (the SBMPDMPARM  command
has already been created).

  SBMPDMPARM    SRCFILE(&F) SRCLIB(&L) MBR(&N) OBJLIB(&O) MBRTYPE(&S)
                  JOBD('&J')

Be sure you put apostrophes around the JOBD value.

The variable names (like  &L) are used by PDM to  determine what should
be mapped into the command.

The  job description  value is  passed  from PDM.   It  can  be changed
using F18 (Change defaults).

Batch program
-------------

The  TAASRCDC2  program operates  in batch  and  opens the  source file
member to see if  the special form of  PARMS statement exists.  If  the
PARMS  statement exists,  the program  adds the  parameters to  the CRT
command.    The  CRT  command is  sent  as  a  request  message to  the
external message queue and the  TAASRCDC2 program transfers control  to
QCMD.

The following requirements exist with this support:

  1.   The parameters must  be specified in the first ten  records of a
       source  member.  One  thru ten statements  may be used  with the
       PARMS indication.   If  no  PARMS statement  is found,  the  CRT
       command is submitted  normally.  Note the exception  for CRTCMD.

       Other  comments  may  exist  in  the  source  in  the  first  10
       statements.  For example you may specify:

             /* This is the PAYROLL program */
             /*PARMS USRPRF(*OWNER) LOG(*YES)     */
             /*CHGPGM USEADPAUT(*NO)              */

       The CHGMOD command is similar such as:

             /*CHGMOD RMVOBS(*ALL)                */

       Only the first ten source statements are checked.

  2.   A  single  parameter  cannot  be  split  across  the  two source
       statements.

  3.   If F4 is  used from the  programmer menu (prompt for  additional
       parameters  on the  CRT command),  the source  member parameters
       are  ignored.  It is  assumed that the programmer  is issuing an
       override type function by the use of F4.

  4.   If CRTCMD  is used,  the TAASRCDC2  program blanks  out the  PGM
       parameter  as  submitted from  the  Programmer  Menu.   The  PGM
       parameter  must be defined in  your source.  The  intent of this
       is to  eliminate  the need  to  specify the  command  processing
       program each time a command is created.

  5.   The Programmer  Menu  does require  that you  have  an entry  in
       Parm  2.  The  normal solution is  to place any  character there
       (e.g.    X) as  the program  name.   The TAASRCDC2  program then
       blanks  out  the value  and  uses  the  PGM  parameter  in  your
       source.

  6.   The format of  the PARMS statement in the source  must be one of
       the following:

         --   RPG and DDS type of source

              This  is considered a 'fixed' form  of source.  The value
              *PARMS must  appear in  positions 7  - 12  followed by  a
              blank.  Positions  14-80 can be used  for parameters such
              as:

                     1
              7      4
             F*PARMS USRPRF(*OWNER) AUT(*EXCLUDE)
             F*PARMS TEXT('I prefer this rather than *SRCMBRTXT')
             F*PARMS IGNDECERR(*YES)
             F*CHGPGM RMVOBS(*ALL) USEADPAUT(*NO)
             F*CHGMOD RMVOBS(*ALL)

         --   CL and Command type of source

              This  is considered a 'free'  form of source.   The value
              /*PARMS must  appear in  positions 1  - 7  followed by  a
              blank.   Positions 9  - 80  can be  used for  parameters.
              The  */ characters  can  appear beyond  position  76 (SEU
              allows 71 characters of source without windowing).

             1       9
             /*PARMS USRPRF(*OWNER) LOG(*YES)     */
             /*PARMS ALWRTVSRC(*NO)                          */
             /*PARMS REPLACE(*NO)                 */
             /*CHGPGM RMVOBS(*ALL)           */
             /*CHGMOD RMVOBS(*ALL)           */

  7.   UIM type of source

       UIM  requires a comment to  be in the form of  .* ...  beginning
       in position 1.   The value *PARMS  must appear in positions  3 -
       7  followed  by  a  blank.    Positions 9-80  can  be  used  for
       parameters.     The  source  types   MENU  (CRTMNU)  and  PNLGRP
       (CRTPNLGRP) are supported.  The comments must appear as:

                     1
              1      4
              .PARMS TYPE(*UIM)
              .PARMS TEXT('I prefer this rather than *SRCMBRTXT')
              .PARMS REPLACE(*NO)

  8.   COBOL type of source

       While COBOL is  a free  form language, a  comment line  requires
       an  *  in position  7.    Consequently,  it  takes on  the  same
       attributes  as  the fixed  form  like  RPG or  DDS.    The value
       *PARMS must appear  in positions  7 -  12 followed  by a  blank.
       Positions  14-80  can  be used  for  parameters.    Because  the
       comment  lines  must  appear  as  the  first two  records  (i.e.
       before  the Identification  Division) a  warning diagnostic will
       appear on the compilation listing.  An example is:

                     1
              7      4
              *PARMS USRPRF(*OWNER) AUT(*EXCLUDE)
              *PARMS TEXT('I prefer this rather than *SRCMBRTXT')
              *PARMS REPLACE(*NO)
              *CHGPGM RMVOBS(*ALL)
              *CHGMOD RMVOBS(*ALL)

You may  wish  to  have your  own  convention  for how  parameters  are
described in the  source rather than those shown in  this example.  The
same  technique will  work, but you  must modify  the TAASRCDC2 program
to match your convention.

Some users may want to restrict  the use of certain CRT commands  (e.g.
CRTRPGPGM)  to  be executed  in  batch  only.    This can  be  done  by
specifying ALLOW(*BATCH)  on the CHGCMD command.   However, this cannot
be done  if F4  is  used from  the Programmer  menu.   By  placing  the
parameters  into the  source,  F4 does  not  have to  be  used and  the
specific CRT commands can be restricted to batch.

Since  the command parameters  are entered into  the source as  if they
were  comments, there is no syntax checking done  at entry time.  If an
invalid entry is  made, the CRT  command will fail  and a job  log will
be produced (assuming the default logging level).

To  assist in  making the  proper source  entry, the  TAASRCDC2 program
sends  messages to the job log showing  the correct format of the PARMS
source record  (based on  the source  type) as  well as  the first  two
records from the  source file/member.  If your  source PARMS statements
are  not being  correctly processed, use  the job  log from  your batch
job and review the special messages.

Source types supported
----------------------

Most of  the major  source types  are supported  including RPG,  RPGLE,
RPGMOD, CLP, CLLE, CLMOD, PF, LF, DSPF, CMD etc.

REPLACE option
--------------

In  the i5/OS  environment, the  CRTxxxPGM,  CRTCMD, CRTDSPF,  CRTPRTF,
and  CRTICFF  commands  default to  REPLACE(*YES).    If  you take  the
default  and the  new object  creates successfully,  the old  object is
placed in  QRPLOBJ and  the  security options  (authorizations and  the
USRPRF option on  programs) are copied from the  existing object to the
new  object.  If the new  object fails to create,  the old object still
exists in the same library.

REPLACE(*YES)  is  a  desirable   default  when  replacing   production
objects.   However,  when in  a development  mode, the  default can  be
very undesirable.

For  example, if the CRT  command fails, the programmer  may not notice
the failure and  call the  program.  This  will result  in calling  the
old version  of the program  and the programmer  may waste time  before
he realizes  what has happened.   A similar  function can occur  if the
programmer  calls the program  before it has  finished the create step.

To provide  a  solution, the  CL  program that  operates  interactively
(the CPP for  SBMPARMS), checks for the existence of  a data area named
SBMPARMS.   If it exists on the  library list, the existing object will
be deleted before the batch program is submitted.

To make  the function  operate as  REPLACE(*NO),  create the  following
data area in a library on your library list:

   CRTDTAARA      DTAARA(xxx/SBMPARMS) TYPE(*CHAR) LEN(1)
                   TEXT('Used by SBMPARMS to determine REPLACE(*NO)')

If the  data area exists  and the old  object is deleted,  any security
on  the  old object  is  lost.   The  new object  creates  with default
security unless you specify otherwise.

If  a   S/38   environment   CRTxxxPGM   command   is   executed,   the
REPLACE(*YES) option does not apply.  The program will be deleted.

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

  **   The TAASRCDC2 program  is written to  assume that the  file uses
       the  FIX  type  of  *PARMS  statement.    You may  need  to  add
       additional  IF...   CHGVAR statements  to change  the default to
       FREE  for  the  appropriate  command  names.    The  program  is
       written  to  assume  the  FREE  type  if  the  command  name  is
       CRTCLPGM or CRTCMD.

  **   The  program assumes the CRTCMD PGM  parameter will be specified
       in your source.

  **   Not all source types are supported.

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

The following TAA Tools must be on your system:

      PMTOPR       Prompt operator
      RTVPRVRLS    Retrieve previous release
      SCNVAR       Scan variable
      SNDCOMPMSG   Send completion message
      SNDESCMSG    Send escape message

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

The tool is ready to  use, but you need  a PDM option to be  effective.

See the earlier  discussion about how to create the  user option needed
to operate from PDM.

See the  earlier discussion about how to create  a data area to provide
the REPLACE(*NO) function for program re-creates.

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

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

   SBMPDMPARM    *CMD                      TAASRCD        QATTCMD
   TAASRCDC      *PGM          CLP         TAASRCDC       QATTCL
   TAASRCDC2     *PGM          CLP         TAASRCDC2      QATTCL
   TAASRCDC3     *PGM          CLP         TAASRCDC3      QATTCL
   TAASRCDC4     *PGM          CLP         TAASRCDC4      QATTCL

The SBMPARMS data  area is created  by you (if needed)  to achieve  the
REPLACE(*NO)  function  for  program  re-creates.    See  the  previous
discussion.

Structure
---------

Programmer menu

   TAASRCDC is the exit program
     Submits TAASRCDC2

PDM

   SBMPDMPARM is the command specified for user options
     TAASRCDC3   CL (Command processing program)
     Submits TAASRCDC4
					

Added to TAA Productivity tools April 1, 1995


Home Page Up to Top