Skip to content
Advertisement

Defining number of decimals in teradata column during Select statement

In teradata proc sql in SAS Enterprise guide environment, I am trying to create a column by multiplying two fields, but I have been having overflow issue. How do I specify the number of decimals in the resulting field during Select statment? numeric(20,2)

error message:

Advertisement

Answer

SAS stores all numbers as 8 byte floating point numbers. The maximum number of significant decimal digits is less than 20. Are your values really larger than 9,999,999,999,999.99? Did you try DECIMAL(15,2)?

You can cast the value as FLOAT and attach a format on the SAS side to only display 2 decimal places.

If you really need to store 20 decimal digits exactly then you will need to split the value into two fields.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement