I've got two source tables. Both contain a numeric variable called SUM. I'll call them SUM_A and SUM_B.
SUM_A can sometimes be displayed using a scientific notation. SUM_B is always displayed as a plain number.
I need to add SUM_A to SUM_B. I've made the new variable SUM_TOTAL (format: comma20.) which uses this expression: SUM_A + SUM_B
When SUM_A uses a scientific notation, then the end result is always equal to SUM_B. Example:
How can I make SUM_TOTAL display SUM_A + SUM_B?
Try format BEST20.
And when adding very small numbers to considerably large numbers, you will run into the limits of numeric precision. Keep in mind that only 15 to 16 decimal digits can be stored reliably in 8-byte real.
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.