Can i use a CONTINUE statement in if-loop with out scope terminator END-IF. Will it show any compilation error? If Not ,What happen to that if-loop while executing the program?
Hi,
If you use continue without END-IF you will not get any compile error. The control passes during the time of execution until it finds any terminator. So continue will start after that statement.
For example:
IF VAR1 = 0
CONTINUE
ELSE
PERFORM 111-PARA
END-IF.
DISPLAY 'HELLO'
PERFORM 222-PARA.
DISPLAY 'WORLD'
In normal condition if condition is satisfied the control passed to first display statement and continue execution. If you will not code END-IF, control comes in the 2nd display directly if the condition matches in the IF statement.
Please let me know if you have any doubt