Definitions and Records
Data Definition Language (DDL) Reference Manual — 426798-002
5- 25
Key Assignment Syntax
Key Assignment Guidelines
The following points are guidelines for making key assignments:
•
Only key-sequenced records can have a key-specifier with a value of 0, indicating
a primary key. Key-sequenced records must have one and only one primary key.
•
A key defined with a nonzero key specifier, such as “NM” or 32000, is an
alternate key.
•
Unstructured file records cannot have alternate keys.
•
For COBOL, keys must be alphanumeric. For COBOL, this is a picture of all X’s, a
picture of all 9’s (without a sign), or TYPE CHARACTER.
•
DDL ignores any key assignment specifications when generating TACL source
code from a RECORD statement.
RECORD Statement Examples
The RECORD statement examples refer to the following DEFINITION statements, and
the first DEFINITION statement refers to the following CONSTANT statements:
CONSTANT phone-heading VALUE IS "Phone Number".
CONSTANT phone-display VALUE IS "M<(999) 999-9999>".
DEF phone HEADING phone-heading
DISPLAY phone-display .
02 area-code PIC 9(3) .
02 prefix PIC 9(3) .
02 numb PIC 9(4) .
END
DEF addr .
02 address PIC X(22) .
02 city PIC X(14) .
02 state PIC X(12) .
END
DEF custinfo .
02 custnum PIC 9(4) .
02 custname PIC X(18) .
02 addr TYPE * .
END