GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Mainframe  >  COBOL
Go To First  |  Previous Question  |  Next Question 
 COBOL  |  Question 4 of 162    Print  
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.


  
Total Answers and Comments: 6 Last Update: April 06, 2009   
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: chandrasekaran
 

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



Above answer was rated as good by the following members:
chand72, mrathi, Nitin2cpg, stuartslom, kylashrao
June 22, 2006 07:01:48   #1  
chandrasekaran        

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


 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 1Overall Rating: -N/A-    
July 20, 2006 11:05:05   #2  
umapathi        

RE: What is the difference between NEXT SENTENCE and C...

the following code explains u clearly

If A>B

next sentence

end-if

display 1

display 2.

display 3.

it will display only 3. if a>b

if a>b

continue

end-if

display 1

display 2.

display 3.

it will display 1 2 3. if a>b. let me know if it is not correct.


 
Is this answer useful? Yes | NoAnswer is useful 3   Answer is not useful 0Overall Rating: +3    
July 31, 2007 01:51:25   #3  
kkkanagaraj Member Since: July 2007   Contribution: 6    

About 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?
 
Is this answer useful? Yes | No
October 25, 2007 01:07:07   #4  
Jeena John        

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.

I think this explanation will clear your doubt

 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    
November 26, 2008 05:41:25   #5  
Ningayya Member Since: November 2008   Contribution: 4    

RE: What is the difference between NEXT SENTENCE and CONTINUE?
NEXT SENTANCE CONTINUE

after the condition the control goes
to next period(.).

ex:
IF A > B

NEXT SENTENCE

END-IF
DISPLAY 10
DISPLAY 20.
DISPLAY 30.

It will display only 30

 
Is this answer useful? Yes | No
April 06, 2009 01:58:17   #6  
khushbuminocha Member Since: April 2009   Contribution: 1    

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

 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape