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
 
Clarification in Evaluate

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
Abirami.YN

New User


Joined: 16 Jul 2005
Posts: 15
Location: India - Chennai

PostPosted: Wed Dec 14, 2005 6:04 pm    Post subject: Clarification in Evaluate
Reply with quote

Hi,

Can we perform the evaluate function as below?

EVALUATE X

WHEN 1 THRU 5 COMPUTE X =X+1
WHEN 6 THRU 10 COMPUTE X= X+2
WHEN GREATER THAN EQUAL TO 11 COMPUTE X = X+3

END-EVALUATE.


Thanks,
Abirami
Back to top
View user's profile Send private message

iknow

Active User


Joined: 22 Aug 2005
Posts: 413
Location: Colarado, US

PostPosted: Wed Dec 14, 2005 6:12 pm    Post subject: Re: Clarification in Evaluate
Reply with quote

Hi Abirami,

To my understanding your code works fine.

Please check my attachment for more information on EVALUATE VERB.
Back to top
View user's profile Send private message
muffirulz

New User


Joined: 14 Sep 2005
Posts: 74
Location: Kentucky, USA

PostPosted: Thu Dec 15, 2005 3:23 am    Post subject: Re: Clarification in Evaluate
Reply with quote

hi there,

Your code is fine and it should working an dif you r sure that the value of X can never be zero or less than zero than you can use

EVALUATE X

WHEN 1 THRU 5 COMPUTE X =X+1
WHEN 6 THRU 10 COMPUTE X= X+2
WHEN OTHER COMPUTE X = X+3

END-EVALUATE.
Back to top
View user's profile Send private message
iknow

Active User


Joined: 22 Aug 2005
Posts: 413
Location: Colarado, US

PostPosted: Thu Dec 15, 2005 6:14 am    Post subject: Re: Clarification in Evaluate
Reply with quote

Hi muffirulz,

In this case "X" has to be positive(excluding ZERO).

Hope this helps.
Back to top
View user's profile Send private message
Abirami.YN

New User


Joined: 16 Jul 2005
Posts: 15
Location: India - Chennai

PostPosted: Thu Dec 15, 2005 11:13 am    Post subject:
Reply with quote

Thanks for ur Reply.
Back to top
View user's profile Send private message
raghunathns

Active User


Joined: 08 Dec 2005
Posts: 127
Location: rochester

PostPosted: Thu Dec 15, 2005 2:39 pm    Post subject:
Reply with quote

I dont think it will work..the last when will fail.

change to

EVALUATE TRUE

WHEN x>0 and X < 6
COMPUTE X =X+1
WHEN x>5 and x <11
COMPUTE X= X+2
WHEN x > 10
COMPUTE X = X+3

END-EVALUATE.

the option given by muffirulz also works.
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1452
Location: Chicago, IL

PostPosted: Thu Dec 15, 2005 10:41 pm    Post subject: Re: Clarification in Evaluate
Reply with quote

I agree with raghunathns....

That code doesn't work for me....

Regards,

Priyesh.
Back to top
View user's profile Send private message
muffirulz

New User


Joined: 14 Sep 2005
Posts: 74
Location: Kentucky, USA

PostPosted: Fri Dec 16, 2005 2:17 am    Post subject: Re: Clarification in Evaluate
Reply with quote

hi iknow,

in my post I have mentioned that x has to be positive and greater than zero buddy icon_idea.gif

regards
Back to top
View user's profile Send private message
iknow

Active User


Joined: 22 Aug 2005
Posts: 413
Location: Colarado, US

PostPosted: Fri Dec 16, 2005 7:02 am    Post subject: Re: Clarification in Evaluate
Reply with quote

Hi muffirulz,


I too have given the same suggestion but instead of saying x>0 I mentioned excluding ZERO. I thought others might have got the point.

Anyways thanks for posting it clearly.
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 Need clarification of VSAM FCT and DF... pkmurali CICS 15 Sun Apr 10, 2016 1:06 am
No new posts Clarification regarding BUFNI & B... thirumalasetty JCL & VSAM 14 Tue Jun 17, 2014 8:22 pm
No new posts DB2 9 - Utilities - COPY,REORG Clarif... gylbharat DB2 3 Mon Oct 22, 2012 12:30 pm
No new posts Evaluate statement, when-clause in co... UmeySan COBOL Programming 10 Mon Jul 16, 2012 6:49 pm
No new posts Generate report with out using IF/EVA... bbharathiraj COBOL Programming 25 Tue May 22, 2012 10:19 am

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