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
 
Can we have statements above / after CONTINUE

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Can we have statements above / after CONTINUE
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    Post subject:
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    Post subject:
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    Post subject: Re: About continue ...
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    Post subject:
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    Post subject: Re: About continue ...
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: 1187
Location: Bangalore,India

PostPosted: Mon Sep 25, 2006 8:35 pm    Post subject:
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    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 PLI %IF statements Pedro PL/I & Assembler 1 Tue Sep 19, 2017 12:06 am
This topic is locked: you cannot edit posts or make replies. Extract all "IF" Statements... Adarsh Damodaran CLIST & REXX 1 Wed Sep 06, 2017 9:28 am
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 Symbolic Parameters in SYSIN DD state... madishpa DFSORT/ICETOOL 3 Mon Jun 27, 2016 6:23 pm

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