CISAM Verb - Create C-ISAM File

Syntax

CISAM fileid,keysize,records,recsize{,ERR=lineref}
CISAM fileid,keydef{,keydef...},records,recsize {,ERR=lineref}

Description

The CISAM verb creates a keyed file that is similar to a DIRECT file but allows up to 16 keys composed of up to 48 key segments per record.

  • The first syntax example shows the definition of a C-ISAM file with only one key per record. This type of C-ISAM file may be used in place of a DIRECT file without changes to application programs.

  • The second syntax example shows how to define a C-ISAM file with more than one key per record. In this case, each key must be present within the data record. The bracketed expressions indicate the location of each key within the record. Bracketed expressions separated by a plus (+) sign indicate a composite key made from several parts of the record.

    Parameter

    Description

    fileid

    Name of the new file, must be unique.

    keysize

    Maximum length of a key in the file; must be an integer in the range of 1 to 120.

    keydef

    Key definition. Each keydef has the following syntax:

    segment{+ segment...}

    Each segment has the following syntax:

    [offset:len]

    records

    Integer that establishes the maximum number of records in the file. If records is 0, then the number of records in the file is dynamically allocated. Total file size may increase as new keys are added, regardless of the number of keys previously written.

    recsize

    Size of each record in bytes and must be an integer in the range of 1 to 32767. The total size of the file cannot exceed (2^31)-1 bytes.

    ERR=lineref

    Branch to be taken if an error occurs during execution.

CISAM does not support keys with the descending bit set.

NOTE: The CISAM verb requires the presence of the run time modules for INFORMIX C-ISAM files with the operating system to execute. The CISAM verb is not available on all systems.

See C-ISAM Files for additional information.

Examples

Example 1

The following defines a simple C-ISAM file with one key per record, similar to a DIRECT file:

CISAM "MYFILE",10,80,1000

Example 2

The following defines a C-ISAM file with two keys of one segment each. Brackets indicate where the key can be found in the record.

CISAM "MYFILE",[0:4:2],[0:1:10],80,1000

Example 3

The following defines a C-ISAM file with three keys, one composed of two segments. Brackets indicate where the key can be found in the record. The "+" used between bracket expressions indicates a composite key.

CISAM "MYFILE",[0:1:10]+[0:15:5],[0:25:2],[0:12:3],80,1000

See Also

Data Server Syntax

Verbs - Alphabetical Listing