Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Searching an UNSORTED table using SEARCH ALL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
learnmf

Active User


Joined: 14 Mar 2005
Posts: 123

PostPosted: Fri Mar 25, 2005 2:37 pm    Post subject: Searching an UNSORTED table using SEARCH ALL
Reply with quote

Hi friends,

What happens if we use a unsorted table in a search all.

Thanks
Back to top
View user's profile Send private message

priya

Moderator


Joined: 24 Jul 2003
Posts: 568
Location: Bangalore

PostPosted: Fri Mar 25, 2005 8:34 pm    Post subject: Re
Reply with quote

No compile/runtime error.

But you may get unexpected/incorrect result.
Back to top
View user's profile Send private message
learnmf

Active User


Joined: 14 Mar 2005
Posts: 123

PostPosted: Tue Mar 29, 2005 8:07 pm    Post subject:
Reply with quote

Hi priya
I get confused.What is the exact result.
Back to top
View user's profile Send private message
kanak

Moderator


Joined: 12 Mar 2005
Posts: 252
Location: India

PostPosted: Wed Mar 30, 2005 11:25 am    Post subject: re
Reply with quote

As Search all perform binary search...so when it will search for a certain key value it will try to divide total number of record into 2 part and at that time when record that need to be searched, even if it is present it might can give record not found.It 's a lucj if u get the record, and luck is not supported in S/W field.
eg say
the list is
4, 6,2,8,1,9,5

and you want to search 1, then as total lenght is 7 hence it will try to get the mid key value, if the mid key value is greter than the key need to be searched then left portion should contain the record, as it is mandatory for SEARCH ALL that to be sorted. Now in this case mid record key is 8 then it will start calculation only with
4, 6, 2, 8.
Now in this case it will get try to search 1 in that and it won't get but it is present in parent record list.I think now you get the problem.
Back to top
View user's profile Send private message
learnmf

Active User


Joined: 14 Mar 2005
Posts: 123

PostPosted: Thu Mar 31, 2005 1:41 pm    Post subject:
Reply with quote

Hi kanak
Thanks .Now i ve the clear idea.

thanks
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 SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am
No new posts Need Rexx Program to Load in to DB2 T... Hareesh Verma CLIST & REXX 22 Tue Sep 20, 2016 2:59 pm
No new posts Command UNIQUE CONSTRAINT on any tabl... rohanthengal DB2 2 Thu Aug 18, 2016 3:48 pm
No new posts Updating online Db2 table kishpra DB2 3 Fri Aug 12, 2016 2:44 pm
No new posts Search a Load Module sreekanth1984 TSO/ISPF 8 Tue Jun 07, 2016 8:45 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us