Prepare Interview

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

Question: Explain the purpose of the EXIT statement.
Answer: The EXIT statement in COBOL is used to terminate a loop prematurely. It allows the program to exit a PERFORM loop or a Section before reaching the normal end.

Example:

PERFORM UNTIL EOF-FLAG = 'Y'
  ...
  IF SOME-CONDITION
    EXIT.
  END-IF.
END-PERFORM.
Is it helpful? Yes No

Most helpful rated by users:

©2025 WithoutBook