BookmarkSubscribeRSS Feed
Cranky
Calcite | Level 5

 

Buenos días.

 

Cuál es el límite de los numéricos en sas? Por qué redondea a partir de una cantidad de dígitos?

 

Por ejemplo:

 


data prueba;
attrib campo1 length = 8. format = 21.2 informat = 21.2;
attrib campo2 length = 8. format = 32.15 informat = 32.15;

campo1=1234567890.12;
campo2=1234567890.1234;
output;
campo1=123456789012.34;
campo2=123456789012.3456;
output;
campo1=12345678901234.56;
campo2=12345678901234.5678901;
output;

run;

 

 

Cuando consultas la tabla va redondeando los números. Que se puede hacer para que sas no redondee?

 

Muchas gracias

2 REPLIES 2
Kurt_Bremser
Super User

Because of the way SAS stores numbers (binary 8 byte real), only 15 to 16 decimal digits can be stored accurately. For the details, google "sas numeric precision".

Cranky
Calcite | Level 5

Muchas gracias,

 

Buscaré, pero creo que no hay forma de recuperar el valor completo que se le asigna a la variable.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

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.

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
  • 2907 views
  • 0 likes
  • 2 in conversation