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

Clarification in Evaluate


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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: 411
Location: Colarado, US

PostPosted: Wed Dec 14, 2005 6:12 pm
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: Atlanta, (USA)

PostPosted: Thu Dec 15, 2005 3:23 am
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: 411
Location: Colarado, US

PostPosted: Thu Dec 15, 2005 6:14 am
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
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
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: 1448
Location: Chicago, IL

PostPosted: Thu Dec 15, 2005 10:41 pm
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: Atlanta, (USA)

PostPosted: Fri Dec 16, 2005 2:17 am
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: 411
Location: Colarado, US

PostPosted: Fri Dec 16, 2005 7:02 am
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 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 Need clarification of VSAM FCT and DF... CICS 15
No new posts Clarification regarding BUFNI & B... JCL & VSAM 14
No new posts DB2 9 - Utilities - COPY,REORG Clarif... DB2 3
No new posts Evaluate statement, when-clause in co... COBOL Programming 10
Search our Forums:

Back to Top