The NUMBER data type is not supported with SAS/ACCESS® Interface to Teradata


Support for the Teradata NUMBER data type has been added to SAS/ACCESS Interface to Teradata with SAS® 9.4M7 (TS1M7) and SAS® Viya® 3.5. The Teradata NUMBER data type has a higher level of precision than SAS® 9.4 supports so data truncation might occur.

If you are not using the NUMBER data type in calculations but you want a higher level of precision than what SAS® supports, you can use the Teradata CAST() function with explicit pass-through to change the column to the CHAR data type:

cast(var1 as char(20)) as var1

You can place the CAST() function in a Teradata view. You can also use the DBSASTYPE= data set option with the Teradata LIBNAME engine to convert it to the CHAR data type:

teralib.test(dbsastype=(var1='char(20)'))

Otherwise, the variable will be read in and stored as a different value from what existed in Teradata.

Trying to use an earlier version of SAS to read in a Teradata table that contains a NUMBER data type column might result in a note or error similar to one of the following:

var1

To read in the NUMBER data type with an earlier version of SAS, you can use either the CAST or DBSASTYPE= approach discussed above to read it as a character. If the column has a level of precision that SAS supports, you can CAST it to a numeric data type that SAS supports or set the data type to NUMERIC with the DBSASTYPE= option:

cast(var1 as float) as var1
teralib.test(dbsastype=(var1='numeric'))