Focal Point
Problem with IF..THEN statements

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/2031004982

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!


FOCUS 7.3
June 26, 2008, 09:33 AM
GinnyJakes
MAX is a 'reserved' word, i.e. a prefix operator. If you change this to something else, your code will work.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
June 26, 2008, 09:46 AM
Colin B.
Thank you! This solution worked.


FOCUS 7.3
June 27, 2008, 10:36 AM
PBrightwell
Nice catch Ginny!


Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes