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
 
diff in search and search all

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
View previous topic :: :: View next topic  
Author Message
Muthukumar.PLindia

New User


Joined: 03 Jul 2006
Posts: 51
Location: Chennai

PostPosted: Fri Oct 06, 2006 10:31 pm    Post subject: diff in search and search all
Reply with quote

could any one say the difference b/w search and search all....
search(serial)
search all (binary)
thats ok...
but wat will be the result set for both...
Will search all takes all the possible matches from an array ..please clarify me.. I need to know th eresult set for a search performed
Back to top
View user's profile Send private message

guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Fri Oct 06, 2006 10:42 pm    Post subject:
Reply with quote

Hi muthu,

Both will search the particular element in array.
Search: is used for sequential search
Search all : is for binary search for this table should be in sorted order.
Result will always be same ...but difference is in algo

In bianry serach it will check mid element first if search element is greater tahn mid element then next search will be in upper half..then so on....

Hope it is clear now
Back to top
View user's profile Send private message
Muthukumar.PLindia

New User


Joined: 03 Jul 2006
Posts: 51
Location: Chennai

PostPosted: Sat Oct 07, 2006 6:43 pm    Post subject:
Reply with quote

thanks guptae for clarifing it...
U said result is same....
so in a array if it finds 4 matches all these 4 matches will be identified in a single (search .... end-search) execution, or do we need to perform it in a loop for every matches......


My requirement is to find retrieve all the matches
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Sat Oct 07, 2006 6:50 pm    Post subject:
Reply with quote

Hi,

By both the search i think u cant get all the occurance contol will go to next sentence as soon as u find one match.
Sequential search

SEARCH table [VARYING pointer]
[AT END statement1]
WHEN condition
statement2.


Search all syntex
SEARCH ALL table [AT END statement1]
WHEN condition
statement2.

So u need to add logic to get all the matches .
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 -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts HEX value search in a DB2 query maxsubrat DB2 2 Wed Oct 04, 2017 3:04 pm
No new posts Search for a string in many PDS KARTHIGADEVI CLIST & REXX 5 Fri Sep 08, 2017 2:32 pm
No new posts Search utility(3.14) using JCl and Cobol RKS3 COBOL Programming 12 Sat Jun 10, 2017 10:24 pm
No new posts Search a Load Module sreekanth1984 TSO/ISPF 8 Tue Jun 07, 2016 8:45 pm
No new posts Copy one PDS to another PDS based on ... alluri12 JCL & VSAM 10 Tue Sep 29, 2015 8:10 pm

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