What is the difference between SEARCH and SEARCH ALL? What
is more efficient?

Answers were Sorted based on User's Feedback



What is the difference between SEARCH and SEARCH ALL? What is more efficient?..

Answer / basha, margadarsi comp

SEARCH is a sequential search, it will read all the elements
of a table sequentially whereas SEARCH ALL, it will splits
the table in two halves and search the element in which half
the element find like that the entire table will be searche
and also the table should be in sorted order for SEARCH ALL.
SEARH ALL is more efficient than SEARCH.

Is This Answer Correct ?    45 Yes 1 No

What is the difference between SEARCH and SEARCH ALL? What is more efficient?..

Answer / avinanda mukherjee

Ans #1 is corrent, in addition, Search all is working in a
sorted array(binary search) and it is more effiecient then
verb search.

Is This Answer Correct ?    24 Yes 2 No

What is the difference between SEARCH and SEARCH ALL? What is more efficient?..

Answer / kumar raja.

1st answer is 100% correct.

Search
The search statement examines the table elements in a
sequential manner.this technique is called linear search.

Search-All
Is a binary search begins the examination of the elements
from the middle and in each examination it eliminates the
half the elements remaining to be searched.its applicable
only for sorted table.

Is This Answer Correct ?    14 Yes 1 No

What is the difference between SEARCH and SEARCH ALL? What is more efficient?..

Answer / vidhya

Search All is more efficeint provided the input is in the
sorted order

Is This Answer Correct ?    11 Yes 1 No

What is the difference between SEARCH and SEARCH ALL? What is more efficient?..

Answer / sunrays

multiple when conditions can be used in search.
in search all single when condition should be used.

in search SEARCH key word is used.
in search-all SEARCH ALL key word is used.

table may not be in sorted order for search.
table must be in sorted order.

search is a linear search. search all is binary search.

Is This Answer Correct ?    11 Yes 2 No

What is the difference between SEARCH and SEARCH ALL? What is more efficient?..

Answer / ramana

most of the pionts are covered so far, I would like to add
one more point here,

In search all to get expected results array must be in a
specified order, but search all also works for an unsorted
array but may or may not give the expected results as it
keeps on divide.

Ex1: searching for 10. ** Array is not in order**

40
30
34
70
10
90

Iteration 1: it selects the second half 70,10,90
Iteration 2: It selects 10 n says the value is found.

Ex2: searching for te same 10.

40
10
34
70
30
90

Its follows the same process as in 1st case, but here 10 is
not there in the second iteration so it says value not
found, but it is present in the first half, this happens
because aray is not sorted.

Is This Answer Correct ?    2 Yes 1 No

What is the difference between SEARCH and SEARCH ALL? What is more efficient?..

Answer / kumar raja.

SEARCH ALL is an efficient one then why we need SEARCH ?

ONE EXAMPLE.

In VSAM files by passing the partial key we can search the
record using SEARCH or AEARCH ALL
But if you would like to point out 1st record with this
partial key, SEARCH will find the 1st record with that
partial key.
And SEARCH ALL will not. (95%)

Example. (Here my target to get 1st record with the
partial key. i.e (200 300 XXXXXXA)

VSAM File. (assume KEY as : ORG LOGO ACCOUNT) and
partial KEY (ORG = 200 LOGO = 300)
ORG LOGO ACCOUNT

100 222 XXXXXXXXX
100 333 XXXXX
111 333 XXXXXXX
200 300 XXXXXXA
200 300 XXXXXXB
200 300 XXXXC
200 300 XXXXXXD
250 300 XXXXXXX
300 340 XXXXXXX

In the case of search the O/P will be (200 300 XXXXXA)
Correct as per the requirement.
But in case of SEARCH ALL the response will be (200 300
XXXXXB). Wrong as per the requirement.

Regards,
Kumar Raja.

Is This Answer Correct ?    3 Yes 4 No

What is the difference between SEARCH and SEARCH ALL? What is more efficient?..

Answer / cvcv

searchall is only for 1-d arrays

Is This Answer Correct ?    3 Yes 4 No

What is the difference between SEARCH and SEARCH ALL? What is more efficient?..

Answer / laxmanrao

1)any relation operator can used in search
where as in searchall we use only equalto(=)operator only
2)multiple-when condition can used in search,where as in
search all we use only single when condition is used
3)search is efficient then perform ,search all is efficient
then perform

for detail about job fresher check in
http://jobplacementconsultantsinworld.blogspot.com

Is This Answer Correct ?    4 Yes 5 No

Post New Answer

More COBOL Interview Questions

How does IDMS insure data integrity?

1 Answers  


What is the difference between subscript and index?

1 Answers  


study the data discriptions and answer the questions given below i)01 ORDER RECORD 05 OUT-HEADER PIC X(50) 05 ITEM-COUNT PIC 99 05 OUT-ITEM PIC X(20) OCCURS 1 TO 20 DEPENDING ON ITEM-COUNT ii)01 NAME-AND-ADDRESS 05 N-AND-A-LINE OCCURES 5 05 LINE-LENGTH PIC P9 05 N-AND-A-CHAR PIC X OCCURS 1 TO 20 DEPENDING ON LINE-LENGTH iii)01 SALES-LIST 05 SALESMAN-COUNT PIC 99 05 SALES PIC 9(6) OCCURS 1 TO 100 DEPENDING ON SALESMAN-COUNT iv)01 ORDER-RECORD 05 NO-OF-BRANDS PIC 99 05 BRAND-PURCHASED OCCURS 1 TO 15 DEPENDING ON NO-OF-BRANDS which of the following is true? a.i) and iii) are valid b.i) and iv) are valid c.i) and iii) are not valid d.all are valid

4 Answers   TCS,


01 xxx pic 9(4). 01 yyy pic 9(6). move 123456 into yyy. move yyy to xxx. display yyy. what would be the value of yyy

13 Answers   HSBC,


i friends greetings to the day...!!! I face a quation like"while runnig the programe every day i have to access the previous day updates only...!! Ex:- Let last day 100 customers took bank account i have to select those customers only.."

4 Answers   CSC,






how to display date in reverse order if the pic clause of the is numeric suppose date is 09032010 ==> need to print in 20100309 (pic clause is numeric)

6 Answers  


How you can characterize tables in cobol?

0 Answers  


where will we code call by content and call by reference dude pls reply soon ?

2 Answers  


can we write paragraph in area B .....

4 Answers   L&T,


) How do you access the migrate the data from production region to development region

1 Answers   IBM,


what is rediffine clause?in what situation it can use?give me real time example?

1 Answers   IBM,


can we read in input the file with a variable length ? please , how ..could you help me ?

3 Answers   EDS,


Categories