ENABLE Reference Manual
ENABLE ATTRIBUTES
EXCLUDE Attribute
Excluding an Elementary Item From a Group Key. If a group item
is an alternate key field and you exclude the first elementary
item from that group, the application will not use the group item
as an alternate key. For example, consider the following record
description:
RECORD employee.
FILE IS ... KEY-SEQUENCED.
02 empnum PIC 9(4).
...
02 dept. <-------------------- group
04 regnum PIC 9(4). <--- first elementary item in the
04 branchnum PIC 9(4). group
...
KEY 0 IS empnum.
KEY "dp" IS dept.
END
If you exclude "regnum," a generated application does not
recognize "dept" as an alternate key; therefore, the application
cannot read records for the file by using this alternate key
field.
If a group item is a key field and you exclude any item other
than the first item in the group, the application uses only the
first intact item of the group as a key field. Consider, for
example, the following record description:
RECORD abc.
FILE IS ... .
02 A.
03 AA.
04 AAA ... .
04 AAB ... .
03 AB ... .
03 AC.
04 ACA ... .
04 ACB ... .
...
KEY 0 IS A.
END
4-21