Format 2 (CALL ON EXCEPTION) ->->--CALL--*--identifier-1--*----------------------------------------> *--literal-1-----* ->--*-------------------------------------------------------------*--> + *---------------------------------------------------*+ + + *---------------------------* ++ + V V + ++ *-USING--*-*------------------**-------------*-identifier-2*-** + *-*----*-REFERENCE-**-ADDRESS OF--* + + + *-BY-* *-file-name-1---------------* + + + + *---------------------------------*+ + V ++ *-*----*-CONTENT-*-*------------*-----identifier-2-** *-BY-* + *-ADDRESS OF-* + + *-LENGTH OF--* + *-*-literal-2---*-----------------* *-file-name-1-* ->--*-------------------------------------------*-------------------> *-*----*--EXCEPTION imperative-statement-1--* *-ON-* ->--*------------------------------------------------*--------------> *--NOT-*----*--EXCEPTION imperative-statement-2--* *-ON-* ->--*------------*--------------------------------------------------><- *--END-CALL--*
An exception condition occurs when the called subprogram cannot be made available. This occurs in one of two ways:
If a procedure branching or conditional statement that causes explicit transfer of control is executed, control is transferred in accordance with the rules for that statement. Otherwise, upon completion of the execution of imperative-statement-1, control is transferred to the end of the CALL statement and the NOT ON EXCEPTION phrase, if specified, is ignored.
If you specify the NOT ON EXCEPTION phrase in the CALL statement and the called subprogram can be made available (that is, no exception condition exists), control is transferred to the called subprogram. After control returns from the called subprogram, the ON EXCEPTION phrase, if specified, is ignored and control is transferred to the end of the CALL statement or, if the NOT ON EXCEPTION phrase is specified, to imperative-statement-2.
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 in accordance with the rules for that statement. Otherwise, upon completion of the execution of imperative-statement-2, control is transferred to the end of the CALL statement.
If you specify this phrase and the ON OVERFLOW phrase, an error occurs.
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.