TAA Tools
RGZLIB          REORGANIZE LIBRARY                     TAADBIE

The  Reorganize  Library  command  reorganizes  one,  generic,  or  all
physical files  in a library or  all user libraries.   Source files are
excluded.   Options on the command allow  for selection on the basis of
deleted record percentage or  space.  A data  base file may be used  to
specify other  options such  as 1)  omit a file  or library,  2) always
reorganize, 3) use a different percentage or space requirement.

RGZLIB  supports the  RGZPFM RBDACCPTH  and ALWCANCEL parameters.   See
the later discussion.

An outfile of the reorganized file/members is optional.

A typical command would be:

            RGZLIB       LIB(xxx) DLTPCT(15) DLTSPACE(100000)
                           RGZLIBPLIB(yyy)

All physical  files (source  files are  excluded) would  be checked  in
the specified library.   The library named in  the RGZLIBPLIB parameter
would be checked and exceptions handled such as:

  **   Files to be omitted (never considered)

  **   Files   to    be   reorganized   regardless   of   the   command
       specifications.  For  example, if  a file is  to be  reorganized
       because it will provide better performance.

  **   Files that  should use a  different value  for deleted space  or
       percentage criteria than the command values.

  **   Files  that if reorganized  will use the  key of a  logical file
       (RGZPFM KEYFILE parameter).

Assume  a file is  not omitted and  does not have  an exception record.
The number  of deleted records  in each member  would be multiplied  by
the record length.   If more than 100,000 bytes  could be reclaimed, or
the  percentage  of deleted  records  was  greater than  15%,  the file
would be reorganized.

A  spooled file  would  be  created  with  each  member  processed  and
whether the member  was reorganized.  The number of  deleted records is
shown  along with the percentage  of deleted records and  the amount of
deleted  record  space  (the  numbers  are  before  any  reorganization
occurs).

If  a  member  has  all  deleted  records,   it  would  be  reorganized
regardless of the percentage or space requested.

Files with  no members or members with no  records are always bypassed.

If  you  omit a  physical  file, a  logical  file built  over  the same
physical file will  still be considered  if it is  in the same  library
that is requested to be reorganized.

