Handling error is common in any programming language. In COBOL, you need to remember few phrases to handle errors. I have listed here for your quick read.
- AT END
- NOT AT END
- END-OF-PAGE
- NOT END-OF-PAGE
- INVALID KEY
- NOT INVALID KEY
- NO DATA
- WITH DATA
- ON EXCEPTION
- NOT ON EXCEPTION
- ON OVERFLOW
- NOT ON OVERFLOW
- ON SIZE ERROR
- NOT ON SIZE ERROR