What is the difference between SEARCH and SEARCH ALL? What
is more efficient?
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
Answer / vidhya
Search All is more efficeint provided the input is in the
sorted order
| Is This Answer Correct ? | 11 Yes | 1 No |
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 |
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 |
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 |
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 |
Write the syntax of a two dimensional array?
Following questions were asked in Capegemini on 8th sep,2012 mainframe test 1.)Condition code for dul recors in VSAM- 2.) Is NULL or =NULL in Select statement 3.)max size of CI 4.)What happens after CI is full 5.)Ques on COND parameter 6.)which among following can not be rolled back a)delete table b.)droptable c)Update d.)insert 7.)groupby and orderby sql querries 8.)Max extents in VSAM file 9.)quesn on DPRTY=(1,10) 10.)range of condition codes in COBOL 11.)occurs clase can not be used at which level? 12.)delimiter in jcl 13.)sort card for file in PGM=SORT 14.)PIC(6) value 120056 possible? 15)question on BLKSIZE Is (20,20) and (20,10) possible? 16.)number of bytes in RDF 17.)Can we use index in WS-section or LK-section 18.)Verify command in IDCAMS used for? 19.)question on Alternate Index 20.)Return code of file attribute mismatch 21.)In which format COBOL variables stored? 22.)what is Alternate of HANDLE? 23.)can SUM,AVG,MIN,ROUND used in numeric and char variable data types? 24.)What is the datatype of FILE STATUS codes in WS-section?
I am getting S00F abend when i try to compare two variable of different pic class,one variable is of 9(09) and another is S9(09) comp-3. First i moved the data from S9(09) comp-3 to 9(09), but no luck. So i tried to move the data from S9(09) comp-3 to X (09) and move to 9(09). I am getting same error message, Please help me to find solution for this ptoblem. ERROR MESSAGE - "The system or user abend S00F R=NULL was issued."
How can you display the SPOOL information ?
why mainframe we use not like java as frontend oracle as backend. or not word excel.In there also huge ammount data stored.
How does IDMS insure data integrity?
With in these three which one is the default one Call Reference, Call By Value, Call By Content.-Which one is default?
SSRange is used to do a range check on which of the Following. SUBSCRIPT,INDEX,REFERENCE MODIFICATION,Run-time option.
The order of precedence of arithmetic operators in an expression can be overridden with the use of (a) [] (b) () (c) {} (d) Any of the above
how will u code parm parameter and where pls ?
can we read records in a file from botom to top. if possible how can we read
what are the isolation levels and where we use it in the db2 program