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 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

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

View all other training opportunities.

Discussion stats
  • 2 replies
  • 2213 views
  • 0 likes
  • 2 in conversation