1.

Differentiate between SEARCH and SEARCH ALL.

Answer»

SEARCH and SEARCH ALL is USED for finding if a RECORD is present in a table or not.

SEARCHSEARCH ALL
Uses linear search for finding record(s) in the table. This is also called a sequential search.Uses Binary Search for finding record(s) in the table.
Here, the table does not REQUIRE data to be available in sorted order.Here, the data in the table needs to be present in sorted order (EITHER ascending or descending).

The SYNTAX for SEARCH is: 

SEARCH TABLE-NAME [VARYING {identifier1/index1}] [AT END Statement]{WHEN ConditionPasses {statement/NEXT SENTENCE/CONTINUE}…} END-SEARCH.

The syntax for SEARCH ALL is:

SEARCH ALL TABLE-NAME [AT END Statement]{WHEN ConditionPasses {statement/NEXT SENTENCE/CONTINUE}…} END-SEARCH.


Discussion

No Comment Found