ENFORM Reference Manual

Subscripts
ENFORM Language Elements
058057 Tandem Computers Incorporated 3–11
Subscript-range can be included in user or data base table references when the table is
the target-item in a LIST statement. Subscript-range is illegal if a data base table is
modified by a BY, BY DESC, ASCD, or DESC clause. (Refer to Section 5 for
information about these clauses.) Including subscript-range is the same as referencing
the table elements individually. For example:
u-var [ 3:8 ] Refers to the third through eighth elements of the user
table.
monthly-sales [ 1:4 ] Refers to the first through fourth elements of the data
base table.
ENFORM does not allow arithmetic on subscript ranges. For example,
LIST (employee [1:5].salary * 1.10)
is illegal.
In the dictionary record description, a data base table can be defined as a group
element with subordinate data base field entries. For example:
02 sales OCCURS 12 TIMES.
10 month PIC X(3).
10 top-dept PIC 9999.
ENFORM allows you to refer to the subordinate data base fields as follows:
sales Refers to month and top-dept within the first element of
sales.
sales [ 2 ].top-dept Refers to top-dept within the second element of sales.
sales [ 2:3 ].month Refers to month within the second through third
elements of sales.
The subordinate elements of a data base table can themselves contain a data base table
resulting in nested data base tables. For example, consider the following record
description:
02 tot-sales OCCURS 12 times.
10 month PIC X(3).
10 top-dept PIC 999.
10 wkly-sales PIC 99999 OCCURS 4 TIMES.