Cobol Interview Questions

Cobol interview questions Download Cobol interview questions PDF

Cobol interview questions

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.
The prerequisite for performing a search function in a table is-
  • The table must have OCCURS clause present in it.
  • It should be INDEXED BY phrase.
  • There should be some initial value present in search index.
  • Always set the index value to 1.
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.

In COBOL language, NEXT STATEMENT is used to give control to the next verb following next period. Next Sentence is the collection of sentences that always ends with (.) so the control passes over to next verb following next period. When NEXT SENTENCE is coded, 1 will not be added to input count.

CONTINUE statement is used to give control to the next verb after the explicit scope terminator. When CONTINUE is coded, +1 will be added to input count.