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: 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
  • 314 views
  • 0 likes
  • 3 in conversation