Data Definition Language (DDL) Reference Manual
Definition Attributes
Data Definition Language (DDL) Reference Manual—529431-004
6-20
OCCURS
You can also use a constant name to specify the NULL value.
OCCURS
The OCCURS clause repeats a field or group a fixed number of times.
max
specifies the number of times the field or group repeats. You can specify max
either as an integer or as the name of a constant in the open dictionary. The value
of max must be an integer from 1 through 32,767.
index-name
is the name of a field to use as an index. The maximum length of index-name is
30 ASCII characters.
Example 6-15. NULL Clause
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
Example 6-16. Specifying NULL Value With a Constant
CONSTANT null-0 VALUE 0.
...
02 taxinfo NULL null-0.
04 spousename PIC X(22).
04 dependents PIC 9(2).
OCCURS max [ TIMES ] [ INDEXED BY index-name ]
Note. Use INDEXED BY index-name only for COBOL.