How to Connect Teradata Using SAS in SQL?
Last Updated : 08 Feb, 2023
SAS is a popular statistical software that provides a powerful suite of tools for data management, analytics, and reporting. In this blog post, we will show you how to connect to Teradata using SAS in SQL. Teradata is a high-performance, relational database management system that is widely used for data warehousing and business intelligence applications.
Install the Teradata ODBC Driver
The first step to connecting to Teradata using SAS is to install the Teradata ODBC driver. This driver provides a bridge between SAS and Teradata, allowing you to access Teradata data from SAS. You can download the Teradata ODBC driver from the Teradata website. Follow the instructions on the website to install the driver on your computer.
Create a System Data Source Name (DSN)
Once the Teradata ODBC driver is installed, you need to create a System Data Source Name (DSN). A DSN is a database connection profile that contains all the information SAS needs to connect to a Teradata database. To create a DSN, follow these steps:
- Go to Start > Control Panel > Administrative Tools > Data Sources (ODBC).
- Click the System DSN tab.
- Click the Add button to create a new DSN.
- Select the Teradata ODBC Driver and click Finish.
- In the Teradata ODBC Driver Setup window, enter a name for the DSN in the Data Source Name field.
- Enter the Teradata database server name or IP address in the Host field.
- Enter your Teradata username and password in the User ID and Password fields.
- Click OK to save the DSN.
Connect to Teradata in SAS
With the Teradata ODBC driver installed and the DSN created, you are now ready to connect to Teradata in SAS. To do this, follow these steps:
1. Launch SAS and open a new program.
2. Type the following code to connect to Teradata using the ODBC connection.
libname tera odbc datasrc=tera_dsn;
Replace "tera_dsn" with the name of the DSN you created.
1. Run the code by clicking the Run button or pressing F9. SAS will now connect to the Teradata database and assign it the name "tera".
Query Teradata Data in SAS
With the connection to Teradata established, you can now query Teradata data in SAS. To do this, simply use the SAS SQL procedure to issue SQL statements against the Teradata database. For example, to query the "customers" table in Teradata, you would use the following code:
proc sql;
select * from tera.customers;
quit;
This code uses the SAS SQL procedure to query the "customers" table in the Teradata database and return the results to SAS.
In conclusion, connecting to Teradata using SAS in SQL is a straightforward process that requires a few simple steps. With the Teradata ODBC driver installed and a DSN created, you can use SAS to query Teradata data and perform data analysis, reporting, and more. Whether you are a data analyst, data scientist, or business intelligence professional, Teradata, and SAS provide a powerful combination for managing and analyzing large amounts of data.
Similar Reads
How to Create Volatile Table in Teradata? Volatile tables are as same as simple tables but with a small difference i.e. they are volatile in nature. Like a simple table, the volatile table is also formed by the user and can only be used until the user is logged into. Once the user is logged off or disconnects, the Teradata manager automatic
2 min read
How to create SQL table using DBI library in R DBI library in R programming is used for interacting with different types of database systems such as MySQL for different types of professional work like data analysis using R language. We can easily connect to the database, run queries and retrieve results from the database in the R environment wit
3 min read
How to Connect R to SQL Server With RODBC R programming language is used for statistical computing. In this article, we will learn how to connect an SQL server with RODBC. What is DBMS?DBMS refers to Database Management System. It is a software for storing and retrieving the data. There are various types of DBMS they are. Hierarchical Datab
8 min read
How to Get the Type of Columns in SQL In SQL, the types of columns in a database table play a fundamental role in data management and query execution. Each column is designed to store specific types of data, such as numbers, text, dates, or binary data. Understanding these column types is essential for effective database design, query o
4 min read
How to Move a Table from SAS to Teradata SQL Assistant? Organizations looking to optimize their analytical talents need to be capable of moving facts among structures without difficulty inside the facts-centric world these days. Data migration from SAS, a pinnacle analytics platform, to Teradata SQL Assistant, a powerful device for Teradata database cont
4 min read