OCCURS Integer-2 TIMES[ {ASCENDING } KEY IS {Data-Name-4} ... ] ...{DESCENDING}[ INDEXED BY {Index-Name} ... ]
[ {ASCENDING } KEY IS {Data-Name-4} ... ] ...{DESCENDING}[ INDEXED BY {Index-Name} ... ]
[ {ASCENDING } KEY IS {Data-Name-4} ... ] ...{DESCENDING}[ INDEXED BY {Index-Name} ... ]
1. The OCCURS clause must not be specified in a data description entry that has a variable occurrence data item subordinate to it.
2. Data-Name-3 and Data-Name-4 may be qualified.
3. The first specification of Data-Name-4 must be the name of either the entry containing the OCCURS clause or an entry subordinate to the entry containing the OCCURS clause. Subsequent specification of Data-Name-4 must be subordinate to the entry containing the OCCURS clause.
4. If Data-Name-4 is subordinate to an alphanumeric group item or national group item that is subordinate to the entry containing the OCCURS clause, that group item shall not contain an OCCURS clause.
5. Data-Name-4 must be specified without the subscripting normally required.
6. The data item identified by Data-Name-4 shall not contain an OCCURS clause except when Data-Name-4 is the subject of the entry.
7. Data-Name-4 shall not reference a variable-length group.
8. Where both Integer-1 and Integer-2 are used, Integer-1 must be greater than or equal to zero and Integer-2 must be greater than Integer-1.
9. If the DEPENDING ON phrase is not specified, an OCCURS clause may be subordinate to a data description entry that contains another OCCURS clause as long as the number of subscripts required does not exceed sixteen.
10. Data-Name-3 must describe an integer.
11. In Format 2, the data item defined by Data-Name-3 must not occupy a character position within the range of the first character position defined by the data description entry containing the OCCURS clause and the last character position defined by the record description entry containing that OCCURS clause.
12. If the OCCURS clause is specified in a data description entry included in a record description entry containing the EXTERNAL clause, Data-Name-3 shall reference a data item possessing the external attribute that is described in the same data division.
13. A data description entry that contains Format 2 of the OCCURS clause may only be followed, within that record description, by data description entries which are subordinate to it.
14. An INDEXED BY phrase is required if the subject of this entry, or an entry subordinate to this entry, is to be referenced by indexing.
15. Index-name must be a unique word within the program.
16. Data-name-5 shall not be defined elsewhere in the source element. If qualifiers are required for uniqueness, it shall be treated as though implicitly defined at the same level as the entry containing the OCCURS clause.
17. Data-name-5 shall not be referenced as a receiving item, except as the operand of a variable-table format SET Statement.
1. Except for the OCCURS clause itself, all data description clauses associated with an item whose description includes an OCCURS clause apply to each occurrence of the item described.
a. In Format 1, the value of Integer-2 represents the exact number of occurrences.
b. In Format 2, the current value of the data item referenced by Data-Name-3 represents the number of occurrences.This format specifies that the subject of this entry has a variable number of occurrences. The value of Integer-2 represents the maximum number of occurrences and the value of Integer-1 represents the minimum number of occurrences. This does not imply that the length of the subject of the entry is variable, but that the number of occurrences is variable.At the time the subject of entry is referenced or any data item subordinate or superordinate to the subject of entry is referenced, the value of the data item referenced by Data-Name-3 must fall within the range Integer-1 through Integer-2. The contents of the data items whose occurrence numbers exceed the value of the data item referenced by Data-Name-5 are undefined.
c. In Format 3, Integer-1 is the minimum capacity of the table. If integer-4 is absent, a value of zero is assumed for it. Integer-2 is the expected capacity of the table. Data-Name-3 contains the current capacity of the associated table. Its value is automatically updated as soon as the number of items in the associated table changes.
4. When a group data item, having subordinate to it an entry that specifies Format 2 of the OCCURS clause, is referenced, the part of the table area used in the operation is determined as follows:
a. If the data item referenced by Data-Name-3 is outside the group, only that part of the table area that is specified by the value of the data item referenced by Data-Name-3 at the start of the operation will be used.
b. If the data item referenced by Data-Name-3 is included in the same group and the group data item is referenced as a sending item, only that part of the table area that is specified by the value of the data item referenced by Data-Name-3 at the start of the operation will be used in the operation. If the group is a receiving item, the maximum length of the group will be used.
5. When the KEY IS phrase is specified, the repeated data must be arranged in ascending or descending order according to the values contained in Data-Name-4. The ascending or descending order is determined according to the rules for the comparison of operands. The data-names are listed in their descending order of significance.
6. If Format 2 is specified in a record description entry and the associated file description or sort description entry contains the VARYING phrase of the RECORD clause, the records are variable length. If the DEPENDING ON phrase of the RECORD clause is not specified, the content of the data item referenced by Data-Name-3 of the OCCURS clause must be set to the number of occurrences to be written before the execution of any RELEASE, REWRITE, or WRITE Statement.
7. Data-name-5 defines a numeric data item that contains the current capacity of the associated table. Data-name-5 shall not be referenced as a receiving operand.
8. If INITIALIZED is specified, any unreferenced locations of each new entry added to the table are implicitly initialized.
9.
| Copyright (c) 2017 Veryant |
| Contact us |
|
Please share your comments on this manual or on any Veryant product documentation with the email button at the top left |