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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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