Subscripts; Indexing - Control Data Corporation 3300 Reference Manual

Computer systems usasi cobol/ master
Table of Contents

Advertisement

4.5
TABLE HANDLING
4.5.1
SUBSCRIPTS
4.5.2
INDEXING
60229400
The table handling functions provide a method for accessing tables of repet-
itive contiguous data items. Tables described with the OCCURS clause in the
Data Division are scanned with the SEARCH statement in the Procedure
Division. Items in tables also may be referenced by subscripting (up to
three levels) or by indexing.
Subscripts are used only when reference is made to an individual element in
a list or table of like elements that have not been assigned individual data
names. The subscript is a numeric literal integer, the special register
TALLY, or a data name. The data name must identify a numeric elementary
item that represents an integer. The data name used as a subscript
m~y
be
qualified but not subscripted.
The subscript may contain a sign, but the lowest permissible subscript value
is
1.
The highest permissible subscript value, in any particular case, is
the maximum occurrences of the item as specified in the OCCURS clause.
The subscript, or set of subscripts, that identifies the table element is en-
closed in parentheses immediately following the terminal space of the table
element data name. The table element data name appended with a subscript
is called a subscripted data name or an identifier. When more than one sub-
script appears within a pair of parentheses, the subscripts must be separated
by commas. A space must follow each comma, but no space may appear
between the left parenthesis and the leftmost subscript or between the right
parenthesis and the rightmost subscript.
data-name
[l
:!
data-narne-l]- .. (subscript [, subscript] ... )
Indexing is used to reference individual elements within a table of like elements.
An index name is assigned to the level of the table in which it appears with
the INDEXED BY option of the OCCURS clause when the table is described in
the Data Division. The index name is initialized by a SET statement before
it is used as a table reference.
Direct indexing is specified by using an index name as a subscript. Relative
indexing is specified when the index name is followed by the operator
+
or -
followed by an unsigned integral numeric literal all enclosed in the parentheses
immediately following the terminal space of the data name.
4-15

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the 3300 and is the answer not in the manual?

This manual is also suitable for:

3500

Table of Contents