Definition Attributes
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
04 empname
04 dept
02 taxinfo
04 spousename
04 dependents
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
...
02 taxinfo
04 spousename
04 dependents
OCCURS Clause
The OCCURS clause specifies that a field or group is repeated a fixed number of
times
.
OCCURS {max
{constant-name}
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.
Data Definition Language (DDL) Reference Manual—426798-002
PIC 9(4).
PIC X(22).
PIC X(4).
NULL 0.
PIC X(22).
PIC 9(2).
VALUE 0.
NULL null-0.
PIC X(22).
PIC 9(2).
} [TIMES] [INDEXED BY index-name]
6- 21
OCCURS Clause