TAA Tools

The Scan RPG Field Names  command scans any type of RPG  source for one
or more  string of characters that  are found within field  names.  The
tool  can be  used as a  Year 2000 assist  to find the  uses of strings
such as DAT,  DT, YR,  YEAR, MON, MONTH  or any general  scan need.   A
single  member,  generic members,  or  all members  in  a  file may  be

A typical command would be:

             SCNRPGFLD     MBR(xxx) FILE(QRPGSRC)
                             SCNVALUE(YEAR YR MON MONTH DAY DY)

A  listing would be  produced with  one line for  each time  one of the
scan values was found in a statement.

If generic  or *ALL  members are  specified, non-RPG  source types  are

To provide  a standard  solution for  your situation,  a data area  may
also contain  the scan values.   See the next section  of how to create
your own standard values.

Creating your own standard values

You may decide that  values such as DAY,  DY, MONTH, MTH should  always
be included  in most of  your use of  SCNRPGFLD.  The  DTAARA parameter
defaults  to *DFT which  means that  an attempt  is made to  access the
SCNRPGFLD  data area using the qualified  library portion of the DTAARA
parameter (default is *LIBL).

If the data  area does not  exist, no error occurs.   If the  data area
does exist, any data is extracted and used as scan values.

To  create  the  data  area  to  be used  with  DTAARA(*DFT),  you  can
duplicate a standard version from TAATOOL:

                          TODTAARA(xxx/SCNRPGFLD) CRTDTAARA(*YES)

You then edit the data area with the CONARR edit command:


When  the edit display appears, you will  see some standard values such
as DAY, DY, MONTH, MTH already  entered.  You may either keep these  or
change them for your own needs.

There  is  room  for  45  fields that  appear  to  be  20  bytes  long.
However, the  length you can key  is restricted to 10  bytes per entry.
If you are scanning  RPG III source, you  must restrict the scan  value
to 6 or less.

The entry must  be a valid name  meaning values like M1D are  valid but
not 1MD.   The entry cannot begin  with a *.  If  you are interested in
scanning  for *UDATE,  all the  occurrences will  be found  by scanning
for DATE.

After you  have entered  the  data, you  can use  the  default for  the
DTAARA parameter.

If you  have specified  duplicate values within  the data area,  on the
SCNVALUE  parameter, or  in combination, they  are not  loaded into the
internal array used to scan.  No error occurs.

If you  have a  need for  a  specific set  of values  such as  you  are
checking  within  an  application  area,  you  can  create  a  separate
SCNRPGFLD  data  area for  a  unique  purpose and  specify  it  for the
DTAARA parameter (it does  not have to be  named SCNRPGFLD).  Just  use
CRTDUPOBJ as described  previously to duplicate the TAARPGVZ  data area
in TAATOOL or from a clone you have created.

Scan technique

Only RPG  source types are  scanned.  Comment  specs (* in  position 7)
are  bypassed.   Records with  / values  in position 7  including /COPY
are bypassed.

Only the spec  types D, E,  I, C, and  O are scanned  and only for  the
specific  location  of the  field  name  within  the spec.    Different
locations  are used  for RPG  and RPGLE  type source.   The  scan value
must be  found  within one  source  line and  cannot  be split  over  a
continuation line.

The first 98 bytes of the source are scanned.

Scanning other non-RPG source types

SCNRPGFLD  is  limited  to  RPG  source types.    For  a  general  scan
facility, see the SCNSRC tool.

Command parameters                                    *CMD

   MBR           The  member  to  be scanned.    A  specific member,  a
                 generic name, or  *ALL may be  specified.  If  generic
                 or  *ALL  is  used,  the   non-RPG  source  types  are

   FILE          The qualified  file name of the file.   The default is
                 QRPGSRC.     The  library  value  defaults  to  *LIBL.
                 *CURLIB may also be used.

   SCNVALUE      A list of up  to 25 scan values.   Each value will  be
                 scanned against each field name.

                 The  default is  *NONE meaning  that all  of  the scan
                 values  are to be found in the  data area named in the
                 DTAARA parameter (both SCNVALUE  and DTAARA cannot  be

                 You  may  use  both   the  DTAARA  parameter  and  the
                 SCNVALUE  parameter  to  produce  a  combined list  of
                 scan values (70 in total).

                 You may enter  a string of  up to 10  characters.   If
                 you are  scanning RPG  III source,  you must  restrict
                 the scan value to 6 or less.

   DTAARA        The  data  area where  the  standard  scan values  are
                 found.   The  default is  *DFT which  means an attempt
                 is made to  access the SCNRPGFLD  data area using  the
                 qualified  library portion  of the  parameter (default
                 is *LIBL).

                 If  the data area  does not exist, no  values are used
                 and no error  occurs.   If the data  area does  exist,
                 the data is  extracted from the data area  and used as
                 scan values.

                 You  may have  your own specific  data area  unique to
                 your application.    See the  previous  discussion  on
                 how to create a data area for use by SCNRPGFLD.

   SPLFILES      The  number of  spooled  files  that will  be  output.
                 The default  is *ONE.   The default must  be used when
                 a single member is specified.

                 If  you  have specified  a generic  set of  members or
                 all members,  you  have a  choice  as to  whether  the
                 output  will  be  one  spooled file  with  information
                 from  all members or a separate  spooled file for each
                 member.  To provide a  separate spooled file for  each
                 member, specify *MULT.


See the previous discussion on the scan technique.


The following TAA Tools must be on your system:

     CHKGENERC       Check generic
     EDTVAR          Edit variable
     EXTLST2         Extract list 2
     HLRMVMSG        HLL Remove message
     RTVCONARR       Constant array
     RTVMBRLST2      Retrieve member list 2
     RTVSYSVAL3      Retrieve system value 3
     SNDCOMPMSG      Send completion message
     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
   ------        ----    ---------      ----------    ----------

   SCNRPGFLD     *CMD                   TAARPGV       QATTCMD
   TAARPGVC      *PGM       CLP         TAARPGVC      QATTCL
   TAARPGVR      *PGM       RPG         TAARPGVR      QATTRPG

Added to TAA Productivity tools February 1, 1997

Home Page Up to Top