TAA Tools

The Scan and  Update CL Source command  scans one or all members  of CL
or  CMD  source  for an  argument  and  if  found  replaces it  with  a
replacement  value.   The replacement value  can be the  same length, a
shorter  length,  or a  longer  length.    The  source  is  reformatted
similar to prompting in SEU.

SCNUPDCL  provides the the  same function  as exists  in SEU  using F14
Find/Change  except  that  it  is  done  by  command  without  operator
interaction.  Multiple members are also supported.

The FNDSTRPDM command will allow  the scanning of multiple members  for
a value, but does not provide a replacement capability.

A typical SCNUPDCL command would be:


The default is to  use the first QCLSRC file found on  the library list
and  to  replace  the corresponding  members.    Each  member would  be
scanned for  'LIB1'.    If  found, the  source  would  be  shifted  one
position and 'LIB23' inserted.  For example, if the statement was:

             CALL       PGM(LIB1/PGM1) PARM(&PARM1)

The revised source would be:

             CALL       PGM(LIB23/PGM1) PARM(&PARM1)

All source  statements (whether the  scan result is  found or not)  are
reformatted as  if prompting was used on each  statement.  All keywords
would be inserted.

If the argument exists within a comment, it is not replaced.

SCNUPDCL escape messages you can monitor for

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

Command parameters                                    *CMD

   MBR           The  member to  be scanned  and updated.   The special
                 value *ALL exists  to scan and  update all members  in
                 a source  file.  Only  the members of source  type CL,
                 CLP,   CLP38,  CLLE,  or  CMD   will  be  scanned  and

   ARGUMENT      The argument to be searched  for.  Up to 20 bytes  may
                 be specified.

   RPLVALUE      The value  to replace  the argument  with.   Up to  20
                 bytes  may be specified.   The  value may be  the same
                 length  as  the  argument,  a  shorter  length,  or  a
                 longer length.

   INPSRCF       The  qualified file  name of  the  input source  file.
                 The  library value  defaults  to *LIBL.    *CURLIB may
                 also  be used.  The file must  be a source file with a
                 record length of 92 to  240 (80 - 228 bytes  of data).

   OUTSRCF       The  qualified file  name of  the output  source file.
                 The    file   defaults   to   *INPSRCF   meaning   the
                 reformatted source will be  written back to the  input
                 source file member if no errors occur.

                 The library  qualifier defaults  to blank  which means
                 to  use the  same library  as the  INPSRCF.   *LIBL or
                 *CURLIB may also be used.   The file must be a  source
                 file with  a  record length  of 92  to 240  (80 -  228
                 bytes of data).

                 If  a   single  member  is  being   reformatted  to  a
                 different  file (not  being updated),  the member must
                 not exist.

                 If  all  or  generic  members  in  a  file  are  being
                 reformatted  to  a  different  file,  no  members  may
                 exist  in the output  source file.   Any members which
                 are not of a  type CL, CLP, CLP38,  CLLE, or CMD  will
                 be identified  on the listing  and will not  appear in
                 the output file.

   ALWLDGCOM     A  *YES/*NO  parameter  that  defaults  to *YES  which
                 allows any comments  to the  left of a  command to  be
                 retained.    The comment  must  be  totally  contained
                 within  the first 13  positions of the  source record.

                 If  you  place a  comment in  positions 1-13  before a
                 command and then  prompt for the  command in SEU,  the
                 string  that is  returned  places the  comment at  the
                 end of the command.

                 *NO  causes any comments  in 1-13 to be  placed at the
                 end of the  command as if you  had prompted with  SEU.

   SEQNBRS       The  default is  *RESEQ which  causes the  reformatted
                 source to be sequenced as 1.00, 2.00 etc.

                 The  value  *SAME causes  SCNUPDCL to  attempt  to use
                 the same  sequence numbers  as  were input.    Because
                 some commands  are contained  on multiple records  and
                 the number  of output records  may not be  the same as
                 the  number of input records,  some changes may occur.
                 The  sequence  number of  the  first  record  of  each
                 command  is used as  a base.   Each  additional record
                 to  be output for  the same command is  bumped by .01.

                 Thus for  SEQNBRS(*SAME), if  the  first record  of  a
                 command was  78.00, the  first record  output for  the
                 command  would be 78.00.   Any  additional records for
                 the same command would be 78.01, 78.02 etc.

   MAXFMTWTH     The  maximum  formatting  width  to  be  used.     The
                 default  is *FILE  to  format  the statements  to  the
                 length of the source statements within the file.

                 A  length  can  be specified  between  80  and 240  to
                 format the statement based on a shorter width.

                 For  example,  if  your  source  statements  are wider
                 than 80, but  you want to format  them for an 80  byte
                 wide display, specify MAXFMTWTH(80).


If the argument exists within a comment, it is not replaced.


The following TAA Tools must be on your system:

     CHKGENERC       Check generic
     CVTMBRLST       Convert member list
     EDTVAR          Edit variable
     HLRMVMSG        HLL Remove message
     RTVDBFA         Retrieve data base file attributes
     RTVSYSVAL3      Retrieve system value 3
     SNDCOMPMSG      Send completion message
     SNDESCINF       Send escape information
     SNDESCMSG       Send escape message
     SNDSTSMSG       Send status message


None, the tool is ready to use.

Objects used by the tool

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

   SCNUPDCL      *CMD                   TAACLRK       QATTCMD
   TAACLRKC      *PGM       CLP         TAACLRKC      QATTCL
   TAACLRKC2     *PGM       CLP         TAACLRKC2     QATTCL
   TAACLRKR      *PGM       RPG         TAACLRKR      QATTRPG

Added to TAA Productivity tools December 1, 2004

Home Page Up to Top