Data Definition Language (DDL) Reference Manual
Definition Attributes
Data Definition Language (DDL) Reference Manual—529431-004
6-12
KEYTAG
KEYTAG
The KEYTAG clause specifies that the field or group is an Enscribe key field.
key-specifier
is either as an integer from -32,768 through 32,767; two ASCII characters enclosed
in quotation marks; or 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.
DUPLICATES [NOT] ALLOWED
specifies whether to allow duplicate alternate key values. Do not specify
DUPLICATES ALLOWED for a primary key field.
Default: DUPLICATES ALLOWED
If you use the KEYTAG clause to declare a record’s key fields, you can omit key-
assignment in the RECORD statement (as in Example 6-10 on page 6-12).
Key fields can overlap.
Note. The DDL compiler ignores this clause when generating TACL source code.
KEYTAG key-specifier [ DUPLICATES [NOT] ALLOWED ]
Example 6-10. KEYTAG Clause
CONSTANT partnum-heading VALUE IS "Part/Number".
CONSTANT partnum-display VALUE IS "M<ZZZ,ZZ9.99>".
RECORD partinfo.
FILE IS "$data.sales.parts" KEY-SEQUENCED.
02 partnum PIC 9(4) KEYTAG 0
HEADING partnum-heading.
02 partname PIC X(18) KEYTAG "pn".
02 inventory PIC 9(3)S.
02 location PIC X(3).
02 price PIC 9(6)V99 DISPLAY partnum-display.
END