TAA Tools
DLTUNULIB       DELETE UNUSED LIBRARIES                TAALIDQ

The Delete Unused Libraries  command deletes libraries that have  1) no
objects,  2) all objects  within the library  have never been  used, or
3)  the  object within  the library  with the  most recently  last used
date has not  been used for  a specified number of  days.  The  default
is ACTION(*CHECK)  so that only  a listing is  output of what  would be
deleted.

Two  forms of  deletion are  possible.   ACTION(*DELETE) deletes  all 3
types.  ACTION(*DELETE2)  retains the libraries  that have no  objects,
but deletes the other 2 types.

System libraries are never deleted.

You must have *ALLOBJ special authority to use DLTUNULIB.

A typical command would be:

             DLTUNULIB LIB(*ALLUSR) RTNDAYS(365) OMITLIB(LIBA LIBB)
                         ACTION(*CHECK)

All user  libraries except  those specified  for the  OMITLIB parameter
would  be checked.   A  listing would  be displayed  with one  line per
library and the  object that  has the  most current  'last used  date'.
The libraries that  would be deleted by  using an action of  *DELETE or
*DELETE2 are flagged.

Specifying an  action of *DELETE or *DELETE2  provides the same listing
and  deletes the  flagged libraries.   If  a library cannot  be deleted
(eg it may be  on some job's library list),  the error is noted  on the
listing.

If a  library has objects  that have never  been used and  also objects
that  have been used.   The  last used date  of the  most recently used
object is considered.

Other comments
--------------

The system does not support a  'last used date' for *LIB object  types.
Only the  objects within the library  are updated with the  'last used'
information.

If  *ALLUSR is  specified for the  the LIB  parameter, use  the OMITLIB
parameter for  those large  libraries  which you  know are  being  used
regularly.  If  a library is to  be checked, DSPOBJD is used  to create
an outfile  of all objects in  the library to allow the  last used date
to be checked.  This can be a slow process on a large library.

If  your command will  process many libraries with  many objects, it is
best submitted to batch.

DLTUNULIB escape messages you can monitor for
---------------------------------------------

      TAA9892    Some errors occurred.
                   Only occurs if the action is *DELETE
                     or *DELETE2 and the command is submitted
                     to batch or OUTPUT(*PRINT) is specified.

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

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

   LIB           The list  of libraries  to be  processed.   Up to  300
                 libraries  may be  entered  (including generic  names)
                 or  the special  value  *ALLUSR.   A generic  name may
                 also be specified.

   RTNDAYS       The number  of days  to check  against  the last  used
                 date for objects  within the library.   The default is
                 365  days.   A  number may  be entered  between  1 and
                 9999.

                 For example,  if you  take  the default,  any  library
                 that has 1) no  objects, or 2) all objects  within the
                 library  have  never  been  used,  or  3)  the  object
                 within  the  library with  the  most recent  last used
                 date has  not been  used for the  specified number  of
                 days  would  be  considered  for deletion.    See  the
                 ACTION parameter.

   ASPDEV        Specifies  the  auxiliary  storage  pool (ASP)  device
                 name where  storage  for the  library  containing  the
                 object is  allocated.   If the  library resides in  an
                 ASP  that is  not part  of  the thread's  library name
                 space, this  parameter  must be  specified  to  ensure
                 the correct library is searched.

                 The  parameter can  be  specified  as  a list  of  two
                 values  (elements)   or  as  a  single   value.    The
                 possible single values are:

                 *  = The ASPs that are  currently part of the thread's
                 library name  space  will be  searched to  locate  the
                 library.   This includes the  system ASP (ASP  1), all
                 defined  basic  user  ASPs (ASPs  2-32),  and,  if the
                 thread has  an ASP  group, the  primary and  secondary
                 ASPs in the thread's ASP group.

                 *ALLAVL = All  available ASPs will be  searched.  This
                 includes  the system  ASP (ASP  1), all  defined basic
                 user ASPs (ASPs 2-32),  and all available primary  and
                 secondary  ASPs,  (ASPs  33-255)  with   a  status  of
                 'Available'.

                 *CURASPGRP  = If  the  thread  has an  ASP  group, the
                 primary  and secondary ASPs in  the thread's ASP group
                 will  be  searched.    The  system  ASP  (ASP  1)  and
                 defined  basic  user  ASPs  (ASPs 2-32)  will  not  be
                 searched.   If  no  ASP group  is associated  with the
                 thread, an error will be issued.

                 *SYSBAS =  The  system ASP  (ASP  1) and  all  defined
                 basic  user  ASPs  (ASPs 2-32)  will  be  searched  to
                 locate  the  library.   No primary  or  secondary ASPs
                 will be  searched  even  if  the  thread  has  an  ASP
                 group.

                 Element 1: Device

                 The device  name of  the primary  or secondary ASP  to
                 be searched.   The primary or secondary  ASP must have
                 been  activated  (by varying  on  the ASP  device) and
                 have a  status of 'Available'.   The  system ASP  (ASP
                 1) and  defined user basic  ASPs (ASPs 2-32)  will not
                 be searched.

                 Element 2: Search type

                 *ASP  =  Specifies  that  only  the  single  auxiliary
                 storage pool (ASP)  device named  in element  1 is  to
                 be searched.

                 *ASPGRP  = Specifies  that  the  entire group  of  the
                 primary  auxiliary storage pool (ASP)  device named in
                 element 1 is to be searched.

   ASPNBR        The ASP  number  for  the libraries  that  are  to  be
                 converted.  The default is *ALL.

                 A  number in  the  range of  1-39  may be  entered  to
                 subset the  libraries that are  output by the  LIB and
                 ASPDEV parameters.

   LIBTYPE       Whether  to select  all or  a specified  library type.
                 *ALL is the default to select all types.

                 *PROD may  be used  to select  only production  (PROD)
                 libraries.

                 *TEST  may   be  used  to  select   only  test  (TEST)
                 libraries.

   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(*ALLUSR)  is
                 entered with  OMITLIB(ABC) and  library ABC  does  not
                 exist, no error occurs.

   ACTION        The action to be performed.

                 *CHECK is the  default meaning that only a  listing is
                 created  and flags  are set  for libraries  that would
                 be deleted.  No deletions occur.

                 *DELETE  may be specified to  delete libraries with 1)
                 no objects,  2) all  objects within  the library  have
                 never been  used, or 3) the object  within the library
                 with  the  most recent  last  used date  has  not been
                 used for the specified number of days.

                 *DELETE2 may  be  specified to  retain  the  libraries
                 with  no objects,  but deletes  those libraries  where
                 all  existing  objects  have  never  been  used or  no
                 object within  the  library  has  been  used  for  the
                 specified number of days.

   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
------------

System libraries are never deleted.

You must have *ALLOBJ special authority to use DLTUNULIB.

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

The following TAA Tools must be on your system:

     ADDDAT2         Add date 2
     CHKALLOBJ       Check *ALLOBJ special authority
     CHKIBMLIB       Check IBM library
     CHKPROLIB       Check protected library
     CMPCMDLST       Compare command list
     CVTDAT          Convert date
     EDTVAR          Edit variable
     EXTLST2         Extract list 2
     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

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

None, the tool is ready to use.

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

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

   DLTUNULIB     *CMD                   TAALIDQ       QATTCMD
   TAALIDQC      *PGM       CLP         TAALIDQC      QATTCL
   TAALIDQC2     *PGM       CLP         TAALIDQC2     QATTCL
   TAALIDQR      *PGM       RPG         TAALIDQR      QATTRPG
					

Added to TAA Productivity tools October 15, 2013


Home Page Up to Top