Occurs - Control Data Corporation 3300 Reference Manual

Computer systems usasi cobol/ master
Table of Contents

Advertisement

3.5.6
OCCURS
3-18
The OCCURS clause eliminates the need for separate entries when the items
in a sequence are identical
to
each other in every respect except value. It
also supplies information required to subscript or index the repeated items.
OCCURS [integer-l T01 integer-2 TIMES [DEPENDING ON data-name-l]
[l
ASCENDING
I
DESCENDING
KEY IS data-name-2 [, data-name-3]
...
]
[ INDEXED BY index-name-l [, index-name-2] ..• ]
Each integer must be positive.
If
both are used, the value of integer-l must
be less than that of integer-2. The value of integer-l can be zero; the value
of integer-2 can never be zero.
The OCCURS clause is optional. It cannot be specified in a data description
entry that has:
A level number of
01
or 77
Subordinate item containing the OCCURS ... DEPENDING ON option
The OCCURS clause is used
to
define tables
and
other homogeneous sets of
repeated data.
The data name which is the subject of the data description
entry containing the OCCURS clause must be either subscripted or indexed
when it is referenced by any statement.
If
the entry containing OCCURS is a
group item, each data name in the group must also be subscripted or indexed
when referenced. The other clauses in an entry containing OCCURS apply to
each occurrence of the item they describe. Three levels of nested OCCURS
clauses are permitted.
The DEPENDING ON option is used to specify that the subject of the entry has
a variable number of occurrences. Integer-l represents the minimum number
of occurrences and integer-2 the maximum.
If
the DEPENDING ON option is
not specified, integer-2 is the exact number of occurrences and integer-I, if
specified, is documentary only. Data-name-l contains the count of the actual
number of occurrences; its value must not exceed integer-2. Data-name-l
must be a positive COMPUTATIONAL integer; if it is described in the same
record as the current entry, it must not be the subject of, or be subordinate
to, an entry containing an OCCURS •.. DEPENDING ON clause. The value of
data-name-l should not be reduced below the actual number of occurrences
of the data items; otherwise, the content of any data items whose occurrences
exceed the new value of data-name-l become unpredictable. An entry con-
taining the DEPENDING ON option must not be the object of a REDEFINES
clause.
60229400

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the 3300 and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

3500

Table of Contents