Handling Errors in String Operations
- Less than 1
- Greater than the length of the receiving field.
- The implicit or explicit pointer value is less than 1
- The implicit or explicit pointer value is greater than the length of the sending field
- All receiving fields have been acted upon, and the sending field still contains unexamined characters.
Any other error conditions not handled by the ON OVERFLOW phrase will generally result in MCH messages. Such messages will typically be handled by the function check condition handler. To prevent the function check condition handler from being called, you can register your own condition handler, using the CEEHDLR API, to catch the MCH messages.
You use the ON OVERFLOW phrase of the STRING or UNSTRING statement to identify the error-handling steps that you want to perform when an overflow condition occurs. If you do not have an ON OVERFLOW clause on the STRING or UNSTRING statement, control passes to the next sequential statement, and you are not notified of the incomplete operation.
Refer to the STRING and UNSTRING statements in the IBM® Rational® Development Studio for i: ILE COBOL Reference for further information about the ON OVERFLOW phrase.