BookmarkSubscribeRSS Feed
qd96xuweifeng1
Calcite | Level 5

Hello,

 

I have encountered one problem when I am extracting a numeric variable which is with 18 digits length from database. The last two digits are truncated to 0. For example, the number of 19999999999903 is changed to 19999999999900.

 

qd96xuweifeng1_0-1668709440227.png

May I know what cause this problem? And how to solve it?

 

Thanks,

Weifeng

2 REPLIES 2
Kurt_Bremser
Super User

There is no solution. SAS datasets store numbers in 8 bytes, using the real format. This limits numbers to a precision of 15 to 16 decimal digits, which is sufficient for statistics. When dealing with the US GDP, cents are unimportant.

If this "number" is in fact some kind of code, store it as character.

AMSAS
SAS Super FREQ

Take a look at the documentation or do a search on the communities 

Numeric Precision 

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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