HP DDL D40 Reference Manual page 116

Data definition language
Table of Contents

Advertisement

Definition Attributes
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.
Data Definition Language (DDL) Reference Manual—426798-002
6- 22
OCCURS Clause

Advertisement

Table of Contents
loading

Table of Contents