Interview Questions

What are the pertinent COBOL commands?

COBOL Interview Questions


(Continued from previous question...)

What are the pertinent COBOL commands?

Q: What is the difference between a binary search and a sequential search? What are the pertinent COBOL commands?

A: In a binary search the table element key values must be in ascending or descending sequence. The table is 'halved' to search for equal to, greater than or less than condition until the element is found. In a sequential search the table is searched from top to bottom, so (ironically) the elements do not have to be in a specific sequence. The binary search is much faster for larger table, while sequential works well with smaller ones. SEARCH ALL is used for binary seaches. SEARCH for sequential.

(Continued on next question...)

Other Interview Questions