ALCDBF ALLOCATE DATA BASE FILE TAADBFR |
The Allocate Data Base File command allocates all members in a
physical file. It differs from the ALCOBJ command which will
allocate the first member or a list of named members in a file.
The companion command is DLCDBF.
A typical command sequence is:
ALCDBF FILE(ABC) LOCKSTATE(*EXCLRD)
.
.
DLCDBF FILE(ABC) LOCKSTATE(*EXCLRD)
Only physical files may be specified. The file must have a least one
member. A limit of 900 members may be allocated for a single file
using ALCDBF.
If the ALCDBF command does not complete successfully, the file object
and any members that were allocated will be deallocated.
ALCDBF internally performs one or more ALCOBJ commands.
Each allocation with ALCOBJ sets a lock on an object or member. For
each lock that is acquired, you must unlock the object to free the
lock. If you perform multiple ALCOBJ commands against the same
object, you will have multiple locks. To release all of the locks,
you must perform multiple deallocation commands.
For example, if you specify:
ALCOBJ OBJ(ABC *FILE *EXCL)
ALCOBJ OBJ(ABC *FILE *EXCL)
to free the locks you must specify:
DLCOBJ OBJ(ABC *FILE *EXCL)
DLCOBJ OBJ(ABC *FILE *EXCL)
The ALCDBF command uses the RTVMBRLST TAA Tool to determine the list
of members to be locked. If another job has a member locked with an
*EXCL lock, the member will not appear in the member list. ALCDBF
checks the number of members in the file against the number that were
allocated. If a mismatch is found, deallocation occurs and an
appropriate escape message is sent.
The DLCOBJ command does not send an escape message if an object or
member is not locked or the lock state requested is not the lock
state that is held. The command completes successfully whether the
lock was removed or no lock existed. Therefore, the DLCDBF command
will also operate in the same manner. If the file or members are not
locked or the lock state is not what is held, the DLCDBF will
complete successfully.
DLCDBF does check to ensure that the number of members that exist in
the file are the same number as have been deallocated. If not an
escape message is sent.
ALCDBF command parameters *CMD
-------------------------
FILE The qualified file name of the data base file to be
locked. The library name defaults to *LIBL.
LOCKSTATE The lock state requested. This is the same list as
on ALCOBJ (*SHRRD *SHRNUP *SHRUPD *EXCLRD *EXCL).
WAIT The number of seconds to wait. The default is *CLS
which is the same as on ALCOBJ.
DLCDBF command parameters *CMD
-------------------------
FILE The qualified file name of the data base file to be
deallocated. The library name defaults to *LIBL.
LOCKSTATE The lock state requested. This is the same list as
on DLCOBJ (*SHRRD *SHRNUP *SHRUPD *EXCLRD *EXCL).
Restrictions
------------
** Only a physical file may be specified on either ALCDBF or
DLCDBF.
** The file must have at least one member (This is the same
restriction as the ALCOBJ command).
** A maximum of 900 members may exist in a file. If more than
900 members exist, no allocations are performed.
Prerequisites
-------------
The following TAA Tools must be on your system:
EDTVAR Edit variable
RTVMBRLST Retrieve member list
RTVPFA Retrieve physical file attributes
SNDCOMPMSG Send completion message
SNDDIAGMSG Send diagnostic 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
------ ----- --------- ---------- -----------
ALCDBF *CMD TAADBFR QATTCMD
DLCDBF *CMD TAADBFR2 QATTCMD
TAADBFRC *PGM CLP TAADBFRC QATTCL
TAADBFRC2 *PGM CLP TAADBFRC2 QATTCL
Structure
---------
ALCDBF Command
TAADBFRC CL pgm
DLCDBF Command
TAADBFRC2 CL pgm
|
Added to TAA Productivity tools April 1, 1995