View previous topic :: View next topic
|
Author |
Message |
Abirami.YN
New User
Joined: 16 Jul 2005 Posts: 15 Location: India - Chennai
|
|
|
|
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 |
|
|
iknow
Active User
Joined: 22 Aug 2005 Posts: 411 Location: Colarado, US
|
|
|
|
Hi Abirami,
To my understanding your code works fine.
Please check my attachment for more information on EVALUATE VERB. |
|
Back to top |
|
|
muffirulz
New User
Joined: 14 Sep 2005 Posts: 74 Location: Atlanta, (USA)
|
|
|
|
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 |
|
|
iknow
Active User
Joined: 22 Aug 2005 Posts: 411 Location: Colarado, US
|
|
|
|
Hi muffirulz,
In this case "X" has to be positive(excluding ZERO).
Hope this helps. |
|
Back to top |
|
|
Abirami.YN
New User
Joined: 16 Jul 2005 Posts: 15 Location: India - Chennai
|
|
|
|
Thanks for ur Reply. |
|
Back to top |
|
|
raghunathns
Active User
Joined: 08 Dec 2005 Posts: 127 Location: rochester
|
|
|
|
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 |
|
|
priyesh.agrawal
Senior Member
Joined: 28 Mar 2005 Posts: 1448 Location: Chicago, IL
|
|
|
|
I agree with raghunathns....
That code doesn't work for me....
Regards,
Priyesh. |
|
Back to top |
|
|
muffirulz
New User
Joined: 14 Sep 2005 Posts: 74 Location: Atlanta, (USA)
|
|
|
|
hi iknow,
in my post I have mentioned that x has to be positive and greater than zero buddy
regards |
|
Back to top |
|
|
iknow
Active User
Joined: 22 Aug 2005 Posts: 411 Location: Colarado, US
|
|
|
|
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 |
|
|
|