SAS Procedures

Help using Base SAS procedures
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.

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

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
  • 1174 views
  • 0 likes
  • 3 in conversation