When any of the above conditions occur, an overflow condition exists, and no more data is transferred. The STRING operation is terminated and, if the ON OVERFLOW phrase is specified, control is transferred to imperative-statement-1. Otherwise, control is transferred to the end of the STRING statement. The NOT ON OVERFLOW statement, if specified, is ignored.
If control is transferred to imperative-statement-1, execution continues according to the rules for each statement specified in imperative-statement-1. If a procedure branching or conditional statement that causes explicit transfer of control is executed, control is transferred according to the rules for that statement; otherwise, upon completion of the execution of imperative-statement-1, control is transferred to the end of the STRING statement.
If an overflow condition does not occur during the execution of a STRING statement, then control is transferred to the end of the STRING statement. If an overflow condition does not occur and the NOT ON OVERFLOW phrase is specified, control is transferred to imperative-statement-2. The ON OVERFLOW phrase, if specified, is ignored.
If control is transferred to imperative-statement-2, execution continues according to the rules for each statement specified in imperative statement-2. If a procedure branching or conditional statement that causes explicit transfer of control is executed, control is transferred according to the rules for that statement. Otherwise, upon completion of the execution of imperative-statement-2, control is transferred to the end of the STRING statement.
The ON OVERFLOW statement is not executed unless there was an attempt to move in one or more characters beyond the end of identifier-3, or the initial value of POINTER is less than 1.