SAS can hold only 15 significant digits whereas Teradata's BIGINT data type can hold 18 significant digits. As a result, this causes a problem with BIGINT data types within SAS.
The best way to handle columns of type BIGINT is dependent upon several factors:
If none of your BIGINT columns will ever contain a number that is greater than 15 digits, then you can set the environment variable TRUNCATE_BIGINT=YES, which enables BIGINT support with truncation. When this environment variable is set to YES, all of your BIGINT columns are truncated to 15 digits. Caution: You should specify TRUNCATE_BIGINT=YES only if the data that is contained in your columns are 15 digits or fewer.
You must use casting when you use explicit SQL Pass-Through processing. However, you can use TERADATA views to cast the BIGINT data type to the CHAR data type. You do not have to change your existing SQL. It is only necessary to create a view with the BIGINT fields cast as CHAR, and then use the view in your SQL, as shown in the following example:
Casting the BIGINT as a data type INT is not recommended. Doing so causes numeric rounding to occur for large values. You should not try to use a BIGINT type that you are casting as any numeric data type within SAS to do any calculations.
If you prefer, you can create a view of the Teradata table with the cast to CHAR(20) embedded in the SELECT statement in the view. Then you can use the SQL procedure and SELECT statement to select from any SAS data set.
You can create Teradata views from within Teradata with syntax similar to the following:
To get a better understanding of numeric precision, see SAS KB0036211, "Choosing your degree of numeric precision."
Click the Hot Fix tab in this note to access the hot fix for this issue.
After you install the hot fix, you must set the environment variable TRUNCATE_BIGINT to YES to enable processing of BIGINT data types by the SAS/ACCESS Interface to Teradata engine.
Product Family | Product | System | SAS Release | |
Reported | Fixed* | |||
SAS System | SAS/ACCESS Interface to Teradata | Microsoft® Windows® for x64 | 9.2 TS2M2 | 9.2 TS2M3 |
Microsoft Windows Server 2003 Datacenter Edition | 9.2 TS2M2 | 9.2 TS2M3 | ||
Microsoft Windows Server 2003 Enterprise Edition | 9.2 TS2M2 | 9.2 TS2M3 | ||
Microsoft Windows Server 2003 Standard Edition | 9.2 TS2M2 | 9.2 TS2M3 | ||
Microsoft Windows Server 2003 for x64 | 9.2 TS2M2 | 9.2 TS2M3 | ||
Microsoft Windows Server 2008 | 9.2 TS2M2 | 9.2 TS2M3 | ||
Microsoft Windows Server 2008 for x64 | 9.2 TS2M2 | 9.2 TS2M3 | ||
Microsoft Windows XP Professional | 9.2 TS2M2 | 9.2 TS2M3 | ||
Windows 7 Enterprise 32 bit | 9.2 TS2M2 | 9.2 TS2M3 | ||
Windows 7 Enterprise x64 | 9.2 TS2M2 | 9.2 TS2M3 | ||
Windows 7 Home Premium 32 bit | 9.2 TS2M2 | 9.2 TS2M3 | ||
Windows 7 Home Premium x64 | 9.2 TS2M2 | 9.2 TS2M3 | ||
Windows 7 Professional 32 bit | 9.2 TS2M2 | 9.2 TS2M3 | ||
Windows 7 Professional x64 | 9.2 TS2M2 | 9.2 TS2M3 | ||
Windows 7 Ultimate 32 bit | 9.2 TS2M2 | 9.2 TS2M3 | ||
Windows 7 Ultimate x64 | 9.2 TS2M2 | 9.2 TS2M3 | ||
Windows Vista | 9.2 TS2M2 | 9.2 TS2M3 | ||
Windows Vista for x64 | 9.2 TS2M2 | 9.2 TS2M3 | ||
64-bit Enabled AIX | 9.2 TS2M2 | 9.2 TS2M3 | ||
64-bit Enabled HP-UX | 9.2 TS2M2 | 9.2 TS2M3 | ||
64-bit Enabled Solaris | 9.2 TS2M2 | 9.2 TS2M3 | ||
HP-UX IPF | 9.2 TS2M2 | 9.2 TS2M3 | ||
Linux | 9.2 TS2M2 | 9.2 TS2M3 | ||
Linux for x64 | 9.2 TS2M2 | 9.2 TS2M3 | ||
Solaris for x64 | 9.2 TS2M2 | 9.2 TS2M3 |
A fix for this issue for SAS/ACCESS Interface to Teradata 9.21_M1 is available at:
http://ftp.sas.com/techsup/download/hotfix/HF2/A98.html#39831Type: | Problem Note |
Priority: | high |
Topic: | Data Management ==> Data Sources ==> External Databases ==> Teradata |
Date Modified: | 2010-06-21 15:49:54 |
Date Created: | 2010-05-28 14:14:08 |