When stringing or unstringing data, an error might occur. Both the STRING and UNSTRING statements provide an ON OVERFLOW phrase to handle typical string overflow error conditions. For the STRING statement, the ON OVERFLOW phrase will be run when the implicit or explicit pointer value is:
For the UNSTRING statement, the ON OVERFLOW phrase will be run when:
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 WebSphere Development Studio: ILE COBOL Reference for further information about the ON OVERFLOW phrase.
(C) Copyright IBM Corporation 1992, 2005. All Rights Reserved.