Definition Attributes
Data Definition Language (DDL) Reference Manual — 426798-002
6- 22
OCCURS Clause
INDEXED BY index-name
specifies the index attribute for COBOL output only;
index-name
is the name of a
field to use as an index. The maximum length of the index name is 30 ASCII
characters.
OCCURS Clause Guidelines
The following points are guidelines for using the OCCURS clause:
•
OCCURS cannot be specified for the first element of a RECORD or DEFINITION
statement. OCCURS can be specified only at level number 02 or greater.
•
A field that is described with an OCCURS clause or that is part of a group
described with an OCCURS clause cannot have a VALUE clause unless the
VALUE is associated with a level 88 condition-name clause.
•
A field or group described with an OCCURS clause cannot be specified as a key
field in a RECORD statement.
•
OCCURS clauses can be nested. COBOL allows seven levels of nested OCCURS
clauses.
•
When OCCURS clauses are nested, a separate subscript is associated with each
level of nesting; the subscripts are written in order from most inclusive to least
inclusive.
•
The form of the subscript depends on the language. For example, COBOL
encloses subscripts in parentheses, and pTAL or TAL encloses them in brackets.
Subscript bounds depend on the language accessing the data:
°
For COBOL, FORTRAN, and Pascal, the subscript bounds are implicitly 1
and max.
°
For C and TACL, the subscript bounds are implicitly 0 and max -1.
°
The values of pTAL, TAL, or Pascal subscripts depend on the TALBOUND or
PASCALBOUND command. TALBOUND 0 or PASCALBOUND 0 causes the
subscript bounds to be 0 and max - 1. TALBOUND 1 or PASCALBOUND 1
causes the subscript bounds to be 1 and max.
DDL compiles the TALBOUND and PASCALBOUND setting (0 or 1 for each)
into the OCCURS definition. You can change this value only by replacing the
definition.
•
COBOL output for the INDEXED BY attribute is the direct translation of the
attribute.
•
If you specify an index name in the OCCURS clause, you should not specify
USAGE IS INDEX for the field of that name, because COBOL requires that all
index names be unique throughout a program. DDL checks for the uniqueness of
an index name you specify in the INDEXED BY attribute.
Содержание DDL D40
Страница 36: ...Introduction to DDL Data Definition Language DDL Reference Manual 426798 002 1 14 Examining a Dictionary ...
Страница 66: ...Named Constants Data Definition Language DDL Reference Manual 426798 002 4 10 Standard SPI Constants ...
Страница 230: ...Dictionary Manipulation Statements Data Definition Language DDL Reference Manual 426798 002 8 14 SHOW USE OF Statement ...
Страница 370: ...Dictionary Maintenance Data Definition Language DDL Reference Manual 426798 002 10 24 Converting a Dictionary ...
Страница 456: ...Sample Schemas Data Definition Language DDL Reference Manual 426798 002 B 12 ASSNDDL Statements ...
Страница 470: ...DDL Data Translation Data Definition Language DDL Reference Manual 426798 002 C 14 ...
Страница 528: ...Dictionary Reports Data Definition Language DDL Reference Manual 426798 002 E 8 Requesting Reports ...
Страница 552: ...DDL Alignment Rules Data Definition Language DDL Reference Manual 426798 002 H 4 FIELDALIGN_SHARED8 Alignment Rules ...
Страница 576: ...Index Data Definition Language DDL Reference Manual 426798 002 Index 22 Special Characters ...