Occurs Depending On Clause - HP DDL D40 Reference Manual

Data definition language
Table of Contents

Advertisement

Definition Attributes
03 year
END
The following shows COBOL output for the INDEXED BY attribute:
DDL Code
DEF xyz
02 abc TYPE BINARY
OCCURS 3 TIMES
INDEXED BY ix.
END.

OCCURS DEPENDING ON Clause

The OCCURS DEPENDING ON clause declares a field or group that is repeated a
variable number of times depending on the current value of an integer variable.
DDL uses only the maximum value of the OCCURS DEPENDING ON clause when
generating C, FORTRAN, Pascal, pTAL, TACL, or TAL source code.
OCCURS min TO max TIMES DEPENDING ON field-name
[INDEXED BY index-name]
min
is the least number of times the field or group can be repeated. You can specify
min as an integer between 0 and 32,767 or as the name of a constant in an open
DDL dictionary. The constant value must be an integer between 0 and 32,767.
max
is the greatest number of times the field or group can be repeated. You can specify
max as a positive integer greater than or equal to min or as the name of a
constant in an open DDL dictionary. The constant value must be a positive integer
greater than or equal to min.
field-name
identifies an existing field within the same definition and with a numeric data type; it
must contain a positive integer value to specify the number of repetitions.
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.
Data Definition Language (DDL) Reference Manual—426798-002
PIC 99.
COBOL Code
01 XYZ.
6- 24
OCCURS DEPENDING ON Clause
02 ABC NATIVE-2
OCCURS 3 TIMES
INDEXED BY IX.

Advertisement

Table of Contents
loading

Table of Contents