IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

can we use SET verb in SEARCH ALL


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
mrlee

New User


Joined: 10 Jun 2005
Posts: 4

PostPosted: Mon Jun 13, 2005 12:00 pm
Reply with quote

can we use SET verb in SEARCH ALL like SEARCH.
Back to top
View user's profile Send private message
Sangita

New User


Joined: 02 Jun 2005
Posts: 17

PostPosted: Mon Jun 13, 2005 5:23 pm
Reply with quote

Hi,

Since SEARCH ALL is a binary search while SEARCH is sequential search,
so a SET statement is not necessary with the SEARCH ALL, since
the index is set to the appropriate point initially when each
binary search beings by the computer.

Regards,
Sangita
Back to top
View user's profile Send private message
mrlee

New User


Joined: 10 Jun 2005
Posts: 4

PostPosted: Tue Jun 14, 2005 1:48 pm
Reply with quote

asume that 10000 records in u table with record size of 10.
i want search for 9000 th record.
can set index to 5000? if so how the search will process in search all.
i want to clarify how the search all will do?
Back to top
View user's profile Send private message
Sangita

New User


Joined: 02 Jun 2005
Posts: 17

PostPosted: Tue Jun 14, 2005 2:08 pm
Reply with quote

Hi mrlee,

SEARCH ALL is a binary search. And for that the records should be in
a sorted order either ascending / decending.
The cocept in binary search is the records are divided and search starts from middle ,
taking your example if u want to search the 9000th record then
SEARCH ALL will start from middle i.e 5000th record and will
compare with 9000 as 9000 > 5000 ,there will be sequential search
from the latter half i.e from 5000 to 10000 so we don't give any SET for SEARCH ALL its taken automatically.

Regards,
Sangita
Back to top
View user's profile Send private message
sudheer648

New User


Joined: 23 May 2005
Posts: 97
Location: Chennai

PostPosted: Thu Jun 16, 2005 12:29 pm
Reply with quote

Hi Sangita,

Your answer is partially correct it chops it and it wont continue the sequential search from 5000 to 10000 for 9000th record it still chops it.

Formula for Binary Search middle= (x+y)/2.suppose x is lower end is 0 and higher end 10000

If search element is greater than middle it considers the x=middle and y=y itself it still chops.

if search element is lesser than middle it considers the x=x;y=middle.

if search element is equal to middle it stops the search.

There is no sequential search in Binary Search again for your kind Information.

comments are invited
Back to top
View user's profile Send private message
Sangita

New User


Joined: 02 Jun 2005
Posts: 17

PostPosted: Thu Jun 16, 2005 1:43 pm
Reply with quote

Hi sudheer,

Thanks for correcting me.

Regards,
Sangita
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


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

Back to Top