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
 
diff forms of evaluate stmt

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: diff forms of evaluate stmt
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    Post subject: HI
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    Post subject:
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: 436
Location: chennai, India

PostPosted: Wed Sep 14, 2005 11:39 am    Post subject:
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    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 Compare PD Values with same storage &... Shrinika Rajendran JCL & VSAM 5 Wed Nov 05, 2014 3:17 pm
No new posts merge records from 2 ps files with di... kishpra DFSORT/ICETOOL 6 Wed Mar 19, 2014 1:00 pm
No new posts Need help on SORT to write each input... rahul sijoriya JCL & VSAM 4 Mon Dec 02, 2013 9:09 pm
No new posts DB2 delete row from one table with a ... Shereen Samuel DB2 1 Thu Apr 11, 2013 12:08 pm
This topic is locked: you cannot edit posts or make replies. What is exact diff and adv btw Comp p... MOHAN KUMAR DURAIRAJAN COBOL Programming 1 Thu Mar 14, 2013 4:39 pm

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