08-12-2016 10:51 AM
I am facing issue with rounding issue. In my SAS program, we need to calculate each store perfomance in percenage based on sales, commissoin etc.
this calcuated performace percentage is sent to another system which will post to portal. But the another system is rejecting it because sum of all performace percentage is exceeding 100% (i.e. 100.02). I believe this is due to rounding.
can anyone please suggesst how I can resolve this rounding issue.
I used ROUND(PERCENT,0.01) and also defined percentage variable as 16.2 (format PVAR 16.2
thank you for your help in advance.
08-12-2016 11:53 AM
Please show how you are generating the data sent to "other system". To force a total of percentages is going to take a little more work than rounding a variable as you may round down or up to many times and end up with less than 100 or more than 100.
So will need to do something that checks the total of the percentages. Note that the report procedures may not be adequate.
There are also some potential issues with storage precision on both ends of the process in that some decimal values don't quite have exact binary storage.