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

 

Time is running out to save with the early bird rate. Register by Friday, March 1 for just $695 - $100 off the standard rate.

 

Check out the agenda and get ready for a jam-packed event featuring workshops, super demos, breakout sessions, roundtables, inspiring keynotes and incredible networking events. 

 

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.

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