TAA Tools
ALCLIB          ALLOCATE LIBRARY                       TAALICA

The Allocate Library  command allows objects  in one or  more libraries
to  be locked  in a similar  manner to  the system  SAV commands.   The
function  is  not  a  complete  match  with  the  SAV  function locking
approach, but may be  used as a pre-test  condition to a SAV  function.
A spooled  file and an outfile  are created.  The  companion command is
Deallocate  Library  (DLCLIB)  to  unlock  the  objects  found  in  the
outfile.

ALCLIB  is   not  a   100%   match  with   the  SAV   command   locking
characteristics.  In  some cases objects cannot be locked  or locked to
the same  lock state as that  used by the SAV commands.   See the later
discussion.

A typical command would be:

            ALCLIB        LIB(xxx)

A spooled file would  be created and the  ALCLIBP file would be  output
to QTEMP.

Most objects in  the library which can be  locked would be locked  to a
*SHRNUP  lock (same  as SAV  commands).   The  library object  would be
locked *SHRUPD (same as SAV commands).

Data Base files
---------------

The  system support  of ALCOBJ  is that  a data  base file may  only be
locked if it contains a  member.  In addition, the ALCOBJ  command does
not  support a  list of  member names  which can  be locked.   Multiple
member  names  may  specified  by repeating  the  object  name,  but no
support exists to lock all members.

To provide  for locking  of multi-member  physical  files, ALCLIB  uses
the TAA Tool  ALCDBF.  It will  lock physical files containing  1 - 900
members.

Thus the following are considered error conditions by ALCLIB:

      - A data base file with no members.
      - A physical file with more than 900 members.
      - A logical file with more than 1 member.

These  errors  are  considered 'not  serious'  as  the  objects can  be
correctly saved by a SAV command.

Other object types
------------------

Some object types can  be locked, but  not to to a  *SHRNUP lock.   For
example, *PGM  objects cannot be  locked *SHRNUP, so  a *SHRRD lock  is
used.

While data  base files may be  locked, other file object  types may not
be  locked.   The SAV  commands will  lock these file  objects *SHRNUP,
but there is no interface for the user to use *SHRNUP.

The library object (*LIB)  may be locked to  *SHRNUP, but is locked  to
*SHRUPD by the SAV commands.  ALCLIB follows this approach.

Error handling
--------------

Some object types cannot be locked such as:

          *CLS
          *CMD
          *JOBD
          *JOBQ
          *JRN
          *JRNRCV
          *OUTQ
          *TBL

If one  of these  object types is  encountered, either ALCOBJ  will not
be  attempted or the error will be  handled and the object is bypassed.
These object types  are specified  as 'invalid' in  the spooled  output
file  and  in  the  ALCLIBP  outfile.     INVALID  conditions  are  not
considered to be a 'serious' error.

If  the  user  of the  command  does  not have  *USE  authority  to the
object, information  about  the  object cannot  be  retrieved  and  the
object will not  be locked.  NOTAUTH  will appear in the  spooled file.
Because the  SAV commands will  allow a user with  *SAVSYS authority to
save  an unauthorized object,  the NOTAUTH condition  is not considered
a 'serious' error.

An option  (ABORT parameter)  exists on  the command  to determine  the
action if  any serious  error occurs  (such as a  valid object  type to
lock cannot be locked).

  **   *IMMED  is the default  and immediately aborts  the command with
       TAA9895 sent as an escape message.

  **   *CMDEND may be specified to  send the TAA9894 escape message  at
       the end of  all processing if any serious  errors have occurred.

  **   *NO  means  the command  will complete  normally  whether errors
       have been found or not.

Some errors are  considered 'not serious'  and do not  cause an  escape
message.  These include:

  **   Attempting to  lock an object  that cannot be  locked such as  a
       *JOBD or a printer or display file.

  **   Attempting to access an unauthorized object.

  **   Attempting  to lock  a data  base file  that  does not  have any
       members.

  **   Attempting  to  lock  a physical  file  that has  more  than 900
       members.

  **   Attempting to lock a logical  file that has more than  1 member.

Deallocate Library
------------------

The Deallocate  Library command is the companion  command which unlocks
the objects  found in the ALCLIBP file.   The intended use of DLCLIB is
if you do  not end the  job following a  ALCLIB and  SAV function.   If
the job  is ended, the system  removes the locks.   If the job  is kept
in existence, you should run DLCLIB.

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

   LIB           A  list of up  to 40 libraries  may be specified.   It
                 is invalid to specify a  library that begins with  the
                 letter Q.

   ABORT         How to  handle  serious error  conditions.   'Serious'
                 and  'non-serious'  errors are  noted  in the  spooled
                 file.   The  intent of  not causing  all errors  to be
                 considered 'serious'  is  if a  SAV  command is  used,
                 there  should  not  be   any  problem  in  saving  the
                 object.

                 *IMMED  is  the default  which causes  the  command to
                 end immediately  with the  TAA9895 escape  message  if
                 any serious errors have been found.

                 *CMDEND may be  specified which causes the  command to
                 end   with  the  TAA9895  escape   message  after  all
                 objects have been processed.

                 *NO may  be  specified  which causes  the  command  to
                 complete  normally  for most  locking  errors.    Some
                 extreme  exception  conditions  will cause  an  escape
                 message.

   ALCLIBPLIB    The  library  which  will  contain  the  ALCLIBP file.
                 The file  will  contain one  record for  every  object
                 processed  and the  status of  locking achieved.   The
                 file  is used  by the  DLCLIB companion command.   The
                 default is QTEMP.

   REPLACE       A *YES/*NO parameter for  whether to replace the  data
                 in the ALCLIBP file.  *YES is the default.

                 *NO may  be specified  if you  want a  single file  to
                 used for multiple ALCLIB commands.

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

   LIB           The  library to unlock  the objects for.   The default
                 is *ALL  for all  objects in  all libraries  found  in
                 the ALCLIBP file.

                 A specific  library may  be named.   For example,  you
                 may  use ALCLIB  to  lock multiple  libraries  and the
                 DLCLIB to unlock a specific library.

   ALCLIBPLIB    The  library  which contains  the ALCLIBP  file output
                 from  the  ALCLIB command.    The  file  contains  one
                 record  for every  object that  was locked  by ALCLIB.
                 The default is QTEMP.

                 *LIBL or *CURLIB may also be specified.

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

See the previous comments.

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

The following TAA Tools must be on your system:

     ALCDBF          Allocate data base file
     CRTDUPPF        Create duplicate PF
     EDTVAR          Edit variable
     EXTLST          Extract list
     RSNLSTMSG       Resend last message
     RTVDIAGMSG      Retrieve diagnostic message
     RTVLFA          Retrieve logical file attributes
     RTVPFA          Retrieve physical file attributes
     RTVOBJLST       Retrieve object list
     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
   ------        ----    ---------      ----------    ----------

   ALCLIB        *CMD                   TAALICA       QATTCMD
   DLCLIB        *CMD                   TAALICA2      QATTCMD
   TAALICAC      *PGM       CLP         TAALICAC      QATTCL
   TAALICAC2     *PGM       CLP         TAALICAC2     QATTCL
   TAALICAR      *PGM       RPG         TAALICAR      QATTRPG
   TAALICAP      *FILE      PF          TAALICAP      QATTDDS

Structure
---------

ALCLIB      Cmd
   TAALICAC   CL pgm
     TAALICAR   RPG Pgm

DLCLIB      Cmd
   TAALICAC2  CL pgm
					

Added to TAA Productivity tools October 1, 1997


Home Page Up to Top