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

diff forms of evaluate stmt


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

New User


Joined: 30 Aug 2005
Posts: 4

PostPosted: Wed Sep 07, 2005 12:35 am
Reply with quote

hi all
i want to know abt different forms of evaluate statement
plz give examples..
thanks
Back to top
View user's profile Send private message
sihanature
Warnings : 1

New User


Joined: 01 Sep 2005
Posts: 33

PostPosted: Wed Sep 07, 2005 2:14 am
Reply with quote

Hi,

It depicts the Normal Switch-Case method , here are the Examples.

1)EVALUATE TRUE
WHEN PERCENT >= 80 MOVE ?A? TO GRADE
WHEN PERCENT >= 70 MOVE ?B? TO GRADE
WHEN PERCENT >= 60 MOVE ?C? TO GRADE
WHEN PERCENT >= 50 MOVE ?D? TO GRADE
WHEN OTHER MOVE ?E? TO GRADE
END-EVALUATE

2)EVALUATE CHOICE
WHEN 1
PERFORM FIRST-PARA1.
WHEN 2
PERFORM SECOND-PARA1.
WHEN OTHER
PERFORM COMM-PARA1.
END-EVALUATE

Hope it might helpfull for you.
Back to top
View user's profile Send private message
paru

New User


Joined: 24 Jun 2005
Posts: 9
Location: INDIA

PostPosted: Wed Sep 14, 2005 10:58 am
Reply with quote

I wud like to add to that ..
You cud also use
EVALUATE TRUE ALSO TRUE
WHEN ((A>B) AND (B>C))
PERFORM PARA1
WHEN ((A<B) AND (B<C))
PERFORM PARA2
WHEN OTHER
PERFORM PARA3
END-EVALUATE

There are other forms also which i dont remember now.

Cheers,
Paru icon_smile.gif
Back to top
View user's profile Send private message
radhakrishnan82

Active User


Joined: 31 Mar 2005
Posts: 435
Location: chennai, India

PostPosted: Wed Sep 14, 2005 11:39 am
Reply with quote

Evaluate:

1. General Evaluate (In which, we can also use THRU in WHEN condition)
2. Evaluate ALSO (In which, we can also use THRU in WHEN Condition)

syntax:

Evaluate Case-1{ ALSO Case-2}
WHEN Conditon1{ ALSO Condition2.}
...
{When Other Imperative-Stmt}
end-evaluate.

Case-1 & Case-2 May be in these forms.
1.Identifier
2.Literal
3.Expression
4.TRUE
5.FALSE

Condition1 or Condition-2:

ANY
condition
TRUE
FALSE
NOT Condition1 THRU Condition1

Usage with Also
Code:

EVALUATE VAR1 ALSO VAR2
WHEN 1 ALSO 2 PERFORM PARA-1
WHEN 1 ALSO 3 PERFORM PARA-2
.
.
END-EVALUATE.

here to perfrom para -1 var1 and var2 must contain value 1 and 2.
ie the statement is equivallent to
Code:
IF VAR1 = 1 AND VAR2 = 2
PERFORM PARA-1
END-IF
.

Usage with next and continue
Code:
COMPUTE  X = A + B
    EVALUATE X
          WHEN 3
                    NEXT STATEMENT
          WHEN 4
                    CONTINUE
     END-EVALUATE
     ADD 5 TO X.
     DISPLAY X.



hope this helps.
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 Evaluate variable to execute a jcl step JCL & VSAM 3
No new posts Sort on different fields, removing du... SYNCSORT 8
No new posts How syntax check at Bind time is diff... DB2 5
No new posts Compare PD Values with same storage &... JCL & VSAM 5
No new posts merge records from 2 ps files with di... DFSORT/ICETOOL 6
Search our Forums:

Back to Top