How does the ON EXCEPTION condition handler differ from the WHEN condition handler in COBOL?

  • ON EXCEPTION and WHEN are interchangeable and can be used interchangeably
  • ON EXCEPTION is used for handling logical conditions, while WHEN is used for unexpected runtime errors
  • ON EXCEPTION is used for handling unexpected runtime errors, while WHEN is used for logical conditions
  • ON EXCEPTION is used only for arithmetic operations, and WHEN is used for other conditions
In COBOL, the ON EXCEPTION condition handler is specifically designed for handling unexpected runtime errors, such as divide-by-zero or overflow errors. In contrast, the WHEN condition handler is used for handling logical conditions in the program.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *