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
 
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 Update table without cursor Ron Klop DB2 3 Wed Oct 11, 2017 1:06 pm
No new posts Table(Unicode(Graphic) table) loading... muralikrishnan_new DB2 0 Thu Oct 05, 2017 5:10 pm
No new posts HEX value search in a DB2 query maxsubrat DB2 2 Wed Oct 04, 2017 3:04 pm
No new posts Insert a Row_number into table useit DB2 2 Tue Sep 19, 2017 1:07 pm
No new posts how to see when the last read access ... Mike 1304 DB2 1 Tue Sep 12, 2017 7:52 pm

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