The next sentence command does exactly what it says, it goes to the next sentence which follows after the next full stop. The continue command starts executing at the next Statement.
In COBOL a statement is not a sentence, Sentences are separated by full stops.
My personal coding standard is never to code full stops in my programs except at the end of a paragraph on a line of it's own. Also banned is the next sentence clause.
By coding in this way all confusion between next sentence and continue is eliminated.
Here is some pseudo code to demonstrate the difference:
Evaluate a
when 1
continue
when 2
next sentence
end-evaluate
continue and next sentence are used when IF is empty continue executes the next logical statement. next sentence executes the next statement after the period. EXAMPLE: IF GENDER = 'M' CONTINUE/NEXT SENTENCE ELSE MOVE 1000.00 TO BONUS-AMOUNT END-IF MOVE A TO B. MOVE C TO D. continue executes MOVE A TO B. next sentence executes MOVE C TO D.
The next sentence command does exactly what it says, it goes to the next sentence which follows after the next full stop. The continue command starts executing at the next Statement.
In COBOL a statement is not a sentence, Sentences are separated by full stops.
My personal coding standard is never to code full stops in my programs except at the end of a paragraph on a line of it's own. Also banned is the next sentence clause.
By coding in this way all confusion between next sentence and continue is eliminated.
Here is some pseudo code to demonstrate the difference:
Evaluate a
when 1
continue
when 2
next sentence
end-evaluate
next-statement-continues here.
next-sentence.