Prepare Interview

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

COBOL Interview Questions and Answers

Test your skills through the online practice test: COBOL Quiz Online Practice Test

Ques 16. What is the significance of the OCCURS clause?

The OCCURS clause in COBOL is used to define arrays or tables. It specifies the number of occurrences or elements, allowing for efficient handling of repetitive data.

Example:

01 SALES-AMOUNT OCCURS 12 TIMES PIC 9(5).

Is it helpful? Add Comment View Comments
 

Ques 17. Explain the INSPECT verb in COBOL.

The INSPECT verb in COBOL is used for string manipulation. It allows the programmer to search, replace, or delete characters in a string.

Example:

INSPECT NAME-STRING REPLACING ALL '- ' BY SPACE.

Is it helpful? Add Comment View Comments
 

Ques 18. What is the purpose of the MERGE statement?

The MERGE statement in COBOL is used to merge two or more sorted input files into a single sorted output file. It is often used for sorting and merging files.

Example:

MERGE FILE-1, FILE-2 INTO SORTED-FILE.

Is it helpful? Add Comment View Comments
 

Ques 19. Explain the EVALUATE statement in COBOL.

The EVALUATE statement in COBOL is used for multi-way branching. It simplifies complex nested IF statements and enhances code readability.

Example:

EVALUATE TRUE
  WHEN AGE < 18 DISPLAY 'Minor'
  WHEN AGE > 65 DISPLAY 'Senior'
  WHEN OTHER DISPLAY 'Adult'.

Is it helpful? Add Comment View Comments
 

Ques 20. How does COBOL support file processing?

COBOL supports file processing through file control entries in the File Section. The OPEN, READ, WRITE, and CLOSE statements are used for file operations.

Example:

OPEN INPUT FILE-1.
READ FILE-1 INTO DATA-RECORD.
CLOSE FILE-1.

Is it helpful? Add Comment View Comments
 

Most helpful rated by users:

©2025 WithoutBook