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 Searching a table for the field name? socker_dad COBOL Programming 8 Sat Mar 31, 2018 2:57 am
No new posts Need inputs on DB2 tablespace/table r... ashek15 DB2 3 Sat Mar 24, 2018 11:49 pm
No new posts COBOL declaration for table Poha Eater DB2 3 Mon Feb 26, 2018 6:58 pm
No new posts load and delete table through JCL wit... ram_vizag JCL & VSAM 9 Thu Feb 01, 2018 12:47 am
No new posts Unloading DB2 table in CSV format alo... grvtomar COBOL Programming 7 Sun Jan 28, 2018 2:05 am

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