10-20-2019 4:29 PM
Need help!
I get an exception in subj when exec the command like
sum = REDUCE f( INIT amt = 0
FOR ln IN GROUP grp
NEXT amt = amt + ln-sum )
All the types are f. The maximum value is 1E+8. Numer of values is 38.
Why this happens? And how to avoid this?
10-20-2019 4:55 PM
I've found solution (:
The expression should look like
sum = REDUCE f( INIT amt = value #( )
FOR ln IN GROUP grp
NEXT amt = amt + ln-sum )
10-20-2019 4:55 PM
I've found solution (:
The expression should look like
sum = REDUCE f( INIT amt = value #( )
FOR ln IN GROUP grp
NEXT amt = amt + ln-sum )
10-20-2019 5:44 PM
10-20-2019 6:06 PM
By the way,
...(INIT amt = 0
FOR ...
will define the local variable as an integer of 4 bytes because "0" is an integer (same rule as for "DATA(amt) = 0"), so the maximum is around 2E9, I guess the sum of your 38 numbers is above 2E9 hence the overflow.