- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Posted 11-17-2022 01:27 PM
(462 views)
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.
May I know what cause this problem? And how to solve it?
Thanks,
Weifeng
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Take a look at the documentation or do a search on the communities