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

diff in search and search all


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
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
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: 1208
Location: Bangalore,India

PostPosted: Fri Oct 06, 2006 10:42 pm
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
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: 1208
Location: Bangalore,India

PostPosted: Sat Oct 07, 2006 6:50 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
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 first column truncated in search result IBM Tools 13
No new posts ISRSUPC search utility - using high l... TSO/ISPF 2
No new posts To search DB2 table based on Conditio... DB2 1
Search our Forums:

Back to Top