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
Above answer was rated as good by the following members: chand72
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.