Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
can we use SET verb in SEARCH ALL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: can we use SET verb in SEARCH ALL
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    Post subject: Re: can we use SET verb in SEARCH ALL
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    Post subject:
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    Post subject: Re: can we use SET verb in SEARCH ALL
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    Post subject: Re: can we use SET verb in SEARCH ALL
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    Post subject: Re: can we use SET verb in SEARCH ALL
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts HEX value search in a DB2 query maxsubrat DB2 2 Wed Oct 04, 2017 3:04 pm
No new posts Search for a string in many PDS KARTHIGADEVI CLIST & REXX 5 Fri Sep 08, 2017 2:32 pm
No new posts Search utility(3.14) using JCl and Cobol RKS3 COBOL Programming 12 Sat Jun 10, 2017 10:24 pm
No new posts Search a Load Module sreekanth1984 TSO/ISPF 8 Tue Jun 07, 2016 8:45 pm
No new posts Copy one PDS to another PDS based on ... alluri12 JCL & VSAM 10 Tue Sep 29, 2015 8:10 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us