Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Difference bw "NEXT SENTENCE" and "CONTINUE"

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
Siva Naga Krishna Kishore

New User


Joined: 22 Jan 2007
Posts: 1
Location: Chennai

PostPosted: Mon Jan 22, 2007 2:25 pm    Post subject: Difference bw "NEXT SENTENCE" and "CONTINUE"
Reply with quote

Hi,

Could any one clarifies me the difference between "NEXT SENTENCE" and "CONTINUE" phrases in COBOL.

Thanks & Regards,
Kishore Kothamasu.
Back to top
View user's profile Send private message

William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Mon Jan 22, 2007 3:01 pm    Post subject:
Reply with quote

Continue continues with the next verb while next sentence skips to the next sentence, the next verb after a period.
Back to top
View user's profile Send private message
sachin_star3
Warnings : 1

New User


Joined: 30 Sep 2006
Posts: 78
Location: pune

PostPosted: Mon Jan 22, 2007 4:00 pm    Post subject: Re: Difference between "NEXT SENTENCE" and "C
Reply with quote

Siva Naga Krishna Kishore wrote:
Hi,

Could any one clarifies me the difference between "NEXT SENTENCE" and "CONTINUE" phrases in COBOL.

Thanks & Regards,
Kishore Kothamasu.


===============================

answer:
NEXT SENTENCE: THE SENTENCE IS COLLECTION OF STATEMENTS AND IS ALWAYS END WITH PERIODE (.)
SO NEXT SENTENCE MEANS THE CONTROL PASSES TO NEXT SENTENCE AFTER THE PERIODE.
CONTINUE:- TRANSFER THE CONTROL AFTER THE END SCOPE TERMINATOR, MEANS CONTINOUS THE EXCUTION NOT CHECK THE CONDITION.

CORRECT ME IF WRONGE
FROM -
SACHIN BORASE
PUNE
Back to top
View user's profile Send private message
muthukannan

New User


Joined: 03 Aug 2006
Posts: 42
Location: Chennai

PostPosted: Mon Jan 22, 2007 5:10 pm    Post subject: Re: Difference between "NEXT SENTENCE" and "C
Reply with quote

Hi Kishore,

"NEXT SENTENCE" will seek for the "."...
It will execute from the next statement onwards. Say
Code:

          IF X <> 3
          COMPUTE X = X+3
          NEXT SENTENCE
          END-IF
          MOVE X TO Y.
          MOVE 10 TO X


In the above code if X is not equal to 3 then
Code:
 MOVE 10 TO X
will be performed.

Code:

          IF X <> 3
          COMPUTE X = X+3
          CONTINUE
          END-IF
          MOVE X TO Y.
          MOVE 10 TO X


In the above code if X is not equal to 3 then
Code:
MOVE X TO Y
will be performed.

Correct me if am wrong.

MK icon_smile.gif
Back to top
View user's profile Send private message
kaarthik6_mf

New User


Joined: 27 Feb 2006
Posts: 3

PostPosted: Fri Sep 12, 2008 3:12 pm    Post subject: Hi MK u seem to be rite
Reply with quote

But u could have given same code as in example one and explained how continue works when given in that place .Two different codes makes things difficult to understand
Back to top
View user's profile Send private message
kaarthik6_mf

New User


Joined: 27 Feb 2006
Posts: 3

PostPosted: Fri Sep 12, 2008 3:14 pm    Post subject:
Reply with quote

am really sorry it is the same code ur 100 % rite Mk sorry for the interruption
Back to top
View user's profile Send private message
sri_mf

Active User


Joined: 31 Aug 2006
Posts: 215
Location: India

PostPosted: Fri Sep 12, 2008 3:18 pm    Post subject: Re: Difference between "NEXT SENTENCE" and "C
Reply with quote

Siva Naga Krishna Kishore wrote:
Hi,

Could any one clarifies me the difference between "NEXT SENTENCE" and "CONTINUE" phrases in COBOL.

Thanks & Regards,
Kishore Kothamasu.


This May help you.

http://ibmmainframes.com/viewtopic.php?t=31198&highlight=next+sentence+continue
Back to top
View user's profile Send private message
revel

Active User


Joined: 05 Apr 2005
Posts: 135
Location: Bangalore/Chennai-INDIA

PostPosted: Fri Sep 12, 2008 4:01 pm    Post subject:
Reply with quote

Hi all,

here is an example which will explain use of next sentence & continue

consider working-storage variable

01 WS-A PIC 9(02) VALUE 10.
01 WS-B PIC 9(02) VALUE 30.


Code:
IF WS-A = 10
     IF WS-B = 20 
           DISPLAY "WS-A  : ",  WS-A
     ELSE
          NEXT SENTENCE
     END-IF
     DISPLAY "RAGHAVENDRA"
END-IF.                                            -------   Control passed
DISPLAy "SUCCESSFULL".



On Executing above code, The Control will comes to NEXT SENTENCE because of Condition codes.

The NEXT SENTENCE will try to pass control to NEXT statement that is after period(ie after END-IF) so

Code:
Output :

SUCCESSFULL


------------------------------------------------------------------

Code:
IF WS-A = 10
     IF WS-B = 20 
           DISPLAY "WS-A  : ",  WS-A
     ELSE
          CONTINUE
     END-IF                                     -------   Control passed
     DISPLAY "RAGHAVENDRA"
END-IF.                                           
DISPLAy "SUCCESSFULL".



On Executing above code, The Control will comes to NEXT SENTENCE because of Condition codes.

The CONTINUE will try to pass control to NEXT statement that is after SCOPE TERMINATOR (ie after END-IF) so

Code:
Output :

RAGHVENDRA
SUCCESSFULL



Hope you got
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1288
Location: Chennai, India

PostPosted: Fri Sep 12, 2008 4:18 pm    Post subject: Reply to: Difference between "NEXT SENTENCE" and &
Reply with quote

Raghu,

Very well explained. But there is a typo in your post.

In the second example for CONTINUE

Quote:
On Executing above code, The Control will comes to NEXT SENTENCE because of Condition codes



It should actually be CONTINUE instead of NEXT SENTENCE.
Back to top
View user's profile Send private message
revel

Active User


Joined: 05 Apr 2005
Posts: 135
Location: Bangalore/Chennai-INDIA

PostPosted: Fri Sep 12, 2008 4:52 pm    Post subject:
Reply with quote

Aaru,


Thanks for correcting me icon_razz.gif
Back to top
View user's profile Send private message
suneelkanchimf

New User


Joined: 12 Sep 2005
Posts: 1

PostPosted: Mon Sep 22, 2008 4:16 pm    Post subject: Reply to: Difference between "NEXT SENTENCE" and &
Reply with quote

Nicely Explained.
Thanks a lot!
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Changeman get multiple "Browse C... elixir1986 Compuware & Other Tools 4 Fri Jul 14, 2017 1:48 am
No new posts Include/omit with "ALL" pa... mgl DFSORT/ICETOOL 6 Wed Jun 14, 2017 2:31 pm
No new posts READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 pm
No new posts RC 20 for Address ISPEXEC "ISRED... pkmurali CLIST & REXX 3 Sun Apr 16, 2017 11:30 pm
No new posts Difference between TWALENG and TWASIZE Arunkumar Chandrasekaran CICS 3 Tue Jan 03, 2017 12:57 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us