# what are the main differences in search and search all

Author Message
vinayak

New User

Joined: 30 Jan 2004
Posts: 3

 Posted: Wed Feb 04, 2004 4:31 pm what are the main differences in search and search all?
sandip_datta

Active User

Joined: 02 Dec 2003
Posts: 150
Location: Tokyo, Japan

 Posted: Wed Feb 04, 2004 8:55 pm Hi Vinayak, Search uses linear search method for searching an element in an array of elements. SEARCH ALL uses binary tree method for searching. For an array of less than 20 elements SEARCH is efficient but in other case SEARCH ALL is more efficient. Others please add. Please give some significant Subject other than Question. Regards, Sandip.

Active User

Joined: 06 Jan 2004
Posts: 247

 Posted: Wed Feb 04, 2004 9:38 pm Hi vinayak, adding to sandip here is some more info.it may help you. When performing table look-up operations, SEARCH ALL, a binary search operation, is usually faster than SEARCH, a sequential search operation. However, SEARCH ALL requires the table to be in ascending or descending order by search key, while SEARCH imposes no restrictions on table organization. Also, with SEARCH ALL there should be unique key values in the table. Before using SEARCH ALL, you must pre-sort the table. If the table is not sorted, SEARCH ALL often gives incorrect results. A binary search (SEARCH ALL) determines a table's size, finds the median table entry, and searches the table in sections, by using compare processes. A sequential search (SEARCH) manipulates the contents of an index to search the table sequentially. thanks and regards ANURADHA
manoopatil

New User

Joined: 07 Dec 2003
Posts: 56
Location: Montreal

 Posted: Wed Feb 04, 2004 11:36 pm In a binary search the table element key values must be in ascending or descending sequence. The table is 'halved' to search for equal to, greater than or less than conditions until the element is found. In a sequential search the table is searched from top to bottom, so (ironically) the elements do not have to be in a specific sequence. The binary search is much faster for larger tables, while sequential works well with smaller ones. SEARCH ALL is used for binary searches; SEARCH for sequential. Manohar.
suresh_u

New User

Joined: 31 Jan 2004
Posts: 8

 Posted: Fri Feb 06, 2004 3:18 pm dear vinayak, Please put subject line properly so that persons who are familiar in those subjects will be able to help you immediatly. please don't put generalized subject like 'question' to any of your mails. Thanks suresh
 View Bookmarks All times are GMT + 6 Hours

 Topic Forum Replies Similar Topics Search two or more word with FILEAID Compuware & Other Tools 15 Sortjoin and Search for a String and ... DFSORT/ICETOOL 1 first column truncated in search result IBM Tools 13 ISRSUPC search utility - using high l... TSO/ISPF 2 To search DB2 table based on Conditio... DB2 1
Search our Forums:

 IBMMainframes.com is not an official and/or affiliated with IBM® in anyway Board Rules | FAQ | Downloads | Wiki | SiteMap | Contact Us