4-56
Format 1:
A simple SEARCH statement defines a linear search (a serial type of search
operation) . The search starts by checking the character address bias of the
first (or only) index name listed in the INDEXED BY option for this table.
The character address bias is the value which, when added to the base address
of a table, gives the character address of a particular element in the table.
If
this value
is
greater initially than the highest permissible location value for
identifier-I, the search terminates.
If
the AT END clause is specified, the imperative statement associated with
A T END is executed; otherwise, control passes to the next sentence.
If
the
character address bias is not greater than the highest permissible location
value for identifier-I, the conditions specified in the SEARCH statement are
evaluated in the order they are written.
If
no condition is satisfied, the index name is incremented by the element
character offset to reference the next table element. The element character
offset is the number of character positions in a table element. This process
is repeated until one of the conditions is satisfied or the character address
bias of the index name exceeds the table limit by one or more entries.
If
a condition is satisfied, the imperative statement associated with the
condition is executed. The index name remains set at the character address
bias of the entry which satisfied the condition.
If
the table limit is exceeded before a condition is satisfied, the AT END
imperative statement is executed; otherwise, control passes to the next
sentence.
If
the SEARCH statement references an identifier-l in a group or hierarchy
of groups described with an OCCURS clause, each group must have an
associated index name. Index name settings are used throughout the SEARCH
to refer to identifier-lor items within it. Only the index name associated
with identifier-l is incremented by the SEARCH; the items identifier-2 or
index-name-l are also incremented if they are specified in the VARYING option.
The VARYING option permits the location of entries in an associated table
simultaneously with location of entries in the primary table (identified by
identifier-I).
If
index-name-l appears in the INDEXED BY clause describing
identifier-I, that index name is used for the search, otherwise the first (or
only) index name given in the INDEXED BY clause of identifier-l is used.
However, if index-name-l appears in the INDEXED BY clause of another table,
index-name-l is incremented by the character address bias of the other table.
60229400
Need help?
Do you have a question about the 3300 and is the answer not in the manual?