Search - Control Data Corporation 3300 Reference Manual

Computer systems usasi cobol/ master
Table of Contents

Advertisement

4.7.21
SEARCH
60229400
The SEARCH statement is used
to
search a table for an element that satisfies
the specified condition and to adjust the associated index name or index data
item to point
to
that table element. (See Table Handling, section 4.5, also
OCCURS, section 3.5.6, and SET, section 4.7,2.3.)
Format I (linear search):
.
. .
[
{indeX-name-I}]
SEARCH Identifler-I VARYING
identifier-2
[; AT END imperative-statement-I]
. .
{im p erative-statement-2 }
; WHEN condltlOn-l
NEXT SENTENCE
[
. .
{ imperative-statement-3 }]
; WHEN condltlOn-2
NEXT SENTENCE
Format 2 (bisecting search):
fI"\
SEARCH ALL identifier-I [; AT END imperative-statement-I]
t>
Q;~
}V'
. . {
imperative-statement-2 "}
~ Y~J.
; WHEN conditIon-1
NEXT SENTENCE
.r
(
ty\
___
..:;:;.=-=-~:;.;:;..;...=
~
'10
Identifier-I cannot be subscripted or indexed. Its description must contain an
OCCURS clause with the INDEXED BY option.
In
format 2, identifier-I must
also contain the KEY
IS
option in its OCCURS clause. When format I is used,
condition-I, condition-2, etc, are any conditions defined in section 4.3.
In
format 2, condition-I is limited to a relation condition using the relational
operator EQUAL TO
(=),
a condition-name condition, or a compound condition
formed by joining the first two conditions with an AND.
If
index-name-I is specified in the VARYING option, it must appear in the
INDEXED BY option of an OCCURS clause describing either the table associated
with identifier-lor another table.
If
index-name-l is in the INDEXED BY
option of another table, the first (or only) index-name given in the INDEXED
BY option for identifier-I is used and index-name-I is simultaneously incre-
mented by the element character offset of the other table.
If
identifier-2 is specified in the VARYING option, it must be either an index
data item described with a USAGE IS INDEX clause or an elementary numeric
item with no positions
to
the right of the assumed decimal point.
4-55

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?

Subscribe to Our Youtube Channel

This manual is also suitable for:

3500

Table of Contents