6.2.32.4 Serial Search
The Format 1 SEARCH statement executes a serial search beginning at the
current index setting. When the search begins, if the value of the
index-name associated with identifier-1 is not greater than the highest
possible occurrence number, the following actions take place:
- The condition(s) in the WHEN phrase are evaluated in the order in
which they are written.
- If none of the conditions is satisfied, the index-name for
identifier-1 is increased to correspond to the next table element, and
step 1 is repeated.
- If upon evaluation, one of the WHEN conditions is satisfied, the
search is terminated immediately, and the imperative-statement
associated with that condition is executed. The index-name points to
the table element that satisfied the condition. If NEXT SENTENCE is
specified, control passes to the statement following the closest
period.
- If the end of the table is reached (that is, the incremented
index-name value is greater than the highest possible occurrence
number) without the WHEN condition being satisfied, the search is
terminated, as described in the next paragraph.
If, when the search begins, the value of the index-name associated with
identifier-1 is greater than the highest possible occurrence number, the
search immediately ends, and, if specified, the AT END
imperative-statement is executed. If the AT END phrase is omitted,
control passes to the next statement after the SEARCH statement.
© Copyright IBM Corp. 1991, 1998
IBM Library Server Copyright 1989, 2005 IBM Corporation. All rights reserved.
Return to library:
z/OS |
z/OS.e |
TPF |
z/VSE |
z/VM |
IBM Hardware |
IBM System z Redbooks
Glossary:
IBM terminology
Publications:
How to order publications
Readers:
Download IBM Library Reader |
Download IBM Softcopy Reader |
Download Adobe® Acrobat® Reader®
Library management:
Download IBM Softcopy Librarian
Contacts:
Contact z/OS
Adobe, the Adobe logo, Acrobat, the Acrobat logo, and Acrobat Reader are registered trademarks
of Adobe Systems incorporated.