BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Jade_SAS
Pyrite | Level 9

Hi All,

 

    I have a column value in Teradata which is -999999999992240155, while the corresponding value in SAS is -999999999992240128.

Any insights why the values are different?

    BTW, the data type in Teradata is decimal(18,0), the data type in SAS is numeric and format=19.

 

    Thank you!

 

Jade

1 ACCEPTED SOLUTION

Accepted Solutions
Kurt_Bremser
Super User

Usually, when one encounters numbers with that many digits, they are not actual numbers, but some kind of code, in which case they should be kept in strings (character).

Keep in mind that the 15 digits of SAS can store the GNP of the US down to dimes, so that's sufficient for statistics.

View solution in original post

4 REPLIES 4
Kurt_Bremser
Super User

All numbers in SAS dataset are stored in 8 bytes, real format (mantissa + exponent). Or less, if the length is reduced with a length statement.

That means that SAS can reliably store around 15 decimal digits. Any further digits will be lost or changed.

For further information, google for "sas numerical precision".

Jade_SAS
Pyrite | Level 9

Thank you so much KurtBremser! So the value -999999999992240155 is out of the valid range of SAS, right?

Is there any work around to deal with this situation? Or there is nothing we can do with it?

 

Thanks,

Jade

Kurt_Bremser
Super User

Usually, when one encounters numbers with that many digits, they are not actual numbers, but some kind of code, in which case they should be kept in strings (character).

Keep in mind that the 15 digits of SAS can store the GNP of the US down to dimes, so that's sufficient for statistics.

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 connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 1251 views
  • 1 like
  • 2 in conversation