Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Regarding CONTINUE & NEXT SENTENCE

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

New User


Joined: 25 Feb 2006
Posts: 31

PostPosted: Mon May 14, 2007 12:49 pm    Post subject: Regarding CONTINUE & NEXT SENTENCE
Reply with quote

Can anyone tell me if CUA-LABEL-FMT-TYPO is true ,
Where control will go?

PERFORM 1002-GU-CUSADR
000446 IF WS-CUSADR-NORESP
000447 IF CUA-LABEL-FMT-TYPEO
000448 CONTINUE
000449 ELSE
000450 MOVE 'Y' TO WS-ERROR-SW
000451 MOVE -1 TO ORMNORDL
000452 MOVE '8' TO ORFNORDA
000453 MOVE 'CUSTOMER NOT SET UP FOR LABELS'
000454 TO ORMMSGO
455 GO TO 150-EXIT.
PERFORM 160-EDIT-SCREEN THRU 160-EXIT.
Back to top
View user's profile Send private message

ramfrom84

New User


Joined: 23 Aug 2006
Posts: 93
Location: chennai

PostPosted: Mon May 14, 2007 2:58 pm    Post subject: Re: Regarding CONTINUE & NEXT
Reply with quote

IF A=1
PERFORM PARA-A
CONTINUE
ELSE
IF A=2
PERFORM PARA-B
ELSE
PERFORM PARA-C
END-IF
MOVE 100 TO FIELD-A
END-IF.

Example 1

If A=1
control goes to para-a and then goest to move statement.


IF A=1
PERFORM PARA-A
NEXT SENTENCE
ELSE
IF A=2
PERFORM PARA-B
ELSE
PERFORM PARA-C
END-IF
MOVE 100 TO FIELD-A
END-IF.

Example 2

If A=1
control goes to para-a and then COME OUT. Move stament will not perform

for ur code both contiue and next sentence ll same..
Back to top
View user's profile Send private message
mkk157

Active User


Joined: 17 May 2006
Posts: 310

PostPosted: Mon May 14, 2007 3:00 pm    Post subject: Hi
Reply with quote

Hi nileshp,

Control goes to the Perform statement if the condition is true.
Back to top
View user's profile Send private message
mkk157

Active User


Joined: 17 May 2006
Posts: 310

PostPosted: Mon May 14, 2007 3:03 pm    Post subject: Hi
Reply with quote

Look at these previous posts.

http://ibmmainframes.com/viewtopic.php?t=17332&highlight=continue+next
http://ibmmainframes.com/viewtopic.php?t=13602&highlight=continue+next
http://ibmmainframes.com/viewtopic.php?t=2415&highlight=continue+next
Back to top
View user's profile Send private message
nileshp

New User


Joined: 25 Feb 2006
Posts: 31

PostPosted: Mon May 14, 2007 3:03 pm    Post subject: Re: Regarding CONTINUE & NEXT
Reply with quote

Thanks for you help


ramfrom84 wrote:
IF A=1
PERFORM PARA-A
CONTINUE
ELSE
IF A=2
PERFORM PARA-B
ELSE
PERFORM PARA-C
END-IF
MOVE 100 TO FIELD-A
END-IF.

Example 1

If A=1
control goes to para-a and then goest to move statement.


IF A=1
PERFORM PARA-A
NEXT SENTENCE
ELSE
IF A=2
PERFORM PARA-B
ELSE
PERFORM PARA-C
END-IF
MOVE 100 TO FIELD-A
END-IF.

Example 2

If A=1
control goes to para-a and then COME OUT. Move stament will not perform

for ur code both contiue and next sentence ll same..
Back to top
View user's profile Send private message
nileshp

New User


Joined: 25 Feb 2006
Posts: 31

PostPosted: Mon May 14, 2007 3:04 pm    Post subject: Re: Hi
Reply with quote

Thanks for you help


mkk157 wrote:
Hi nileshp,

Control goes to the Perform statement if the condition is true.
Back to top
View user's profile Send private message
socker_dad

Active User


Joined: 05 Dec 2006
Posts: 147
Location: Columbia, MO

PostPosted: Mon May 14, 2007 11:01 pm    Post subject: Re: Regarding CONTINUE & NEXT
Reply with quote

Oh, and Nilesh? Please code without those awful GO TO statements, k?

icon_lol.gif
Back to top
View user's profile Send private message
priyamnavada

New User


Joined: 24 Dec 2005
Posts: 52
Location: hyderabad

PostPosted: Tue May 15, 2007 3:49 pm    Post subject:
Reply with quote

The CONTINUE goes to statement next after the Explicit scope terminator such as (END-IF, END-PERFORM etc...) but the NEXT Statement goes after the Implicit scope terminator (period .).
Back to top
View user's profile Send private message
rameshfoa

New User


Joined: 05 Apr 2007
Posts: 27
Location: chennai

PostPosted: Wed May 16, 2007 11:51 am    Post subject:
Reply with quote

priyamnavada wrote:

Quote:
The CONTINUE goes to statement next after the Explicit scope terminator such as (END-IF, END-PERFORM etc...) but the NEXT Statement goes after the Implicit scope terminator (period .).


I think it is vice versa. icon_confused.gif ..Next sentence goes to stmt after explicit treminators(END-IF, END-PERF)....and CONTINUE goes just to next sentence(does nothing, it will behave as if not coded)...
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Wed May 16, 2007 1:50 pm    Post subject:
Reply with quote

Hi,

A small background:

CONTINUE statement is functionally similar to the EXIT statement but their objectives are different. While EXIT should be used to have a common end point for a sequence of paragraphs, CONTINUE can be used anywhere when a null path is required. It can also be used in IF statements in place of NEXT SENTENCE phrase.

Sometimes, we encounter situations where no action needs to be specified if the situation is true, but some actions are necessary if the condition is false. In that case, the NEXT SENTENCE pharse can be used for the then part & the else part can be written to indicate the action required.

Consider the following IF statement:

IF OK-BALANCE NEXT SENTENCE ELSE MOVE 2 TO BALANCE-CODE

I hope, flow chart will make understanding better, so I draw that for the above If statement, PFA.


For your post, CONTINUE & NEXT SENTENCE will serve the same purpose.
Back to top
View user's profile Send private message
priyamnavada

New User


Joined: 24 Dec 2005
Posts: 52
Location: hyderabad

PostPosted: Wed May 16, 2007 8:14 pm    Post subject:
Reply with quote

Hi rameshfoa,

what i wrote is correct man. After assuring it only, i answered it.
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
This topic is locked: you cannot edit posts or make replies. Job to wait and continue based on reply yugendran COBOL Programming 5 Wed Oct 05, 2016 1:46 pm
No new posts Not enough virtual memory is availabl... Vinay Pushpala IBM Tools 16 Tue Sep 13, 2016 4:37 pm
No new posts How to continue ftp line when the fil... jasorn JCL & VSAM 1 Fri Mar 14, 2014 5:47 am
No new posts Continue PARM in SYSIN DD * vishalbshah DB2 9 Thu Apr 19, 2012 3:23 pm
No new posts How to continue message while using O... ppandey07 JCL & VSAM 3 Wed Sep 21, 2011 4:21 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us