Data Definition Language (DDL) Reference Manual
Definitions and Records
Data Definition Language (DDL) Reference Manual—529431-004
5-17
Key Assignment Syntax
When you use record reference syntax, you must declare any key fields with a key
assignment at the end of the RECORD statement. You cannot use a KEYTAG clause
to declare key fields with a reference record structure.
Key Assignment Syntax
In the statement RECORD on page 5-8, key-assignment specifies specifies one or
more fields or groups of fields as Enscribe keys, assigns key specifiers to key fields,
and specifies that a file is to be sorted on a nonkey field or group of fields.
KEY key-specifier
specifies a field or group of fields as an Enscribe key and assigns a key specifier to
the key. You can specify key-specifier either as an integer from -32,768
through 32,767; as two ASCII characters enclosed in quotation marks; or as the
name of a constant in the open dictionary. The value of the constant must be either
an integer from -32,768 through 32,767 or a string of two ASCII characters.
You can omit key-specifier for a primary key, but if you include it, its value
must be 0. A nonzero value for key-specifier indicates an alternate key.
{ group-name | field-name }
is the name of a group or field used as either a primary key, an alternate key, or a
sequence field. If the name is not unique in the dictionary, the name must be
qualified to make it unique.
file-name
is the file name of the alternate key file for the specified key.
Default: Primary file name with a number appended
Note. The DDL compiler ignores key-assignment when generating TACL source code
from a RECORD statement.
KEY key-specifier IS { group-name | field-name }
[ FILE IS ["]file-name["] ]
[ DUPLICATES [ NOT ] ALLOWED ] . ] ...
[ UPDATE [ NOT ] ALLOWED ]
[ SEQUENCE IS [ ASCENDING ] { group-name } ]
[ [ DESCENDING ] { field-name } .]