TAA Tools
SCNRPGCOMP      SCAN RPG COMPARE                       TAARPGS

The Scan RPG  Compare tool is designed  as an aid to assist  in finding
potential year 2000 date problems.

Most potential  year 2000 date problems will occur  when two 6 position
date  fields  are  compared  for  other  than  'equal'  or  'non-equal'
conditions.   If you compare  for an  equal condition, the  application
should  work  the  same  in  the  year  2000.    However,  a  statement
comparing  two date fields in YYMMDD format  such as the following will
probably cause problems:

                DATE1      IFGT DATE2

The SCNRPGCOMP tool is designed to  find these problems.  It scans  for
fields  with  a  specified  length  that  are  used  in  some  form  of
comparison  such as  IFGT or  COMP with a  Hi or  Lo indicator.   EQ/NE
type comparisons are  excluded.   A specific  member, generic  members,
or all  members in  a file of  source type  RPG, RPG38,  RPG36, RPGMOD,
RPGLE  may be scanned.   A  spooled file  of the statements  that match
the criteria is produced.

A typical command would be:

             SCNRPGCOMP  MBR(xxx) SRCFILE(QRPGSRC) FLDLEN(6)

The  command finds the RPG operation codes  that may be used to compare
fields of a length 6.   Any EQ or NE type of comparisons  are excluded.

The Factor 1  and Factor 2 values of the statement  are then checked to
determine  the definition  of the  field.   If  it is  a *CHAR  or *DEC
field that  matches the length  specified, it  is printed.   *DEC  type
fields are only considered if they have 0 decimals.

You  need to  determine from  the listing  and looking  at your  source
whether the fields are date fields.

While SCNRPGCOMP  is not a perfect solution  for determining where your
year 2000 problems exist, it can  be very effective in pinpointing  the
code where you are most likely to have problems.

Statements copied in from  /COPY are considered both in  terms of field
definitions and in comparisons.

Library list implications
-------------------------

SCNRPGCOMP is  directed at a  source file.  If  an Externally described
file  exists in  the source,  an attempt  is made  to obtain  the field
definitions by using the library list.

To gain  the best  benefit  of the  tool, you  should  ensure that  the
library list includes the externally described files.

Bypassing EQ/NE comparisons
---------------------------

If  your program  is comparing  a  6 character  date from  a data  base
record  against  a  value such  as  UDATE (also  6  characters)  for an
'equal' or  'not  equal' comparison,  the  program should  continue  to
operate in the same manner after the year 2000.

Because of this SCNRPGCOMP bypasses the EQ/NE conditions.

Op codes considered
-------------------

The following  describes the Op codes  that are considered  for further
checking.

  **   Op  codes IF,  WH (or  WHEN), AND,  OR,  DOW, and  DOU.   If the
       comparison is EQ (such  as IFEQ) or NE  (such as DOUNE), the  Op
       code is not considered.

  **   Op codes SETLL and SETGT.

  **   Op  codes COMP,  LOKUP  (or LOOKUP),  CABEQ,  CABNE, CASEQ,  and
       CASNE with Hi or Lo indicators.

Other possibilities
-------------------

SCNRPGCOMP will  not find every possible year  2000 consideration.  The
following are some exceptions:

  **   Use  of dates as  key fields.   You may have  a date field being
       used as a  keyfield so that the  system can arrange the  data by
       date.

  **   Use of dates  in DDS selection.  You may have  a date field used
       in selection of what exists on an access path.

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

   MBR           The  source member to be scanned.   A single member, a
                 generic name, or the special  value *ALL may be  used.

                 If a  generic name  or *ALL  is specified, the  source
                 types  checked  are  RPG,  RPG38,  RPG36,  RPGLE,  and
                 RPGMOD.  The other types are bypassed.

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

   FLDLEN        The  field length  to be  tested.   The default  is 6.
                 Both  *CHAR  and  *DEC  type  fields  are  tested for.
                 *DEC type  fields  are  only  tested if  they  have  0
                 decimals.  The value must be between 1 and 256.

   RQDEXTDSC     Determines  whether  any  externally  described  files
                 are required.

                 *NO  is  the  default  which  means  if  an Externally
                 Described file  exists, the  field specifications  are
                 used.    If  an  Externally Described  file  does  not
                 exist  on the library  list, no error  occurs, but the
                 information about some of  the fields may be  missing.

                 If  *YES  is specified  and  an  Externally  Described
                 file  is specified  in the  source,  it must  exist on
                 the library list or an error will occur.

   DLTSPLF       A  *YES/*NO value that  defaults to *NO.   *NO retains
                 any spooled files created.

                 *YES may  be  specified to  delete  any spooled  files
                 that have no RPG type members.

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

One  of  the  base  tools  used  is RTVRPGFLD.    It  has  restrictions
regarding its ability to determine the attributes of a field.

Only EQ/NE comparisons are searched for.

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

The following TAA Tools must be on your system:

     CHKGENERC       Check generic
     EDTVAR          Edit variable
     HLRMVMSG        HLL Remove message
     RTVMBRLST2      Retrieve member list 2
     RTVRPGFLD       Retrieve RPG field attributes
     RTVSYSVAL3      Retrieve system value 3
     SNDCOMPMSG      Send completion message
     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
   ------        ----    ---------      ----------    ----------

   SCNRPGCOMP    *CMD                   TAARPGS       QATTCMD
   TAARPGSC      *PGM       CLP         TAARPGSC      QATTCL
   TAARPGSC2     *PGM       CLP         TAARPGSC2     QATTCL
   TAARPGSR      *PGM       RPG         TAARPGSR      QATTRPG
					

Added to TAA Productivity tools September 1, 1996


Home Page Up to Top