Definition Attributes
Data Definition Language (DDL) Reference Manual — 426798-002
6- 21
OCCURS Clause
NULL Clause Examples
The following example shows the use of the NULL clause. In this example, if the
employee does not have a spouse or dependents, the key is not added to the alternate
key file:
RECORD employee.
FILE IS "employee" key-sequenced.
02 empinfo.
04 empid PIC 9(4).
04 empname PIC X(22).
04 dept PIC X(4).
02 taxinfo NULL 0.
04 spousename PIC X(22).
04 dependents PIC 9(2).
KEY IS empid.
KEY "ti" is taxinfo.
END
You could also use a constant name to specify the NULL value in the preceding
example; for example:
CONSTANT null-0 VALUE 0.
...
02 taxinfo NULL null-0.
04 spousename PIC X(22).
04 dependents PIC 9(2).
OCCURS Clause
The OCCURS clause specifies that a field or group is repeated a fixed number of
times
.
max
is an integer from 1 to 32,767 that specifies the number of times the field or group
is repeated.
constant-name
is the name of a constant in the open DDL dictionary. The constant value must be
a valid
max
value.
OCCURS {max } [TIMES] [INDEXED BY index-name]
{constant-name}