Home > Software > Mainframe > Cobol
Interview Questions   Tutorials   Discussions   Programs   

Cobol - What is the difference between NEXT and CONTINUE statement in cobol. explain with example?




486
views
asked mar August 3, 2014 12:00 AM  

What is the difference between NEXT and CONTINUE statement in cobol. explain with example?


           

1 Answers



 
answered By Mswami   0  
CONTINUE statement allows you to specify a no operation statement. CONTINUE indicates that no executable instruction is present.
NEXT SENTENCE passes the control to the next SENTENCE.

Example:
IF condition1 AND condition2 THEN
   Statement-Block-1 
ELSE
   IF condition3 THEN
	CONTINUE
   ELSE
	IF condition4 THEN
	  Statement-Block-2
     ELSE
	  NEXT SENTENCE
	END-IF
   END-IF
END-IF	

Statement-Block-2 will be executed only when condition 1, 2 and 4 are TRUE and condition 3 is FALSE.
flag   
   add comment

Your answer

Join with account you already have

FF

Preview


Ready to start your tutorial with us? That's great! Send us an email and we will get back to you as soon as possible!

Alert