The IF statement evaluates a condition and provides for alternative actions in the object program, depending on the evaluation.
IF Statement -- Format
>>-IF--condition--+------+-------------------------------------->
'-THEN-'
.-----------------.
V |
>--+-+-----statement-1---+-+--+-------------------------------+-----+-><
| '-NEXT SENTENCE-------' | .-----------------. | |
| | V | | |
| '-ELSE--+-----statement-2---+-+-' |
| '-NEXT SENTENCE-------' |
| .-----------------. .-----------------. |
| V | V | |
'-----statement-1---+--+-ELSE------statement-2---+--+--------+-+-'
| '-END-IF-' |
'-END-IF--------------------------------'
The scope of an IF statement can be terminated by any of the following:
Related Information:
+-------------------------------IBM Extension--------------------------------+
NEXT SENTENCE can be specified with END-IF.
+----------------------------End of IBM Extension----------------------------+
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.