Product Documentation

FairCom ISAM for C

Previous Topic

Next Topic

ctpartadmin - Partitioned File Administration Utility

The generalized partitioned file administration utility is used to easily manage partitioned files.

ctpartadmin [-u user] [-p password] [-s server] [-f filename] [-w file password] [-c command] [-n partition number] [-d partition name] [-k partition key] {-a authfile}


  • -u: User ID
  • -p: User Password
  • -s: Server (default: FAIRCOMS@localhost)
  • -f: File name
  • -w: File password
  • -a: Authentication file name
  • -c: Partition Admin commands:

    add - Add new partition

    create - Create a partition index

    purge - Delete existing partition

    archive - Archive existing partition

    activate - Activate archived partition

    base - Set partition number low limit

    status - Return partition status

    rebuild - Rebuild partition

    lowbound - Get active low partition number

    highbound - Get active high partition number

The following options apply to the -c create command.

  • -r: Partition rule expression string. If the expression string contains space characters, the string should be specified within quotes.

    ctpartadmin -c create -r "year(co_ordrdate) - 2000"

  • -i: The name used to reference the index. The index name is combined with the table name to make up the index file name. For example, the following creates an index file custordr_part.idx

    ctpartadmin -c create -f custordr -i "part"

  • -I: (uppercase i) The same as -i but the partition index is created to allow only unique keys
  • -g: The name of the field used to make the partition key, sorted in ascending order
  • -G: The name of the field used to make the partition key, sorted in descending order

    The -g and -G options can be combined and specified multiple times to create a multi-segment key

    ctpartadmin -c create -f customer-orders -G customer_category -g order_date

The following options are mutually exclusive, and only one is required (not required for lowbound or highbound options). If more than one is entered, the last option entered prevails.

  • -n: Partition number (rawno)
  • -d: Partition file name
  • -k: Partition file key

ctpartadmin return code is used for the status command.

lowbound and highbound output a single value for capture. This value is a LONG.

When the -c create command option is successful the 'file partitioned' message is displayed, and the -c status command option displays 'partition active'

>ctpartadmin -c create -f custordr.dat -u admin -p ADMIN -r year(co_ordrdate) -i part -g co_ordrdate

file partitioned

>ctpartadmin -f custordr.dat -u admin -p ADMIN -c status -n 2002

partition active