IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Regarding CONTINUE & NEXT SENTENCE


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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
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
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
Reply with quote

Look at these previous posts.

ibmmainframes.com/viewtopic.php?t=17332&highlight=continue+next
ibmmainframes.com/viewtopic.php?t=13602&highlight=continue+next
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
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
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: 177
Location: Seattle, WA

PostPosted: Mon May 14, 2007 11:01 pm
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
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
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

Superior Member


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

PostPosted: Wed May 16, 2007 1:50 pm
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
This topic is locked: you cannot edit posts or make replies. Job to wait and continue based on reply COBOL Programming 5
No new posts Not enough virtual memory is availabl... IBM Tools 16
No new posts How to continue ftp line when the fil... JCL & VSAM 1
No new posts Continue PARM in SYSIN DD * DB2 9
No new posts How to continue message while using O... JCL & VSAM 3
Search our Forums:

Back to Top