TAA Tools
TRNDLTRCD       TRUNCATE DELETED RECORDS               TAADBJK

The  Truncate Deleted  Records  command  is  the companion  command  to
CPRDLTRCD.   TRNDLTRCD truncates  the deleted  records starting  at the
back  end of  the file to  the last active  record, resets  the 'end of
data' pointer in the  file, and returns space  to the system (if it  is
a large amount).

You must have *ALLOBJ special authority to run TRNDLTRCD.

TRNDLTRCD  attempts  to  allocate  the  file/member to  an  *EXCL  lock
during  the running of  the command.   An escape message  occurs if the
lock cannot be obtained.  If  a large number of records are  truncated,
the  command  can  take  a  significant   amount  of  time  (see  later
discussion).    The TRNDLTRCD  command  works in  conjunction  with the
CPRDLTRCD command.  They  must run close  to back-to-back.   Therefore,
you must plan when  the complete function is done.   See the discussion
with CPRDLTRCD.

A typical command would be:

             TRNDLTRCD    FILE(xxx)

The command  invokes a system function that performs  the work.  During
the  running of the  system function, there is  no feedback or progress
messages.  When  the system function  is complete, TRNDLTRCD outputs  a
spooled file with the results.

When the  command is  completed and has  removed some  deleted records,
the following has occurred:

  **   The  'end  of  data'  marker has  moved  after  the  last active
       record

  **   The number of deleted records has been reduced

  **   Excess space  (from the  data space)  has been  returned to  the
       system for  use by other functions.   Space is only  returned in
       large  increments  (such as  16MB).   If  the file  has  a keyed
       access path, the system does  not reclaim any potential  savings
       from the space required to hold the access path.

Any  deleted records  prior  to  the last  active  record in  the  file
remain as is.

Performance
-----------

Performance will  vary based on  the number of records,  the CPU speed,
the  number of disk arms, etc.  If you  have a large file, you may want
to try a  smaller subset of the  file so that  you can get an  estimate
of the time required.

TRNDLTRCD escape messages you can monitor for
---------------------------------------------

      TAA9891    The member has no deleted records
      TAA9892    The member cannot be allocated

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

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

   FILE          The  qualified name of  the file.   The  library value
                 defaults to *LIBL.  *CURLIB may also be used.

   MBR           The  member  to  have  deleted  records  removed from.
                 *FIRST is the default.

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

  **   The user of  the command  must have  *ALLOBJ special  authority.
       It can be adopted.

  **   The  file/member  must  be   allocated  exclusively  during  the
       running of the command.

  **   The  command only  removes deleted  records at  the back  end of
       the file (after the  last active record).   Any deleted  records
       before the last active record remain as is.

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

The following TAA Tools must be on your system:

     CHKALLOBJ       Check all object
     CHKOBJ3         Check object 3
     CLCTIMDIF       Calculate time difference
     RTVDBFA         Retrieve data base file attributes
     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
   ------        ----    ---------      ----------    ----------

   TRNDLTRCD     *CMD                   TAADBJK       QATTCMD
   TAADBJKC      *PGM       CLP         TAADBJKC      QATTCL
   TAADBJKR      *PGM       RPGLE       TAADBJKR      QATTRPG
   TAADBJKR2     *PGM       RPG         TAADBJKR2     QATTRPG
					

Added to TAA Productivity tools September 15, 2000


Home Page Up to Top