Library View Topics Framed Contents Revised Topics Previous Topic Next Topic Search Search ResultsPrevious Topic MatchNext Topic Match Notes List Notes Print Download No PDF Handheld DisconnectedHandheld ConnectedHelp

6.2.32.7 Binary Search



The Format 2 SEARCH ALL statement executes a binary search. The search index need not be initialized by SET statements, because its setting is varied during the search operation so that its value is at no time less than the value of the first table element, nor ever greater than the value of the last table element. The index used is always that associated with the first index-name specified in the OCCURS clause.

The results of a SEARCH ALL operation are predictable only when:

identifier-1
Identifier-1 can be:

  • A data item subordinate to a data item that contains an OCCURS clause; that is, it can be a part of a 2- to 7-dimensional table. In this case, the data description entry must specify an INDEXED BY phrase for each dimension of the table.
    
    
  • X A DBCS item if the ASCENDING/DESCENDING KEY is defined as a DBCS
    X item.
    
    

Identifier-1 cannot be:

  • USAGE IS INDEX
  • X A floating-point data item
  • X A data item defined with USAGE IS POINTER, USAGE IS
    X PROCEDURE-POINTER, or USAGE IS OBJECT REFERENCE
  • X A windowed date field
    
    
Identifier-1 must refer to all occurrences within the table element; that is, it must not be subscripted or reference-modified.

The Data Division description of identifier-1 must contain an OCCURS clause with the INDEXED BY option. It must also contain the KEY IS phrase in its OCCURS clause.

AT END
The condition that exists when the search operation terminates without satisfying the condition specified in any of the associated WHEN phrases.


Previous Topic Next Topic © 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.