The Convert Deleted Space command converts member information from
one or more files to an outfile. It is intended to be used for
queries regarding members with deleted record space. If variable
length fields exist, the allocated length is output in addition to
the maximum record length. A 'minimum' amount of total deleted space
is included. An omit list of libraries may also be specified.
The model file used is TAADBKDP with a format name of DLTSPCR.
You must have *ALLOBJ special authority to specify *ALL or *ALLUSR as
the libraries to be scanned.
Only physical data files are considered.
A typical command would be:
CVTDLTSPC LIB(xxx) OUTLIB(yyy)
All physical data base members in the named library would be found
and checked for deleted records. Because the default of
OUTTYPE(*DLTONLY) was used, one record would be written for each
member that has any deleted records.
Several fields exist in the outfile including the number of current
and deleted records, the percentage of deleted records, the total
amount of data space, and the minimum amount of space being used for
deleted records. If the member has variable length fields, the
allocated length of all the fields is used instead of the maximum
record length before multiplying by the number of deleted records.
System handling of variable length records
Most calculations of the amount of deleted record space do not
consider variable length fields. Therefore, the calculation assumes
that the amount of space that exists is the number of deleted records
times the maximum record length.
When a variable length field exists, an optional allocated length may
exist. The allocated space is in every record. If the field value
exceeds the allocated space, an overflow area is used.
If a record with a variable length field that has data in the
overflow area is deleted, the storage of both the allocated space and
the overflow area remain on the system. The system provides
information to determine the allocated space that can be reclaimed,
but no information is available concerning the space used in the
The CVTDLTSPC command provides a better understanding of the amount
of deleted record space that exists by determining the allocated
length of each record. This is the sum of the field lengths of
non-variable length fields plus the sum of the allocated length of
variable length fields. This value is used to multiply by the number
of deleted records.
This calculation would only be correct if the records that were
deleted did not use any storage in the overflow area.
Therefore, the amount of deleted record space shown for a member with
variable length fields should be considered a minimum of what can be
Reclaiming deleted space
Deleted record space can be reclaimed by the system command RGZPFM.
It causes the file to be copied internally and all access paths
rebuilt. A good TAA tool to consider is RGZLIB which will allow all
or selected files in a library to be reorganized.
RGZPFM requires an allocated file and can take a long time on a large
file with many access paths.
An alternative is to use the TAA CPRDLTRCD and TRNDLTRCD commands.
CPRDLTRCD runs along with other applications and moves the active
records to the front of the file. TRNDLTRCD requires an allocated
file, but runs only for a short time to allow the system to move the
'end of file' marker up to the last active record.
Space is also reclaimed by CLRPFM, RMVM, and DLTF.
DSPDLTSPC escape messages you can monitor for
TAA9892 No physical data file members were found
TAA9893 Files with more than 998 fields (including
one or more variable length fields)
exist and could not be processed
Escape messages from based on functions will be re-sent.
Command parameters *CMD
LIB The library or libraries to be scanned. A list of
to 300 libraries may be entered. A generic name may
be used or the special values *LIBL, *USRLIBL,
*CURLIB, or *ALLUSR.
You must have *ALLOBJ special authority to specify
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. If this parameter
is used when the library qualifier specified for the
Object prompt (OBJ parameter) is *CURLIB, *LIBL, or
*USRLIBL, ASPDEV(*) is the only valid value.
This 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
*CURASPGRP = If the thread has an ASP group, the
primary and secondary ASPs in the thread's ASP group
will be searched to locate the library. 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
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
Element 2: Search type
*ASP = Specifies that only the single auxiliary
storage pool (ASP) device named in element 1 is to
*ASPGRP = Specifies that the entire group of the
primary auxiliary storage pool (ASP) device named in
element 1 is to be searched.
LIBTYPE The type of library to be processed. The default is
*ALL for both production and test.
*PROD may be used for just production libraries.
*TEST may be used for just test libraries.
OMITLIB A list of up to 300 libraries or generic libraries
to be omitted.
An omit list may not be entered for LIB(*CURLIB).
Any library entered is checked for existence.
No check occurs to see if an omit library would have
been selected. For example, if LIB(*LIBL) is
entered with OMITLIB(ABC) and library ABC is not on
the library list, no error occurs.
OUTTYPE The type of output. *DLTONLY is the default to
output a record for each member that has deleted
*ALL may be specified to output a record for each
member whether it has deleted records or not.
OUTLIB The library in which the file DLTSPCP will be
placed. The default is *LIBL. If the DLTSPCP file
does not already exist, a library must be specified.
OUTMBR The member of the DLTSPCP file to be used. If the
member does not exist, it is added. The default is
REPLACE A *YES/*NO value for whether the member should be
cleared before writing records into it. The default
REPLACE *NO may be entered to add records to an existing
You must have *ALLOBJ special authority to specify *ALL as the
libraries to be scanned.
The amount of space that can be reclaimed for a deleted record with
variable length fields should be considered a minimum. See the
If a file has more than 998 fields and some of which are variable
length, the allocated length cannot be determined and a message is
sent to the job log. An escape message is sent at the end of the
function if any of these messages occurred.
The following TAA Tools must be on your system:
CHKALLOBJ Check *ALLOBJ special authority
CHKDUPLST Check duplicate list
CHKGENERC Check generic
CHKGENOBJ Check generic object
CHKOBJ3 Check object 3
CMPLSTPARM Compare list parameters
CRTDUPPF Create duplicate physical file
CVTLIBDBF Convert library data base files
CVTMBRD Convert member description
DSPDLTSPC Display deleted space
EXTLST Extract list
EXTLST2 Extract list 2
RTVDBFA Retrieve data base file attributes
RTVFLDARR Retrieve field array
RTVSYSVAL3 Retrieve system value 3
SNDCOMPMSG Send completion message
SNDESCMSG Send escape message
SNDJLGMSG Send job log message
SNDSTSMSG Send status message
None, the tool is ready to use.
Objects used by the tool
Object Type Attribute Src member Src file
------ ---- --------- ---------- ----------
CVTDLTSPC *CMD TAADBKD QATTCMD
TAADBKDC *PGM CLP TAADBKDC QATTCL
TAADBKDR *PGM RPG TAADBKDR QATTRPG
TAADBKDP *FILE PF TAADBKDP QATTDDS
TAADBKDC CL Pgm
TAADBKDR RPG Pgm - does record output
TAADBKCC2 CL Pgm - does RTVDBFA (from DSPDLTSPC)
TAADBKCR2 RPG Pgm does RTVFLDARR (from DSPDLTSPC)