SAS/ACCESS Interface to Teradata |
Overview |
This section describes the LIBNAME statement that SAS/ACCESS Interface to Teradata supports and includes examples. For a complete description of this feature, see Overview of the LIBNAME Statement for Relational Databases.
Here is the LIBNAME statement syntax for accessing Teradata.
LIBNAME libref teradata <connection-options> <LIBNAME-options>; |
Arguments |
specifies any SAS name that serves as an alias to associate SAS with a database, schema, server, or group of tables and views.
specifies the SAS/ACCESS engine name for the Teradata interface.
provide connection information and control how SAS manages the timing and concurrence of the connection to the DBMS. Here are the connection options for the Teradata interface.
specifies a required connection option that specifies a Teradata user name. If the name contains blanks or national characters, enclose it in quotation marks. For LDAP authentication with either a NULL or single realm, append only the @LDAP token to the Teradata user name. In this case, no realm name is needed. If you append a realm name, the LDAP authentication server ignores it and authentication proceeds. However, if multiple realms exist, you must append the realm name to the @LDAP token. In this case, an LDAP server must already be configured to accept authentication requests from the Teradata server.
specifies a required connection option that specifies a Teradata password. The password that you specify must be correct for your USER= value. If you do not want to enter your Teradata password in clear text on this statement, see PROC PWENCODE in the Base SAS Procedures Guide for a method for encoding it. For LDAP authentication, you use this password option to specify the authentication string or password. If the authentication string or password includes an embedded @ symbol, then a backslash (\) is required and it must precede the @ symbol. See Teradata LIBNAME Statement Examples.
is an optional connection option that specifies the account number that you want to charge for the Teradata session.
specifies a required connection option if you run more than one Teradata server. TDPID= operates differently for network-attached and channel-attached systems, as described below. You can substitute SERVER= for TDPID= in all circumstances.
For NETWORK-ATTACHED systems (PC and UNIX), dbcname specifies an entry in your (client) HOSTS file that provides an IP address for a database server connection.
By default, SAS/ACCESS connects to the Teradata server that corresponds to the dbccop1 entry in your HOSTS file. When you run only one Teradata server and your HOSTS file defines the dbccop1 entry correctly, you do not need to specify TDPID=.
However, if you run more than one Teradata server, you must use the TDPID= option to specifying a dbcname of eight characters or less. SAS/ACCESS adds the specified dbcname to the login string that it submits to Teradata. (Teradata documentation refers to this name as the tdpid component of the login string.)
After SAS/ACCESS submits a dbcname to Teradata, Teradata searches your HOSTS file for all entries that begin with the same dbcname. For Teradata to recognize the HOSTS file entry, the dbcname suffix must be COPx (x is a number). If there is only one entry that matches the dbcname, x must be 1. If there are multiple entries for the dbcname, x must begin with 1 and increment sequentially for each related entry. (See the example HOSTS file entries below.)
When there are multiple, matching entries for a dbcname in your HOSTS file, Teradata does simple load balancing by selecting one of the Teradata servers specified for login. Teradata distributes your queries across these servers so that it can return your results as fast as possible.
The TDPID= examples below assume that your HOSTS file contains these dbcname entries and IP addresses.
The TDPID= option is not specified, establishing a login to the Teradata server that runs at 10.25.20.34.
You specify a login to the Teradata server that runs at 130.96.8.207.
You specify a login to a Teradata server that runs at 11.22.33.44 or to a Teradata server that runs at 33.44.55.66.
For CHANNEL-ATTACHED systems (z/OS), TDPID= specifies the subsystem name. This name must be TDPx, where x can be 0-9, A-Z (not case sensitive), or $, # or @. If there is only one Teradata server, and your z/OS system administrator has set up the HSISPB and HSHSPB modules, you do not need to specify TDPID=. For further information, see your Teradata TDPID documentation for z/OS.
specifies an optional connection option that specifies the name of the Teradata database that you want to access, enabling you to view or modify a different user's Teradata DBMS tables or views, if you have the required privileges. (For example, to read another user's tables, you must have the Teradata privilege SELECT for that user's tables.) If you do not specify DATABASE=, the libref points to your default Teradata database, which is often named the same as your user name. If the database value that you specify contains spaces or nonalphanumeric characters, you must enclose it in quotation marks.
specifies an optional connection option that specifies the database name to use to qualify any database objects that the LIBNAME can reference.
define how SAS processes DBMS objects. Some LIBNAME options can enhance performance, while others determine locking or naming behavior. The following table describes the LIBNAME options for SAS/ACCESS Interface to Teradata, with the applicable default values. For more detail about these options, see LIBNAME Options for Relational Databases.
Teradata LIBNAME Statement Examples |
These examples show how to make the proper connection by using the USER= and PASSWORD= connection options. Teradata requires these options, and you must use them together.
This example shows how to connect to a single or NULL realm.
libname x teradata user="johndoe@LDAP" password="johndoeworld";
Here is an example of how to make the connection to a specific realm where multiple realms are configured.
libname x teradata user="johndoe@LDAPjsrealm" password="johndoeworld";
Here is an example of a configuration with a single or NULL realm that contains a password with an imbedded @ symbol. The password must contain a required backslash (\), which must precede the embedded @ symbol.
libname x teradata user="johndoe@LDAP" password="johndoe\@world"
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.