Product Documentation

Database Integrity Utilities

Previous Topic

Next Topic

ctscmp - Superfile Compact Utility

Operational Model:

  • Standalone

Usage:

ctscmp <name of the superfile host to compact> [Y] [new_sect_size]

Arguments

  • <filename> The name of the superfile to compact or scan
  • -scanonly Scan the superfile only; do not compact it. The -scanonly option generates details from the header, extended header, IFIL, and DODA. It outputs the number of key values, active records, deleted records and resource records. Using this utility with the -scanonly option is useful for comparing superfiles before and after compacting them.
  • Y An optional parameter; if specified, the utility compacts the file without prompting to confirm (otherwise you will be prompted).
  • <sect> An optional sector size of the resulting file (sect*128 = page size) to use for the new superfile. If <sect> is omitted, the new superfile is created using the same page size as the original superfile.

Description

The superfile compact utility, ctscmp, compacts and rebuilds a superfile and all of its members provided the required IFIL resources are present in the superfile data members. It creates a compacted version of the file in place, using a temporary file named CTREE.TMP as a destination and then renaming it.

This utility is designed for the Standalone Single-user model. It compacts and rebuilds a superfile and all of its members provided the required IFIL structures are in place. It creates a compacted version of the file in place, using a temporary file named CTREE.TMP as a destination and then renaming it.

The utility supports processing data and index member names having extensions other than .dat and .idx.

A “% complete” progress indicator has been added to the ctscmp utility.

The ctscmp utility uses a standard error and warning message format. Error messages begin with the text ‘Error:’ and warning messages with the text ‘Warning:’, so errors and warnings can easily be located in the ctscmp output.

There is an ISAM-based version of the superfile compact utility named ctscmpi. This version of the superfile compact utility uses ISAM c-tree functions rather than low-level c-tree functions to add records to the new compacted superfile. The advantage of using the ISAM approach is that records are indexed as they are added, so the utility does not require a separate rebuild phase to repopulate the indexes as the ctscmp utility does. Using this technique can significantly reduce the time required to compact a superfile.

The ctscmp utility returns a non-zero value when it fails. This can be useful for a script that calls the utility to be able to detect when it fails.

TOCIndex