Continue and Next Sentence in COBOL are No Operation statements which does nothing except to pass control to the statement after the scope terminators. But the difference is the place that it passes the control to.
Continue gives the control after the next explicit scope terminator. Explicit Scope terminators are END-IF, END-PERFORM, END-EVALUATE, etc.
OPEN INPUT FILE1
IF WW-FILE-STATUS = ‘00’
DISPLAY ‘ FILE OPEN FAILED’
In the above code, continue does nothing but it passes control to the statement after end-if.
IF EMP-NUM > ZEROES
In the above code, the requirement is to update the employee data in a Database for a valid employee number.
It gives control to the next implicit scope terminator which is a period.
IF WW-VAR1 = WW-VAR2
MOVE WW-VAR-3 TO WW-VAR1
IF WW-VAR1 = WW-VAR4
MOVE WW-VAR4 TO WW-VAR1
END-IF. -----> Implicit Scope terminator.
When variable 1 is equal to variable 2 then checking the other IF statements are not required and business logic needs to be performed. So the Next Sentence gives control directly to P100 para which is after the implicit scope terminator(.).