I am sure I'm missing something simple that I've been told about before, but for the life of me I can't figure out what it is, and the failure of a simple filter is frustrating me.
I am attempting to compare two reported quantities dispensed from different sources, looking for instances where the quantities do not match, but quantity 1 multiplied by a known package size equals quantity 2. For example, Pharmacy A says they dispensed 3 bottles of a certain drug. Each bottle contains 100 pills. The suppliers shows that Pharmacy A dispensed 300 of the drug. Well 3 * 100 = 300, and for my purposes this is good and I can forget about this line item. This is the basic logic of my query, and it work so long as the quantities reported are whole numbers, but anytime there is a decimal involved, my filter is returning the line item saying the quantities are not equal. I have output all the variables involved, including calculated values, so I can see what is being compared, and I don't get it. For some reason 90 = 90, 120 = 120, but 7.2 != 7.2. I hope somebody has an answer for me because I'm at a loss.
Thanks in advance.
Chris
Probably best to use the ROUND function on these values before comparison. For more about numerical precision, see:
SAS(R) 9.2 Language Reference: Concepts, Second Edition
And for exhaustive detail:
Chris
Probably best to use the ROUND function on these values before comparison. For more about numerical precision, see:
SAS(R) 9.2 Language Reference: Concepts, Second Edition
And for exhaustive detail:
Chris
Thank you very much.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Check out this tutorial series to learn how to build your own steps in SAS Studio.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.