‎2009 Oct 23 7:12 PM
Hi all,
data: g(16) type c value '23.75',
k(12) type c value '1.00000',
l(16) type c.
l = g * k.
CONDENSE l.
write: l .
the above code will give 23.75 if FIXED POINT ARITHMATIC CHECKBOX is checkd in the program attributes.
Other wise it will give output as 237500000.
I am using such type of code in an Enhancement Implementation . there iam not able to check FIXED POINT ARITHMATIC CHECKBOX .
in such case how can i prceed with FIXED POINT ARITHMATIC ..? .
Thanks in advance,
sarath P
‎2009 Oct 23 7:22 PM
If you cannot check FIXED POINT ARITHMATIC CHECKBOX.
try this.
data: g type p DECIMALS 2 value '23.75',
k type p DECIMALS 5 value '1.00000',
l type p DECIMALS 7.
l = g * k.
write: l decimals 2.
Cheers,
Chaiphon
‎2009 Oct 23 7:26 PM
‎2009 Oct 23 8:01 PM
the problem is because you are defining v_lc_netwr type ekpo-netwr which have only 3 decimals.
for calculating without FIXED POINT ARITHMATIC CHECKBOX. you need to calculate the total decimal points.
in this case netwr has 2 decimal and wkurs has 5 decimals so the total variable should have 7 decimals.
‎2009 Oct 23 8:09 PM
Well then declare your resultant variable as type p decimals 8. This will take care of the output for the exact result.
‎2009 Oct 23 8:33 PM
But why are you doing arithmetic operations on character data? It is much more efficient to use packed decimal.
Rob