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

EVALUATE statement usage


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

New User


Joined: 14 Mar 2007
Posts: 60
Location: Thiruvananthapuram

PostPosted: Tue Jul 24, 2007 10:34 am
Reply with quote

hi,

I want to check for business type and state code. i can write an if statement like
if ws-st1 and ws-typ1 then
perform xxxx1
else
if ws-st2 and ws-typ2
perform xxxx2
else
perform xxxx3
how can i do this with EVALUATE statement.
The confusion is , i need to check for two things.how can i include both.

Please help me.

Thanks
LC
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Tue Jul 24, 2007 10:46 am
Reply with quote

Hi There,

Code:
EVALUATE business-type ALSO state-code
WHEN ws-st1 ALSO ws-typ1
         PERFORM xxxx1
WHEN ws-st2 ALSO ws-typ2
         PERFORM xxxx2
WHEN OTHER
         PERFORM xxxx3
END-EVALUATE


Hope it will helpful
Back to top
View user's profile Send private message
lekshmi_ci

New User


Joined: 14 Mar 2007
Posts: 60
Location: Thiruvananthapuram

PostPosted: Tue Jul 24, 2007 11:08 am
Reply with quote

hi ekta,

what about the OR condition...
if ws-type1 or ws-state1
perform...
else
if...

LC
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Tue Jul 24, 2007 11:40 am
Reply with quote

Hi LC,

Code:
EVALUATE TRUE
WHEN ws-st1
WHEN ws-typ1
         PERFORM xxxx1
WHEN ws-st2
WHEN ws-typ2
         PERFORM xxxx2
WHEN OTHER
         PERFORM xxxx3
END-EVALUATE


Here I am assuming ws-st1 ,ws-st2 ,ws-typ1 & ws-typ2 are 88 level variable.
Back to top
View user's profile Send private message
Sarva_bubli

New User


Joined: 09 Aug 2006
Posts: 37
Location: Pune, India

PostPosted: Tue Jul 24, 2007 4:38 pm
Reply with quote

Hi,
You can try either of the following one.

EVALUATE TRUE
WHEN WS-ST1 AND WS-TYP1
PERFORM XXXXX1
WHEN WS-ST2 AND WS-TYP2
PERFORM XXXXX2
WHEN OTHER
PERFORM XXXXX3
END-EVALUATE

(or)

EVALUATE TRUE ALSO TRUE
WHEN WS-ST1 ALSO WS-TYP1
PERFORM XXXXX1
WHEN WS-ST2 ALSO WS-TYP2
PERFORM XXXXX2
WHEN OTHER
PERFORM XXXXX3
END-EVALUATE
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 STEM usage in REXX CLIST & REXX 14
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 z/OS Modules Usage report using SMF 42 DFSORT/ICETOOL 2
No new posts Concatenate 2 fields (usage national)... COBOL Programming 2
Search our Forums:

Back to Top