TAA Tools
CMPDBF3         COMPARE DATA BASE FILE 3               TAADBNJ

The Compare  Data  Base File  3 command  compares one  member from  two
physical  data files.    The files  are  copied to  temporary  files in
QTEMP  and a logical file is  built over each file  with the key as the
entire record.  The  From file is then read  and an attempt is made  to
randomly access  the same key  in the To  file.  Exceptions  are noted.
The process then repeats for the To file.

The  attributes and  the record lengths  of the  two files  must be the
same and record length cannot exceed 9999 bytes.

A typical command would be:

             CMPDBF3    FROMFILE(ABC) TOFILE(DEF)

The records in each file would be  compared to the other file.  If  the
key (meaning  the entire record)  from one file  does not exist  in the
other file,  a line is listed  with the first 120  bytes of the record.

Comparison technique
--------------------

PF source is copied  from the TAADBNJP and  TAADBNJQ source members  to
a temporary source  file in QTEMP.   The source is  the same for  the 2
files with  each having a single field  of 9999 bytes and a  key on the
field.   The  record length  of the  file is  used to change  the field
length and the files are created in QTEMP.

The actual  files are then  copied to the  new files  in QTEMP and  the
comparison program is called.

Duplicate records in the same file
----------------------------------

Assume the following records exist in the From and To files:

        From     To
        ----     --

         A       A
         B       C
         D       D
         D       D
         E       E
         E

Each file has a  record that does not exist in the  other file.  Record
B and C would be listed as 'Not found'.

The  From file has  a duplicate  'E' that does  not exist  in the other
file.  Each additional  duplicate in either file  would be listed  with
a  'Type' of  'Duplicate'.   You must  manually check  these to  ensure
that the  same number of duplicates  appear in the other  file.  In the
example, the 'D' records have the  same number, but the 'E' records  do
not.

CMPDBF3 escape messages you can monitor for
-------------------------------------------

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

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

   FROMFILE      The qualified  name of the  From file to  be compared.
                 The  library  value defaults  to  *LIBL.   A  specific
                 library or *CURLIB may also be used.

   TOFILE        The  qualified  name of  the To  file to  be compared.
                 The library  value  defaults  to *LIBL.    A  specific
                 library or *CURLIB may also be used.

   FROMMBR       The  member of  the From  file  to be  compared.   The
                 default  is *FIRST.  A specific  member may be entered
                 or the special value *LAST.

   TOMBR         The member  of  the  To  file to  be  compared.    The
                 default is *FIRST.   A specific member  may be entered
                 or the special value *LAST.

   OUTPUT        How  to  output the  results.   *  is  the  default to
                 display the  spooled file  if the  command is  entered
                 interactively.   If the display  is ended  with F3/F12
                 or the  Enter key, the  spooled file is  deleted after
                 it  is  displayed.   To retain  the spooled  file, you
                 may use the  the System Request 'Cancel'  function and
                 the spooled file will exist in a HLD status.

                 If  the  command is  entered  in  batch  or *PRINT  is
                 specified,  the spooled  file is output  and retained.

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

Only data physical files are supported.

The attributes and  the record  lengths of  the two files  must be  the
same and record length cannot exceed 9999 bytes.

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

The following TAA Tools must be on your system:

     CHKDBFMBR       Check data base file member
     CPYTAADDS       Copy TAA DDS
     HLRMVMSG        HLL Remove message
     RSNLSTMSG       Resend last message
     RTVSYSVAL3      Retrieve system value 3
     SNDCOMPMSG      Send completion message
     SNDESCINF       Send escape information
     SNDESCMSG       Send escape message
     SNDSTSMSG       Send status message
     WRTSRC          Write source

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

None, the tool is ready to use.

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

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

   CMPDBF3       *CMD                   TAADBNJ       QATTCMD
   TAADBNJC      *PGM       CLP         TAADBNJC      QATTCL
   TAADBNJR      *PGM       RPG         TAADBNJR      QATTRPG
   TAADBNJP      *FILE      PF          TAADBNJP      QATTDDS
   TAADBNJQ      *FILE      PF          TAADBNJQ      QATTDDS

The two PF files  are used as the definition of the  files to copy data
to.  Each file has a key of the entire record.
					

Added to TAA Productivity tools April 15, 2012


Home Page Up to Top