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
 
Search All Algorithm in cobol

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

New User


Joined: 19 May 2005
Posts: 17

PostPosted: Wed Jun 08, 2005 11:16 am    Post subject: Search All Algorithm in cobol
Reply with quote

hi friends
i have a question in cobol search.

my file having 100 records .when we are using search all it splits the records
in to 5o ,50 and make a binary search.am i correct?

suppose i have 101 records in my file how will it start the spliting?
Back to top
View user's profile Send private message

varun_sharma

New User


Joined: 08 Jun 2005
Posts: 19
Location: new delhi

PostPosted: Wed Jun 08, 2005 7:18 pm    Post subject: Re: Search All Algorithm in cobol
Reply with quote

Hi

search all divides total no. of records into half and then searches for the desired record. So when there'll be 101 records, internally search all will divide them into either 50:51 or 51:50 and will try to search for the records. however, if the size of all the records is less then the page size, its better to use search then search all.

correct me if im wrong somewhere
Back to top
View user's profile Send private message
kanak

Moderator


Joined: 12 Mar 2005
Posts: 252
Location: India

PostPosted: Wed Jun 08, 2005 8:36 pm    Post subject:
Reply with quote

when you perform search all, first thing you need to ensure is array or table must be sorted.

Now when number of record is even then it checks which is the middle one, i.e. half of the total number. if 100 then 50th record is taken into care then it performs binary search.

Where as when say number of element is 101 then again it will take half of 101, and which is 50 (integral), then it will perform binary search, where first key that is checked is the 50th element.

Hope i have able to clear out your doubt.
If you have any concrens let us know...and correct me if i am wrong.
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 IEW2456E error when link-editing a C ... Senthilraj JCL & VSAM 0 Fri Oct 13, 2017 3:12 pm
No new posts HEX value search in a DB2 query maxsubrat DB2 2 Wed Oct 04, 2017 3:04 pm
No new posts Assembler Macro Copybook converted to... Ziquilix PL/I & Assembler 4 Tue Sep 26, 2017 3:07 am
No new posts Search for a string in many PDS KARTHIGADEVI CLIST & REXX 5 Fri Sep 08, 2017 2:32 pm
This topic is locked: you cannot edit posts or make replies. Extract all "IF" Statements... Adarsh Damodaran CLIST & REXX 1 Wed Sep 06, 2017 9:28 am

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