Cobol Interview Questions

Cobol interview questions Download Cobol interview questions PDF

Cobol interview questions

SSRANGE is a compiler option that handles the array overflow. SSRANGE also needs to be specified in COBOL programing language. These help in finding the subscript out of range.

NOSSRANGE is used for performance sensitive applications. NOSSRANGE is a default option that doesn’t support any runtime error if the index or subscript runs out of range.

Scope terminators are mandatory in COBOL in in-line PERFORMS and EVALUATE statements. For ease of reading, it is suggested coding practise to always make scope terminators explicit.
In order to conduct REWRITE, it is mandatory to open the record and read it from the file. So, it is important that the file must be opened in I-O mode for conducting rewriting function.
In-line PERFORM is a concept where the control will execute a block of statements from same paragraph instead of a separate paragraph. Till the time there are no GO TOs or an exit, IN-LINE PERFORM will continue to work. The PERFORM AND END—PERFORM statements will bracket all the COBOL statements between them.
In binary search, the table is divided into two halves and the key values in table will be arranged in ascending or descending order. When the table is split into two, it becomes easier to search for equal to, greater than or less than conditions until the element is found in the table. The binary search is preferred for more tables and SEARCH ALL is used for binary searching.

In sequential search, the elements are in random positions because they are searched from top to bottom and not in a specific direction. As such they don’t follow a specific sequence. Sequential search is conducted for lesser number of tables and SEARCH command is used here.