- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hello Everyone,
I have the following value in a variable '0.1234567890123456'. I need to create a numeric variable to keep exactly the same number as the text and tried a variety of formats. However, the closest I got was a numeric field with the number 0.12345678901234 (14 decimal places instead of 16)
Any hint to keep all 16?
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
How did you import the data? It may be better to do it in the import stage than after the fact, since SAS isn't likely storing the numbers with 16 decimal places correctly in the first place.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I am importing as text exactly to keep all the 16 decimal places '0.1234567890123456'. However, when I create a numeric variable converting the text to numeric, I only can keep 14 decimal places 0.12345678901234.
I would like to confirm whether SAS has such a limitation or I can find any numeric format to keep all the 16 decimal places.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
SAS has this limitation. Please see the link in my first response.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Curious to know why you need 16 decimal places in the first place?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
If you need to store more digits than SAS can represent exactly using floating point numbers then you need to store them as character strings.
What type of arithmetic are you doing on these values? Why do you think that the 16th least significant digit has any added value?