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

CONTINUE without END-IF


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
GAFUR

New User


Joined: 19 May 2005
Posts: 31

PostPosted: Thu May 19, 2005 11:33 am
Reply with quote

Hi ,

Can i use a CONTINUE statement in if-loop with out scope terminator END-IF. Will it show any compilation error? If Not ,What happen to that if-loop while executing the program?

Shall any body explain.

Regards
Gafur.
Back to top
View user's profile Send private message
subhasis_50

Moderator


Joined: 09 Mar 2005
Posts: 363
Location: Earth

PostPosted: Thu May 19, 2005 7:56 pm
Reply with quote

Hi,
If you use continue without END-IF you will not get any compile error. The control passes during the time of execution until it finds any terminator. So continue will start after that statement.
For example:
IF VAR1 = 0
CONTINUE
ELSE
PERFORM 111-PARA
END-IF.
DISPLAY 'HELLO'
PERFORM 222-PARA.
DISPLAY 'WORLD'

In normal condition if condition is satisfied the control passed to first display statement and continue execution. If you will not code END-IF, control comes in the 2nd display directly if the condition matches in the IF statement.
Please let me know if you have any doubt
Back to top
View user's profile Send private message
GAFUR

New User


Joined: 19 May 2005
Posts: 31

PostPosted: Fri May 20, 2005 12:30 pm
Reply with quote

Hi Subhasis,


That means if you code period instead of END-IF, Control will goes to the statement following this period.Am i right?

Then for following the result is 'HELLO' if the IF condition pass.

IF VAR1 = 0
CONTINUE
ELSE
PERFORM 111-PARA.

DISPLAY 'HELLO' .

Regards
Gafur.
Back to top
View user's profile Send private message
subhasis_50

Moderator


Joined: 09 Mar 2005
Posts: 363
Location: Earth

PostPosted: Fri May 20, 2005 1:01 pm
Reply with quote

Hi,
Yes u r right. It is better that u should write the code and test 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