GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

GeekInterview.com  >  Interview Questions  >  Mainframe  >  COBOL
Go To First  |  Previous Question  |  Next Question 
 COBOL  |  Question 4 of 158    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: 4 Last Update: October 25, 2007   
  
 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
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 0Overall Rating: +1    
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 | No
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 | No


 
Go To Top


 Sponsored Links

 




About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape