Enform Plus Reference Manual
Enform Plus Language Elements
Enform Plus Reference Manual—422684-001
3-10
Subscripts
The valid subscript values for u-var are 1 through 24. Valid subscript values for
database tables are defined by the OCCURS clause in the dictionary description of the
table. For example:
02 monthly-sales OCCURS 12 TIMES.
The valid subscript values for monthly-sales are 1 through 12.
Both user and database tables can be referenced without a subscript. Enform Plus uses a
default a subscript of 1. For example:
Including a subscript with a user or database table reference identifies the individual
elements of the table. For example:
A subscript-range can be included in user or database table references when the
table is the target-item in a LIST statement. Subscript-range is illegal if a database table
is modified by a BY, BY DESC, ASCD, or DESC clause. (See Section 5, Clauses
for
information about these clauses.) Including subscript-range is the same as
referencing the table elements individually. For example:
Enform Plus does not allow arithmetic on subscript ranges. For example,
LIST (employee [1:5].salary * 1.10)
is invalid.
In the dictionary record description, a database table can be defined as a group element
with subordinate database field entries. For example:
02 sales OCCURS 12 TIMES.
10 month PIC X(3).
10 top-dept PIC 9999.
Enform Plus allows you to refer to the subordinate database fields as follows:
u-var Refers to the first element of the database table.
monthly-sales Refers to the first element of the database table.
u-var [ 2 ] Refers to the second element of the database table.
monthly-sales [ 4 ] Refers to the fourth element of the database table.
u-var [ 3:8 ] Refers to the third through eighth elements of the
database table.
monthly-sales [ 1:4 ] Refers to the first through fourth elements of the
database table.
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.