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
 
EVALUATE statement usage

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: EVALUATE statement usage
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: 1187
Location: Bangalore,India

PostPosted: Tue Jul 24, 2007 10:46 am    Post subject:
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    Post subject: Re: EVALUATE statement usage
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: 1187
Location: Bangalore,India

PostPosted: Tue Jul 24, 2007 11:40 am    Post subject:
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    Post subject:
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    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 how can i move s9(9) to s9(9) usage comp HARENDRA CHOUDHARY COBOL Programming 3 Mon Nov 06, 2017 12:10 am
No new posts COBOL - EXIT statement weird behavior anthony.pangestu COBOL Programming 0 Fri Oct 27, 2017 9:57 am
No new posts WER268A OUTREC STATEMENT : SYNTAX E... frozenblood87 SYNCSORT 12 Sat Aug 26, 2017 9:45 pm
No new posts Suppress value reported by BREAK in D... Learncoholic DFSORT/ICETOOL 3 Wed Aug 16, 2017 6:03 pm
No new posts ON 2 AND EVERY 1 - Statement ??? UmeySan COBOL Programming 2 Tue Jul 25, 2017 1:20 pm

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