What is the difference between NEXT SENTENCE and CONTINUE?
NEXT SENTENCE gives control to the verb following the next period. CONTINUE gives control to the next verb after the explicit scope terminator. (This is not one of COBOL II's finer implementations). It's safest to use CONTINUE rather than NEXT SENTENCE in COBOL II.
IF NOT INPUT-EOF IF INPUT-REC-TYPE = '55' PERFORM 2100-PROCESS-WTN ELSE NEXT SENTENCE/CONTINUE END-IF ADD +1 TO INPUT-COUNT. What will be the result for an next sentence or an continue
RE: What is the difference between NEXT SENTENCE and C...
can it be explained with the coding given below
IF NOT INPUT-EOF IF INPUT-REC-TYPE '55' PERFORM 2100-PROCESS-WTN ELSE NEXT SENTENCE/CONTINUE END-IF ADD +1 TO INPUT-COUNT. What will be the result for an next sentence or an continue
While we are using the CONTINUE statement within the nested scope where the program control goes? To immediate next scope terminator or the outer most scope terminator?
RE: What is the difference between NEXT SENTENCE and C...
According to this code If "Next sentence" is given the control wil go to the statement after "ADD +1 TO INPUT-COUNT"(control will go to verb following the next period).
If "continue "is given control will go to this statement "ADD +1 TO INPUT-COUNT" (control will go to the next verb after the Explicit scope terminator that is after end-if).
A scope terminator brackets its preceding verb eg. IF .. END-IF so that all statements between the verb and its scope terminator are grouped together. Other common COBOL II verbs are READ PERFORM EVALUATE SEARCH and STRING.
RE: What is the difference between NEXT SENTENCE and CONTINUE?
Next sentence: The sentence is the collection of statements and is always end with period(.).so next sentence means the control passes to next sentence after period. e.g.: if X 3
Compute X X-3 Next sentence End-if move X to Y. move 10 to Y.
Then output is: move 10 to Y. Continue: Transfer the control after the end scope terminator.
E.g: in above example if we use continue in place of next sentence output is: move X to Y