The special  value *ALLUSR2  exists for the  LIB parameter.   It allows
all   files  on  the  system  to   be  considered  for  reorganization.
*ALLUSR2 means:

      - All user libraries (those that do not begin with the letter Q)
      - QGPL is included
      - S/36 libraries (such as #LIBRARY) are excluded

If  *ALLUSR2  is  specified,  you  must  have  *USE  authority  to  the
TAACVTLIBD authorization list.

If you are not  sure that all reorganizes will  be completed during the
time  you have available,  specify the ENDDATE  and ENDTIME parameters.
No new  reorganizations  will  be  attempted once  the  time  has  been
reached.

Testing RGZLIB
--------------

You  may test  what  RGZLIB  would have  done  by using  the  parameter
TESTRGZ(*YES).    No  reorganizations  will  occur regardless  of  what
entries exist in the exception file.

This  provides a good  method of understanding what  can be achieved if
actual reorganizations are performed.

RGZLIB RBDACCPTH and ALWCANCEL parameters
-----------------------------------------

RGZLIB supports  the RBDACCPTH  and ALWCANCEL  parameters supported  by
RGZPFM.   Both options exist  on the RGZLIB  command as well as  in the
record that describes exceptions by file.

See the parameter descriptions.

While  the  ALWCANCEL(*YES) option  appears desirable,  it  is normally
only of value on very large  files where rebuilding of access paths  is
too  costly to  be performed  and the  file  needs to  remain open  for
updates  as  long as  possible.    Note that  an  *EXCL  lock is  still
required for the final step.

RGZPFM Requirements
-------------------

The system RGZPFM  command is  used to  reorganize the files.   To  run
the RGZPFM command, the following requirements exist:

  **   You  must  be authorized  to  use  RGZPFM  on the  file.    This
       includes the  rights of *OBJMGT,  *OBJOPR, and all  data rights.

  **   The   member  to  be  reorganized  requires  an  *EXCL  lock  if
       ALWCANCEL(*NO) is specified.   If ALWCANCEL(*YES) is  specified,
       the file  must be journaled and  an *EXCL lock  is only required
       for the final phase (see the parameter discussion).

Requirements for KEYFILE specification
--------------------------------------

RGZPFM  allows a file to be  reorganized based on the  access path of a
different file.    This function  is supported  by  RGZLIB by  using  a
record in the exception file.

To use  the KEYFILE function,  the key file must  have a member  of the
same  name as the  key file.   and must be  in the same  library as the
physical file.

Exception file (RGZLIBP)
------------------------

RGZLIB allows you  to name a  data base file  that contains  exceptions
for  files   and  libraries   that  allow   you  to  provide   specific
information such as:

  **   All files  in a library  should be omitted  (never reorganized).

  **   A specific file should be omitted (never reorganized).

  **   A  specific file  should always  be reorganized  whenever RGZLIB
       is run  against  the library  containing  the file  (unless  the
       *TEST function is used).

  **   Specific  delete percentage  or  delete space  values should  be
       used instead of what is specified on the command.

  **   All  files in a library that do  not have a specific file record
       in the exception  file should  use the same  default values  for
       the delete percentage or space requirements.

  **   A logical  file containing  a key should  be used  to reorganize
       the  physical file.  This  information is passed  to the KEYFILE
       parameter of the RGZPFM command.

To create the exception file, use the CRTRGZLIB command.

             CRTRGZLIB    LIB(xxx)

Two files will be created:

           - RGZLIBP   Physical
           - RGZLIBL   Logical

RGZLIBP will be  created with PUBLIC(*USE).   This allows  any user  to
read the  information in  the file and  use the  RGZLIB command.   Only
the user who  created the RGZLIBP file may change  the data in the file
unless other users are given *CHANGE authority.

You  do not have to create  the files in the  same library as the files
to  be reorganized.    You  can  have  one or  many  RGZLIBP  files  by
specifying different libraries.

For example, you  might have a single file that is  used to control the
whole  system and use RGZLIB LIB(*ALLUSR2).   Or you may prefer to have
an RGZLIBP file  for each critical  library to be  saved with  separate
commands and  a general purpose RGZLIBP  file for the  other libraries.
The general  purpose file would contain single  entries that would omit
the critical libraries.

After the RGZLIBP  file has been  created, you can  enter entries  into
the file with the EDTRGZLIB command such as:

             EDTRGZLIB

A subfile  display would  appear and allow  you to  enter the  files or
libraries that  require exceptions.   Help text is  available to assist
in entering the data.

Typical Exception file entries
------------------------------

To  omit all files  for a given  library (prevent any reorganizations),
enter a record  with the library  name, the file as  *ALL, and a  Y for
omit.

To  process one  or  more  files differently  than  the command  values
(either  to  omit the  file,  always  reorganize it,  or  use different
values for deletion  percentage or  space requirements),  enter a  file
record with for each required exception.

To process  all files for  a given library  using criteria  that differ
from  the command  values, enter a  record with  the library  name, the
file as *ALL,  and specify  the required  values (such  as a  different
space requirement).

To process one  or more files with  unique exceptions and still  have a
default record  if a file does not have  a specific exception, enter an
*ALL  file record for the named  library as described previously.  Then
enter the specific file records required.

How the Exception file is processed
-----------------------------------

RGZLIB determines the physical data files that exist in a library.

  **   For each file,  the RGZLIBP file is  accessed to determine if  a
       specific file  record exists.   If not, a  check is made  to see
       if an *ALL file record exists.

  **   If  neither  a  specific  file record  or  an  *ALL  file record
       exists, the file is processed using the command values.

  **   If a specific  file record exists, the  file is processed  using
       the information from the file record.

  **   If  a specific  file record  does not  exist, but  an *ALL  file
       record  does exist  for the library,  the *ALL  file information
       is used.

Note that a  specific file record  or an *ALL file  record can  specify
the value  *CMD for  either or  both the delete  percentage or  deleted
space requirement.   If this  is specified, the value  from the command
is used.

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

   LIB           The  library to be processed  for physical data files.
                 Source files are excluded.

                 The  special value  *ALLUSR2  exists to  consider  all
                 physical  files in  all  libraries that  do not  begin
                 with  the letter Q except QGPL.   The S/36 # libraries
                 (such as  #LIBRARY) are  also excluded.   If  *ALLUSR2
                 is  specified, you  must have  *USE  authority to  the
                 TAACVTLIBD authorization list.

                 System  libraries  (except QS36F)  may  not  be named.
                 The user who created the library must be other than:

                   - *IBM
                   - QLPINSTALL
                   - QLPAUTO
                   - QDIRSRV
                   - QPM400
                   - QSYS

   BYPJRNFIL     A  *YES/*NO  parameter  for  whether  files  that  are
                 being journaled should be bypassed.

                 *NO  is  the  default meaning  files  that  are  being
                 journaled will  have their members  reorganized if the
                 other parameter selections are met.

                 *YES  may  be  specified  to  bypass  any  members for
                 files being journaled.

   DLTPCT        The delete percentage to  be considered.  The  default
                 is  10%.   If  a record  exists  for the  file in  the
                 RGZLIBP  file,  the  value  from  the  record  will be
                 used.

                 If a value from  1 to 99  is entered, then the  member
                 must  have   at  least  that  percentage   of  deleted
                 records before RGZPFM will be used.

                 *ANY  may  be  specified  to  allow  a file  with  any
                 deleted records to be reorganized.

                 *NONE should  be used  when the  DLTPCT amount  should
                 not  be considered.    The typical  use  for *NONE  is
                 when  you  only   want  to  reorganize  based  on  the
                 DLTSPACE criteria.

                 The  member  is reorganized  if  either the  DLTPCT or
                 DLTSPACE criteria are met.

                 If a  member  has all  deleted  records, it  would  be
                 reorganized  regardless  of  the percentage  or  space
                 requested.   These  files  will reorganize  quickly so
                 cleanup is preferred.

                 If a  member has  mostly deleted  records, the  delete
                 percentage could  be greater than  100%.   The maximum
                 value   that    will   be   shown   is   999%.      If
                 DLTSPACE(*NONE)  is  specified   and  the  amount   of
                 deleted  space  is  not met,  a  file  with  a  delete
                 percentage  of  over  100%  will not  be  reorganized.
                 This  prevents a long  reorg if there  are many active
                 records.

   DLTSPACE      The amount  of  space  that can  be  reclaimed  before
                 RGZPFM  will   be  used.    The   default  is  50,000.
                 Deleted  record  space  is  determined by  multiplying
                 the  number  of  deleted  records  times  the   record
                 length.   If  a  record exists  for  the  file in  the
                 RGZLIBP  file,  the  value  from  the  record will  be
                 used.

                 If the value  to be  tested is 50,000,  the amount  of
                 record space that  can be reclaimed must be  50,000 or
                 greater before the file is reorganized.

                 The value  should be entered  in bytes.   For example,
                 the  value 100000  means the  file must  have at least
                 100,000  bytes   of   deleted  record   space  to   be
                 considered for RGZPFM.

                 *ANY  may  be  specified  to  allow a  file  with  any
                 deleted records to be reorganized.

                 *NONE  should be used when  the DLTSPACE amount should
                 not be  considered.   The  typical  use for  *NONE  is
                 when you only  want to reorganize based  on the DLTPCT
                 criteria.

                 The  member  is reorganized  if either  the  DLTPCT or
                 DLTSPACE criteria are met.

                 If a  member  has all  deleted  records, it  would  be
                 reorganized  regardless  of the  percentage  or  space
                 requested.

   FILE          A  file or  generic  file name  in the  library  to be
                 reorganized.  The default is *ALL for all files.

                 If   a  specific   library  is   named  for   the  LIB
                 parameter,  you  may  specify  a  single  file   or  a
                 generic file  name.  Only  the named file  (or generic
                 file names) will be reorganized.

   RBDACCPTH     The   value  determines   whether  access   paths  are
                 rebuilt or maintained.   The value  is passed thru  to
                 the  RGZPFM  RBDACCPTH  parameter.   If  an  exception
                 record   exists    for   the   file,   the   exception
                 information is used.

                 *YES is the  default to  rebuild all  access paths  at
                 the end  of the  reorganization.   The file is  locked
                 until all rebuilds are complete.

                 *NO may  be specified to maintain the  access paths if
                 ALWCANCEL(*YES)  is specified.   As active records are
                 moved, access paths are maintained.

                 *OPTIMIZE may be  specified to be  passed thru to  the
                 to the  RGZPFM command.  This option  is not available
                 in  the  exception  record.   If  an  exception record
                 exists, the value  from the  exception record is  used
                 instead.

   ALWCANCEL     ALWCANCEL determines  the type of  reorganization that
                 will  be  used.   The  value  is  passed  thru to  the
                 RGZPFM ALWCANCEL parameter.   If  an exception  record
                 exists  for the  file,  the exception  information  is
                 used.

                 *NO  is the  default which  causes  the reorganization
                 to  occur with  the file locked.   The  file is copied
                 to  a  temporary  work  area  and  then  replaces  the
                 existing  file.   Access paths  are rebuilt  after the
                 replace  occurs.   If the  reorg job is  cancelled, it
                 depends  upon  what  step  was  in  process  when  the
                 cancellation  occurred.   It  is  likely that  one  or
                 more access paths will have to be rebuilt.

                 *YES may  be specified to cause the  reorg to occur by
                 moving active records  forward in the  file to  occupy
                 deleted record  numbers.  The  file must  be journaled
                 to  use this  option.   The  reorganization  can occur
                 mostly  while the file  is active.   When only deleted
                 records exist at  the end of  the file, an *EXCL  lock
                 is required  to move the end-of-file  marker after the
                 last active record.

   LOCK          The  lock   state  to  be  used  on  the  file  to  be
                 reorganized.   *EXCL  is  the default.    *EXCLRD  and
                 *SHRUPD may  be specified and  have the  same meanings
                 as  on  the  RGZPFM command.    This  option does  not
                 exist in the exception  record so any value  specified
                 is passed thru to the RGZPFM command.

                 *EXCLRD requires ALWCANCEL(*YES).

                 *SHRUPD  has some  restrictions  as specified  on  the
                 RGZPFM command.

   TESTRGZ       A  *YES/*NO  value  for  whether  any  reorganizations
                 should  occur.    *NO is  the  default  that specifies
                 reorganizations will occur.

                 *YES may be  specified if you  are testing how  RGZLIB
                 will  act.    No  reorganizations  will  occur.    The
                 spooled  file  will  contain  a  description  of  what
                 would have occurred.

   ENDDATE       The end date  if you want to  end the RGZLIB  function
                 after  a certain  time.   The default  is *NONE  which
                 means all reorganizes will be attempted.

                 A  date may be  entered (job format)  which will allow
                 the function to end  after the end  date and time  has
                 been  reached.   The  end  date/time is  only  checked
                 after  each internal  RGZPFM  is performed.    Thus no
                 new   reorganizations   will   occur   once   the  end
                 date/time has been reached.

                 An  end  date  cannot  be  used  if  TESTRGZ(*YES)  is
                 specified.   The  end date/time  must be  greater than
                 the  current  date/time  when  the  command begins  to
                 execute.

   ENDTIME       The end time  if you want to  end the RGZLIB  function
                 after  a certain  time.   The default  is *NONE  which
                 means all reorganizes will be attempted.

                 A  time  may be  entered  (hhmmss  format) which  will
                 allow  the   RGZLIB  function   to  end   before   all
                 reorganizations  are  completed.     See  the  ENDDATE
                 parameter for a full discussion.

                 An   end   time   value   may   not  be   entered   if
                 ENDDATE(*NONE) is specified.

   PRTNODLT      Whether  to print  a line  on the  listing for members
                 that have 0 deleted records.

                 *YES is the default to print a line.

                 *NO may be specified to bypass printing a line.

   RGZLIBPLIB    The  library  containing   the  file  that   describes
                 exception  handling  such   as  a  different  deletion
                 percentage  for a specific file or  library.  *LIBL is
                 the  default  meaning   the  RGZLIBP   file  will   be
                 searched for using the library list.

                 A specific  library name,  *CURLIB, or *NONE  may also
                 be entered.

                 The RGZLIBP  file cannot be used  on a OVRDBF command.
                 The library name to be  used must be specified on  the
                 command.

                 The parameters  specified on  the RGZLIB command  will
                 be  used for every  file processed except  those files
                 (or  libraries)  that  are  specified  in  the RGZLIBP
                 file.    For some  specific  files  you  may  want  to
                 reorganize regardless  of the amount  of deleted space
                 (such  as you want a performance  advantage) or if you
                 have a  very  large  file,  you  may  want  a  smaller
                 deletion percentage or larger space limit.

                 To  create   the  RGZLIBP  file,  use   the  CRTRGZLIB
                 command.     Enter  data   into  the   file  with  the
                 EDTRGZLIB command.

   OUTLIB        The  library  in  which  the  RGZFILP  file  will   be
                 placed.  The default  is *NONE meaning no out  file is
                 created.

                 A  specific  library  or  *LIBL  may be  specified  to
                 create  an outfile  with one record  for each physical
                 member that was reorganized.   If *LIBL is  specified,
                 the RGZFILP  file must be  found on the  library list.

                 The  model file  used is  TAADBIEQ with a  format name
                 of RGZFILR.

   OUTMBR        The member of  the RGZFILP file  to be used.   If  the
                 member does  not exist, it is  added.  The  default is
                 RGZFILP.

   REPLACE       A  *YES/*NO  value for  whether the  member  should be
                 cleared before writing records  into it.  The  default
                 is *YES.

                 *NO  may  be  specified to  add  records  to  existing
                 data.

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

   RGZLIBPLIB    The  name of  the  library where  the  exception files
                 will  be created.  The physical  file to be created is
                 RGZLIBP and the logical file is RGZLIBL.

   SRCLIB        The  source  library  to  use  for  the  QATTDDS  file
                 source.   The  default is  *TAAARC to  use  the source
                 from the TAA Archive.

                 A  specific user library may be  named, but the source
                 file must be QATTDDS.

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

   RGZLIBPLIB    The name  of the  library  where the  exception  files
                 (RGZLIBP and  RGZLIBL) exist.   The default  is *LIBL.

                 A specific  library name or *CURLIB  may also be used.

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

   RGZLIBPLIB    The name  of the  library  where the  exception  files
                 (RGZLIBP  and RGZLIBL)  exist  that will  be  deleted.
                 The default is *LIBL.

                 A specific  library name or *CURLIB may  also be used.

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

If LIB(*ALLUSR2) is specified, you must have *ALLOBJ authority.

If  a specific library is  named, you must have  authority to the files
(as defined by RGZPFM)  and an *EXCL lock  is required for each  member
to be reorganized.

See the  previously described restrictions  regarding the use of  a key
file.

System libraries except QGPL and QS36F may not be named.

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

The following TAA Tools must be on your system:

     CHKALLOBJ       Check all object authority
     CHKNAM          Check name
     CHKOBJ2         Check object 2
     CPYTAA          TAA Archive
     CVTLIBDBF       Convert library data base files
     DUPTAADBF       Duplicate TAA data base file
     FILEFDBCK       File feedback
     HLRMVMSG        HLL Remove message
     LOCKMSG         Lock message
     RPGSTSDS        RPG status data structure
     RSNLSTMSG       Resend last message
     RTVDBFA         Retrieve data base file attributes
     RTVSYSVAL3      Retrieve system value 3
     SNDCOMPMSG      Send completion message
     SNDESCMSG       Send escape message
     SNDSTSMSG       Send status message
     WRTSRC          Write source

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

None, the  tool is ready to use.  You  may use the CRTRGZLIB command to
create  the  exception  data  base  file  to  enter  data   to  provide
exception control for files and libraries.

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

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

   RGZLIB        *CMD                   TAADBIE       QATTCMD
   EDTRGZLIB     *CMD                   TAADBIE2      QATTCMD
   CRTRGZLIB     *CMD                   TAADBIE3      QATTCMD
   DLTRGZLIB     *CMD                   TAADBIE4      QATTCMD
   TAADBIEC      *PGM       CLP         TAADBIEC      QATTCL
   TAADBIEC2     *PGM       CLP         TAADBIEC2     QATTCL
   TAADBIEC3     *PGM       CLP         TAADBIEC3     QATTCL
   TAADBIEC4     *PGM       CLP         TAADBIEC4     QATTCL
   TAADBIEC12    *PGM       CLP         TAADBIEC12    QATTCL
   TAADBIER      *PGM       RPG         TAADBIER      QATTRPG
   TAADBIER2     *PGM       RPG         TAADBIER2     QATTRPG
   TAADBIER9     *PGM       RPG         TAADBIER9     QATTRPG
   TAADBIED      *FILE      DSPF        TAADBIED      QATTDDS
   TAADBIEP      *FILE      PF          TAADBIEP      QATTDDS
   TAADBIEQ      *FILE      PF          TAADBIEQ      QATTDDS
   TAADBIEL      *FILE      LF          TAADBIEL      QATTDDS

Structure
---------

RGZLIB      Cmd
   TAADBIEC   CL pgm
       TAADBIER   RPG pgm
       TAADBIER9  RPG pgm

CRTRGZLIB   Cmd
   TAADBIEC3  CL pgm

EDTRGZLIB   Cmd
   TAADBIEC2   CL pgm
     TAADBIER2   RPG pgm
       TAADBIED    Display file
       TAADBIEC12  CL pgm

DLTRGZLIB   Cmd
   TAADBIEC4   CL pgm
					

Added to TAA Productivity tools August 1, 1997


Home Page Up to Top