June 26, 2008, 09:23 AM
Colin B.Problem with IF..THEN statements
Hi folks. I am trying to use an IF..THEN statement in a DEFINE that will allow me to store a different value in a defined field based on some parameters, however, I keep receiving the following error.
(FOC260) AN OPERATION IS MISSING AN ARGUMENT
Here is the piece of code it is erroring on...
CTN_VAL/P7.2=IF LOC_OH LE MAX THEN REPLPNT ELSE IF LOC_OH GT MAX THEN MAX ELSE LOC_OH;
From guessing, I'm thinking this is giving me a problem because I am trying to return a value of another field, other than a specific value such as IF LOC_OH LE MAX THEN '02';
So, I guess my question is, is it possible to do this? The LOC_OH field just contains a value that contains a quantity on hand, the MAX field contains a value we have stored in a FOCUS master file that represents the MAX number, and REPLPNT is also stored in that master file and contains another value. I know all of these fields contain values because I have tried printing them in the request and they all show up so it's not like I'm trying to pass a non value if that might be the problem.
So I basically just want this to return the values from the different fields based on my IF..THEN statement to the field CTN_VAL.
Any help on this would be wonderful, thanks!
June 26, 2008, 09:33 AM
GinnyJakesMAX is a 'reserved' word, i.e. a prefix operator. If you change this to something else, your code will work.
June 26, 2008, 09:46 AM
Colin B.Thank you! This solution worked.