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

Can we have statements above / after CONTINUE


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

New User


Joined: 22 Feb 2005
Posts: 10
Location: Chennai

PostPosted: Mon Sep 25, 2006 4:46 pm
Reply with quote

Can we have statements above / after continue ...
Back to top
View user's profile Send private message
shreevamsi

Active User


Joined: 23 Feb 2006
Posts: 305
Location: Hyderabad,India

PostPosted: Mon Sep 25, 2006 4:51 pm
Reply with quote

Logically have an statement above/after a CONTINUE
sounds Odd icon_wink.gif
Back to top
View user's profile Send private message
cj10

New User


Joined: 18 Sep 2006
Posts: 9

PostPosted: Mon Sep 25, 2006 5:16 pm
Reply with quote

Hi,

By statements above & below CONTINUE, do you mean the following ?

Code:
IF DEPT = "X"
    Compute Bonus = Sal * 0.2      ===> Above
    Continue
    ADD 1 To X-DEPT-CNT             ===> Below
ELSE
    Compute Bonus = Sal * 0.5
END-IF


You will not have any compilation errors. However, logically this is not correct. Even without CONTINUE, the prg will execute the statements before & after the CONTINUE statement.
Back to top
View user's profile Send private message
hsiva2003

New User


Joined: 22 Feb 2005
Posts: 10
Location: Chennai

PostPosted: Mon Sep 25, 2006 5:29 pm
Reply with quote

Can U plzz tell me How statements after continue will get displayed....
Back to top
View user's profile Send private message
cj10

New User


Joined: 18 Sep 2006
Posts: 9

PostPosted: Mon Sep 25, 2006 6:12 pm
Reply with quote

In the above example, if DEPT = "X", X-DEPT-CNT will have 1 & control comes out of the IF-ENDIF loop.
Back to top
View user's profile Send private message
b4uthammi
Warnings : 2

New User


Joined: 21 Feb 2005
Posts: 14
Location: hyderabad

PostPosted: Mon Sep 25, 2006 6:29 pm
Reply with quote

hai,

Code:
IF A=B
  CONTINUE
ELSE
   MOVE 5 T0 A
END-IF

IF C=D
   DISPLAY "HAI"
ELSE
   DISPLAY  "HELLO"
END-IF.

If A=B is true,then control will transfer to IF c=d condition i.e next statement after IF---END-IF block .

having statement after or above CONTINUE does't make sense to the program.


regards
Tr
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Mon Sep 25, 2006 8:35 pm
Reply with quote

Yes Tr is right .

Code:
IF A=B
CONTINUE
ELSE
MOVE 5 T0 A
END-IF


if we put some stmt like display 'hi' just befor CONTINUE

Code:
IF A=B
DISPLAY 'HI'
CONTINUE
ELSE
MOVE 5 T0 A
END-IF


THEN THERE IS NO NEED TO PUT CONTINUE STATEMENT.

So hope it is clear now that having statement after or above CONTINUE does't make sense to the program.
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
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts Relate COBOL statements to EGL statement All Other Mainframe Topics 0
No new posts Embeding DB2 sql statements in scirpt... DB2 7
No new posts filter COMMIT/ROLLBACK statements DFSORT/ICETOOL 13
No new posts Rexx to create VSAM define statements CLIST & REXX 10
Search our Forums:

Back to Top