BookmarkSubscribeRSS Feed
sas_Forum
Calcite | Level 5

data work.digits;

input number1 ;

format number1 20.2;

cards;

12899475490358567.67

12899475490358534545.67

;

run;

proc print;

run;

the output is getting wrongly

2 REPLIES 2
Alpay
Fluorite | Level 6

The numbers you are trying to read seem to exceed the number of digits SAS can represent accurately.

Please see http://support.sas.com/techsup/technote/ts654.pdf

for an explanation of numeric precision in SAS by operating environment.

Astounding
PROC Star

Alpay is correct ... here are just a couple of additional notes.

You can always read the values as character instead of numeric.

In SAS, the format width is the entire number of characters being printed (not the number of positions before the decimal point).  The width has to allow for the decimal point, a negative sign if needed, anything that will print.  While SAS doesn't have a width this wide, you would theoretically need a format of 23.2 to print the larger number in your program.

Good luck.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1312 views
  • 0 likes
  • 3 in conversation