Create Alternate Index Definition (CA)

Command title

Create Alternate Index Definition


This command creates and stores the definition of an Alternate Index into a tableBASE library.

COBOL syntax

MOVE 'CA'                   TO xxxx-COMMAND.

C syntax

memcpy( tbCommArea.tbCommand, "CA", 2 );
TBLBASE( &tbParm, &tbCommArea, pDataTableName,
         &tbAltDefinition );


DATA-TABLE-NAME indicates the name of the Data Table. This information is stored with the definition of the Alternate Index. This can be left as blanks.

ALT-DEFINITION—Definition of the Alternate Index


The existence of the Data Table is not checked until the Alternate Index is opened (OR, OW) or invoked (IA).

If the DATA-TABLE-NAME was not specified, i.e. left as blanks, the alternate created cannot be opened with an OR or OW. It must be supplied during a subsequent IA.

Any number of Alternates Index definitions may be created against a single Data Table.

Return value

Previous releases returned error code 0083 for non-pointer (true) data tables, which were not supported.


An Alternate Index can be defined on the library with the Create Alternate (CA) command, and then invoked with an Open command. A temporary Alternate Index can be defined with the Invoke Alternate (IA) command without placing it on the library (see Invoke Alternate Index (IA)).

The table must be closed for this command.


Starting with Version 6, CA can be issued against a true table as well as a pointer data table.

See also

Figure 108—illustrates the use of CA and IA in conjunction with other tableBASE commands.

See Opening an Alternate Index.