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 46. What is the purpose of the REJECT statement in COBOL?

The REJECT statement in COBOL is used to return a record to an input file after it has been read. It is often used in conjunction with the REWRITE statement.

Example:

READ INPUT-FILE INTO DATA-RECORD.
IF CONDITION
  REJECT DATA-RECORD.
END-IF.

Is it helpful? Add Comment View Comments
 

Ques 47. Explain the concept of the COMPUTATIONAL-3 clause.

The COMPUTATIONAL-3 (COMP-3) clause in COBOL is used to define packed-decimal data items. It represents decimal numbers in a packed format for efficient storage.

Example:

01 AMOUNT PIC 9(5) COMP-3.

Is it helpful? Add Comment View Comments
 

Ques 48. What is the purpose of the ALTER statement in COBOL?

The ALTER statement in COBOL is used to modify the properties of data items at runtime. It allows dynamic changes to the length, picture, or usage of data items.

Example:

ALTER ITEM-DESCR TO PIC X(30).

Is it helpful? Add Comment View Comments
 

Ques 49. Explain the concept of the EXIT SECTION statement.

The EXIT SECTION statement in COBOL is used to terminate the current section prematurely. It allows the program to skip the remaining code within a particular section.

Example:

PERFORM PROCESS-DATA SECTION.
IF ERROR-FLAG = 'Y' THEN
  EXIT SECTION.
END-IF.

Is it helpful? Add Comment View Comments
 

Ques 50. What is the purpose of the GENERATE statement in COBOL?

The GENERATE statement in COBOL is used to dynamically create new paragraphs or sections during program execution. It enhances the flexibility and adaptability of the program.

Example:

GENERATE 'NEW-PARAGRAPH'.

Is it helpful? Add Comment View Comments
 

Most helpful rated by users:

©2025 WithoutBook