Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Evaluate has inbuild BREAK Statement or Not

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

New User


Joined: 21 Jun 2005
Posts: 5

PostPosted: Tue Jun 21, 2005 6:34 pm    Post subject: Evaluate has inbuild BREAK Statement or Not
Reply with quote

Hi ,
what will be o/pf following.

x =4


EVALUATE TRUE

WHEN X<5
DISPLAY " LESS THAN 5"

WHEN X>3
DISPLAY " GREATER THAN 3"

END-EVALUATE.

DO WE WILL GET BOTH THE MESSAGES OR WE COME OUT OF EVALUATE WHEN A CONDITION GET SATISFIED FOR THE FIRST TIME.

ANOTHER Query

What is diffrence between NEXT STATEMENT AND CONTINUE , IF POSSIBLE TRY TO EXPLAIN IN CONTEXT OF EVALUATE STATEMENT.
Back to top
View user's profile Send private message

kanak

Moderator


Joined: 12 Mar 2005
Posts: 252
Location: India

PostPosted: Tue Jun 21, 2005 6:46 pm    Post subject:
Reply with quote

Control comes out of the Evaluate -When once one condition is satisfied. Hence you will be getting output as "LESS THAN 5"

Difference between NEXT statement and CONTINUE is
Next statement executes next statement after first available period. Where as continue is just next statement.

For example
Code:
COMPUTE  X = A + B
    EVALUATE X
          WHEN 3
                    NEXT STATEMENT
          WHEN 4
                    CONTINUE
     END-EVALUATE
     ADD 5 TO X.
     DISPLAY X.


When x will be 3 then it will display 3 where as when it is 4 then it will display 9. Hope this will clear your doubt in some extent.

Correct me if i am wrong.
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 ROUNDED Problem with COMPUTE statement shalem COBOL Programming 11 Thu Feb 09, 2017 8:16 pm
No new posts VALIDATE NULL VALUE IN DB2 CASE STATE... useit DB2 5 Thu Feb 09, 2017 4:34 pm
No new posts -913/-911 Deadlock during UPDATE stat... NoSleep319 DB2 5 Fri Nov 18, 2016 12:37 am
No new posts COBOL DB2 - CALL statement - high CPU... TS70363 DB2 15 Sun Sep 11, 2016 6:07 am
No new posts Converting NULL column into NOT NULL ... Raghu navaikulam DB2 5 Sat Aug 06, 2016 3:45 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us