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

Searching an UNSORTED table using SEARCH ALL


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Load new table with Old unload - DB2 DB2 6
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 Pulling a fixed number of records fro... DB2 2
No new posts Multiple table unload using INZUTILB DB2 2
Search our Forums:

Back to Top