INDEX command

Used to create an index for an ACL table that allows direct access to the records in a sequential rather than a physical order.


INDEX <ON> key_field <...n> <D> TO file_name <IF test> <WHILE test>
<FIRST|NEXT range> <OPEN> <ISOLOCALE locale_code>


ON key_field

Specifies the field(s) to index on.


Optional. Specifies that key fields are sorted in descending order. The default sort order is ascending.

TO file_name

The name of the index. The index file is created with an .INX extension.

IF test

Optional. Specifies a condition that must be met. The command is executed on only those records that meet the condition.

WHILE test

Optional. Specifies that the command is executed only while a condition is true. The command processing terminates as soon as the specified condition evaluates as false, or the end of the table is reached.

FIRST | NEXT range

Optional. Specify FIRST to start processing at the first record or NEXT to start processing at the currently selected record. Use the range value to specify the number of records to process.


Specifies that the table should be opened, and that the index should be applied to the table.

ISOLOCALE locale_code

Optional. This parameter is only available in the Unicode edition of ACL. Specifies the locale. If you do not specify a locale, ACL uses the default locale. Locale codes are based on the ISO 639 standard language codes and the ISO 3166 standard country codes. Enter locale_code in the format language code_country code. For example, enter the code fr_ca for Canadian French. If you do not specify a country, ACL uses the default country for the language.


The following example opens the Vendor table, and creates an index on the “Vendor City” column, and applies the index to the table.

OPEN Vendor
INDEX ON Vendor_City to “CityIndex” OPEN
Related reference
SORT command

(C) 2015 ACL Services Ltd. All Rights Reserved.