|
The requirement is to take a currency conversion rate and convert it
to a price value.
The rate in question is 70.758.
The calculation is 1 / Rate (70.758) which yields .0141326.
I need the result to be .0142, not .0141.
When reading the SQL reference, I came across the QUANTIZE function.
When the <ed: following two statements are issued consecutively>
in the interactive SQL environment, I get the desired result:
Set CURRENT DECFLOAT ROUNDING MODE = Round_Up
select quantize((1/70.758),.0001) FROM SYSIBM/SYSDUMMY1
When I put the statements in my program it appears to ignore the SET
value.
How can I get this to work in my RPG program?
The embedded SQL is:
Exec SQL
Set CURRENT DECFLOAT ROUNDING MODE = Round_Up;
Exec SQL
Select Quantize(:Work_Price,.0001) Into :Sell_Price
from SysIbm/SysDummy1;
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.