June 07, 2007, 06:35 AM
robyresult of division
I have this problem:
P8.2L = Field1 / field2;
At time I have as result ‘*************’
Is possible to check if the result is ‘****’?
In the output I must :
If result = ‘********’ then 99999999
Else the risult of division
thanks for any help and excuse-me for my english
June 07, 2007, 07:07 AM
FrankDutchRoby
What do you think will cause the '****'
How about trying to enlarge the formula field to lets say RESULT/P15.2L and see what happens...
June 07, 2007, 07:35 AM
robyIf I define Result/p15.2, I have the correct result.
The cause of '*****' is that the field RESULT is more little then result of division.
In my pgm I do:
result1/p15.2 = Field1 / field2
result /p8.2 = if result1 gt 99999,99 then 99999,99 else result1 ;
Is possible to ckeck with a few function if the result is '****'?
I must to inform when the result of operazion is out of range (is the filed is out of range I must to write the field of output 99999,99).
excuse-me for my english
June 07, 2007, 08:33 AM
Alan BRoby
The *s' are an output format only, so you cannot test for them.
but you have the code basics correct for testing.
result/P8.2 = 99999999,99;
newResult/P8.2 = IF result GT 99999,99 THEN 99999,99 ELSE result ;