TAA Tools
CMPLIB2         COMPARE LIBRARY 2                      TAALIBZ

The Compare Library 2  command is designed to assist when  you want to
ensure that  one or more libraries on  different systems or partitions
are   the  same.     The  CAPLIB2   command  must  be   used  on  both
systems/partitions to  capture  object and  member information.    The
libraries containing  the CAPLIB2 information  must exist on  the same
system  when CMPLIB2 run.  A spooled  file is displayed or output with
the differences.

The tool may  also be  used to compare  changes for a  library on  the
same system.

You must have *ALLOBJ special authority to use CAPLIB2.

The same library names must exist on both systems or partitions.

CMPLIB2 will  check for missing  objects and  members in both  sets of
information.

Objects  or  members   are  flagged  if  they  exist  in  one  of  the
libraries, but not the other.

A list of object types  may be included or  excluded.  The default  is
to include all types and exclude no types.

For objects, the following  is compared if the same  object exists and
flagged if differs for:

     - Attribute
     - Owner
     - Text description

For members,  the following is compared if the  same member exists and
flagged if differs for:

     - SEU type
     - Number of records
     - Text description

Note  that  this  is not  a  complete  comparison.   For  example, the
comparison  will  note whether  the  objects  are  the  same,  but  an
attribute such as a Job Description Library list may differ.

Getting started
---------------

  **   Assume  you  want to  compare  libraries  LIBA  and LIBB  on  a
       backup system to the same libraries on a production system.

  **   Use  a  special  library  for  CAPLIB2.    Assume  it is  named
       LIBINFO2.  This  is not  required, but the  objects in  library
       LIBINFO1 will  be bypassed when  CAPLIB2 is used  and therefore
       it  is  best to  have  a  unique library.    The  library could
       include other  objects that  you want  to compare  by your  own
       code or other TAA Tools.

  **   As  a user  with  *ALLOBJ special  authority,  use the  CAPLIB2
       command on the backup system such as:

              CAPLIB2   LIB(LIBA LIBB) OUTLIB(LIBINFO1)

       The LIBINFO1 library must exist and will contain:

            - TAAMBRP - DSPFD TYPE(*MBRLIST) information
            - TAAOBJD - DSPOBJD information

       Both  outfiles  are  keyed  shortened  versions of  the  system
       outfiles  to  minimize  the amount  of  space  and transmission
       time.

  **   The  library should  then  be  transmitted  to  the  production
       system.  The TAA Tools SAVSNDL and RSTSNDL could be used.

  **   CAPLIB2  would then  be run  on the  production system  for the
       same libraries:

              CAPLIB2   LIB(LIBA LIBB) OUTLIB(LIBINFO2)

       The  LIBINFO2  library must  exist  and will  contain  the same
       objects as LIBINFO1.

  **   Run CMPLIB2 for the comparison:

              CMPLIB2   FROMLIB(LIBINFO1) TOLIB(LIBINFO2)

       A spooled file would be displayed with any differences.

Checking for changes of a library at different intervals
--------------------------------------------------------

You can use CMPLIB  to compare changes made to  a library on the  same
system.

You must  use CAPLIB2  which captures  the data and  places it  in the
outfile  TAAOBJD.  Use a  a permanent library  for the outfile.   At a
later time,  use CAPLIB2  again  and output  to a  different  library.
Then  you  can  use  CMPLIB2  to  compare  the  two  versions  in  the
different libraries.

How CMPLIB2 operates
--------------------

CAPLIB2 ensures  the OUTLIB exists.  DSPOBJD  and DSPFD TYPE(*MBRLIST)
are  used to  create outfiles  for each named  library in  QTEMP.  The
libraries QTEMP  and the library  named for  the OUTLIB parameter  are
never included.

If  REPLACE(*YES) is  specified,  the TAAOBJD  and  TAAMBRP files  are
created  into the named OUTLIB library.   The system outfiles in QTEMP
are copied  to the TAAxxx  file names  with FMTOPT(*MAP  *DROP).   The
TAA file definitions include the fields used for comparison.

CMPLIB2 begins by checking  the files in the From  and To libraries to
ensure they exist and have the proper format names.

The  files in  the To library  are copied  to the TAATOBJ  and TAATMBR
files in QTEMP.   This is required  to allow unique  file names to  be
used in  the RPG  program for  the 4  files involved.   Overrides  are
used for all files.

The   key   structure    for   the   object   description   files   is
library/object/type.   The  key structure  for the  member description
files is library/file/member.

CMPLIB2 begins by reading  the object description records in  the From
library and  attempts to  randomly access the  same record key  in the
corresponding  file in  the To  library (the  TAATMBR file  in QTEMP).
If the same key does not exist, the record is flagged and listed.

If the  same record exists,  a comparison  is made  of the  attribute,
owner, and  type.   If any  differences exist,  the record is  flagged
and listed.

When  all object  description records  in the  From library  have been
read, the object  descriptions in  the To library  are read  beginning
with the  first record.   An attempt  is made  to randomly  access the
same key  in the in the From  library file.  If the  same key does not
exist, the record is flagged and listed.

This same process occurs again for the member files.

CAPLIB2  escape messages you can monitor for
--------------------------------------------

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

CMPLIB2  escape messages you can monitor for
--------------------------------------------

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

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

   LIB           A  list  of up  to 300  libraries (generic  names are
                 valid) that  will be captured  or the special  values
                 *ALL or  *ALLUSR.  The  special values have  the same
                 definition as defined by the SAVLIB command.

                 The   library   information  captured   includes  one
                 record for  each  object  and  one  record  for  each
                 member.  The file names are TAAOBJD and TAAMBRP.

                 The libraries  QTEMP and  the library  named for  the
                 OUTLIB parameter are implicitly bypassed.

   REPLACE       A  *YES/*NO  parameter  for  whether  to replace  the
                 data in  the TAAOBJDP  and  TAAMBRP files  (a  single
                 member exists in each).

                 *YES  is the  default  in  which  case if  the  files
                 already exist, they are deleted and recreated.

                 *NO may be specified to add records to the files.

   OUTLIB        The  library where the  information will  be captured
                 to.

                 The   library   will   contain   the   files  TAAMBRP
                 (shortened output  from DSPFD  *MBRLIST) and  TAAOBJP
                 (shortened output from DSPOBJD).

                 The   libraries  QTEMP   and  TAATOOL   may  not   be
                 specified.

                 Objects  in  the named  library (and  QTEMP)  are not
                 included in the TAAMBRP and TAAOBJP files.

   OMITLIB       A list  of up  to 300  libraries  or generic  library
                 names  that  should   be  omitted.    *NONE   is  the
                 default.

                 No  check  occurs to  see  if an  omit  library would
                 have been selected.   For example,  if LIB(LIBA*)  is
                 entered with OMITLIB(ABC), no error occurs.


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

   FROMLIB       The  library   name  of  the   From  library   to  be
                 compared.   The library must have been  output by the
                 CAPLIB2 command.

   TOLIB         The  library name of  the To library  to be compared.
                 The library  must  have been  output  by the  CAPLIB2
                 command.    The same  library  names  must have  been
                 specified for each CAPLIB2 command.

   DIFFONLY      A  *YES/*NO parameter  for whether  to list  only the
                 differences or all objects and members.

                 *YES is the default to list only differences.

                 *NO  may  be  specified  to  list  all   objects  and
                 members.

   INCOBJTYPE    A list of up to 50 object types to be included.

                 *ALL is the default for all object types.

                 If  one or  more  object  types are  specified,  only
                 those  object  types  will  be  included.    Use  the
                 prompter for the list of valid object types.

   EXCOBJTYPE    A list of up to 50 object types to be excluded.

                 *NONE is  the default  meaning  no object  types  are
                 excluded.

                 If  one or  more object  types  are specified,  those
                 object  types will  be  excluded.   Use  the prompter
                 for the list of valid object types.

                 No  check  is made  to compare  the list  of included
                 object types against the list of excluded types.

   OUTPUT        How to  output  the results.   *  is  the default  to
                 display the  spooled file  if the command  is entered
                 interactively.   The  spooled  file is  deleted after
                 it is displayed.

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

   CMPMBR        Perform  or  suppress the  member compare.    *YES is
                 the default  to perform  the compare  of the  members
                 between  the libraries  and  provide the  results  in
                 the report.   *NO will  suppress this portion  of the
                 report.


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

You must have *ALLOBJ special authority to use CAPLIB2.

The same library names must be used on both uses of CAPLIB2.

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

The following TAA Tools must be on your system:

     CHKALLOBJ       Check *ALLOBJ special authority
     CVTTIM          Convert time
     DUPTAADBF       Duplicate TAA data base file
     EDTVAR          Edit variable
     EXTLST2         Extract list 2
     RTVFMT          Retrieve format
     RTVSYSVAL3      Retrieve system value 3
     SNDCOMPMSG      Send completion message
     SNDESCINF       Send escape information
     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
   ------        ----    ---------      ----------    ----------

   CMPLIB2       *CMD                   TAALIBZ       QATTCMD
   CAPLIB2       *CMD                   TAALIBZ2      QATTCMD
   TAALIBZC      *PGM       CLP         TAALIBZC      QATTCL
   TAALIBZC2     *PGM       CLP         TAALIBZC2     QATTCL
   TAALIBZC11    *PGM       CLP         TAALIBZC11    QATTCL
   TAALIBZR      *PGM       RPG         TAALIBZR      QATTRPG
   TAALIBZP      *FILE      PF          TAALIBZP      QATTDDS
   TAALIBZQ      *FILE      PF          TAALIBZQ      QATTDDS
   TAALIBZS      *FILE      PF          TAALIBZS      QATTDDS
   TAALIBZT      *FILE      PF          TAALIBZT      QATTDDS

The  TAALIBZP and TAALIBZQ  are keyed versions  of a shortened version
of the DSPOBJD outfile.

The TAALIBZS and  TAALIBZT are keyed  versions of a shortened  version
of the DSPFD *MBRLIST outfile.


Structure
---------

CAPLIB2     Cmd
   TAALIBZC2  CL pgm

CMPLIB2     Cmd
   TAALIBZC    CL pgm
     TAALIBZR    RPG Pgm
       TAALIBZC11    CL pgm   Used to convert date and time
					

Added to TAA Productivity tools October 15, 2008


Home Page Up to Top