ProvideX V8.20 > Language Reference > 2. Directives
165
KEYED Directive
             Create Single/Multi-Keyed File
Format
KEYED filename$,[,extkey_len][,key_def$][,max_recs[,rec_size]][,fileopt]
Where:
filename$
Name of the Keyed file to create. String expression.
extkey_len
Numeric expression. Length of the external key for all records in the file
(maximum 127 characters).
key_def$
String expression defining the key. The Keyed file can be single- or
multi-keyed. A key definition is made up of one or more key field
definitions ranging 0 to 15 for FLR/VLR files or 0 to 255 for EFF files. Use
integers for specific field numbers, or 0 zero for record-based offsets. The
key definition formats are as follows:
Single key field:
[["keyname":]field:offset:len[:"attr"] ]
Composite key fields (using the + operator):
[["keyname":]field:offset:len[:"attr"] ]+[field:offset:len[:"attr"] ]
Multi-keyed alternate key fields are comma-delimited:
[["keyname":]field:offset:len[:"attr"] ], [["keyname":]field:offset:len[:"attr"] ]
Where:
keyname Name of key assigned for use in KNO=name$ options.
field
Integer, 1 to number of fields (0 = record-based offset).
offset
Starting position within the field (integer, 1 to 3839).
len
Number of characters in the key field (integer, max. 127)
Attribute characters, see Key Definition Attributes, p.166
"attr"
:
Colon - the separator for elements in a key segment.
The maximum total size for an external key is 127 characters. The
maximum length for internal or alternate keys is 240 characters.
Note: The outer set of square brackets in the above formats are part of the
syntax; the inner brackets indicate optional syntax items (i.e., the brackets
enclosing the optional [:"attr"] are not part of the syntax).
max_recs
Maximum number of records the file is allowed. Optional numeric
expression. The default is zero (no limit). (Use a comma with no value
to set the default.) If a positive value is supplied, ProvideX creates
and pre-allocates disk space for the file. With a negative value,
ProvideX allocates sufficient disk space for the file, but will set the
max_recs count back to zero (unlimited).
rec_size
Maximum size of the data portion of the record (excluding the key). A
negative value creates a variable-length record (VLR) data file with the
maximum record length equal to the positive value of this field. A positive
value creates a fixed-length record (FLR) formatted file.