Help using Base SAS procedures

How can i read numeric obs what is format can i use

Reply
Frequent Contributor
Posts: 140

How can i read numeric obs what is format can i use

data work.digits;

input number1 ;

format number1 20.2;

cards;

12899475490358567.67

12899475490358534545.67

;

run;

proc print;

run;

the output is getting wrongly

Frequent Contributor
Posts: 95

Re: How can i read numeric obs what is format can i use

Posted in reply to sas_Forum

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.

Super User
Posts: 5,497

Re: How can i read numeric obs what is format can i use

Posted in reply to sas_Forum

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.

Ask a Question
Discussion stats
  • 2 replies
  • 131 views
  • 0 likes
  • 3 in conversation