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

Evaluate has inbuild BREAK Statement or Not


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts JOIN STATEMENT PERFORMANCE. DFSORT/ICETOOL 12
No new posts Evaluate variable to execute a jcl step JCL & VSAM 3
No new posts Relate COBOL statements to EGL statement All Other Mainframe Topics 0
No new posts process statement for SUPREC, CMPCOLM... TSO/ISPF 4
No new posts SYNCSORT/ICETOOL JOINKEYS SORT Statem... DFSORT/ICETOOL 13
Search our Forums:

Back to Top