This section describes the LIBNAME statement that SAS/ACCESS Interface to Teradata supports. For general information about this feature, see LIBNAME Statement for Relational Databases.
Here is the LIBNAME statement syntax for accessing Teradata.
For general information about the LIBNAME statement that is not specific to SAS/ACCESS, see LIBNAME Statement in SAS Global Statements: Reference.
specifies any SAS name that serves as an alias to associate SAS with a database, schema, server, or group of tables and views.
teradataspecifies the SAS/ACCESS engine name for the Teradata interface.
provides connection information and controls 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 more information about LDAP, see Authentication Using LDAP.
is a required connection option that specifies a Teradata password. The password that you specify must be correct for your USER= value. If the password contains spaces or nonalphanumeric characters, you must enclose it in quotation marks. 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, use this password option to specify the authentication string or password.
is an optional connection option that specifies the account number that you want to charge for the Teradata session.
Alias: SERVER=
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.
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 specifies 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 specify a dbcname that resolves to the network address of the database server. SAS/ACCESS adds the specified dbcname to the logon string that it submits to Teradata. (Teradata documentation refers to this name as the tdpid component of the logon 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 that are specified for logon. 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.
dbccop1 10.25.20.34myservercop1
130.96.8.207xyzcop1
33.44.55.66 or xyzcop2 11.22.33.44To
support data parcels that are longer than 64K, the Teradata interface
queries the Teradata database to assess Alternate Parcel Header (APH)
extended-parcel sizes. In such cases, it needs the Teradata server
name (dbcname) as an entry
in the HOSTS file or NAMES database to successfully configure the
Teradata client for APH processing. The value of the SERVER= (TDPID=)
LIBNAME option must be the unqualified short name, not the fully qualified
IP name (for example, SERVER=foo rather than SERVER=foo.my.unx.com).
Alias: DB=
specifies an optional connection option that establishes a LIBNAME connection to the specified DATABASE= name. The database name that you specify becomes the default database. This option enables the user to directly access another database as the user’s default database, eliminating the need to qualify database objects. The user is actually logged in to the specified database. You must first set permissions to allow user access. If you do not specify DATABASE= in the LIBNAME statement, then the user’s default database is used. This usually is a database with the same name as the user name.
specifies an optional value that you can use to fully qualify objects in another database for SQL processing. Using the SCHEMA= option does not establish a physical connection to the specified schema.
specify how SAS processes DBMS objects. Some LIBNAME options can enhance performance, and others determine locking or naming behavior. The following table describes the LIBNAME options for SAS/ACCESS Interface to Teradata, with the applicable default values. This table also identifies LIBNAME options that are valid in the CONNECT statement in the SQL procedure. For more information, see LIBNAME Options for Relational Databases.
|
Option |
Default Value |
Valid in CONNECT |
|---|---|---|
|
none |
|
|
|
none |
● |
|
|
NO |
● |
|
|
none |
|
|
|
20% |
|
|
|
UNIQUE for network attached systems (UNIX and PC platforms) SHAREDREAD for channel-attached systems (z/OS) |
● |
|
|
none |
● |
|
|
1 |
● |
|
|
1000 (when inserting rows), 0 (when updating rows) |
|
|
|
none |
● |
|
|
none |
● |
|
|
none |
|
|
|
DBMS |
● |
|
|
NO |
|
|
|
none |
|
|
|
none |
|
|
|
NO |
|
|
|
NO |
● |
|
|
COMPAT |
|
|
|
none (no default value) |
|
|
|
NO |
● |
|
|
|
|
|
|
YES |
|
|
|
none |
|
|
|
NO |
● |
|
|
Default Teradata database for the libref |
● |
|
|
ANSI |
● |
|
|
NO |
● |
|
|
IN_CLAUSE |
|
|
|
NO |
● |
|
|
none |
|
|
|
YES |
|
|
|
YES |
|
|
|
none |
● |
|
|
● |
||
|
none |
● |
|
|
none |
● |
|
|
NO |
|
|
|
NO |
|
|
|
none |
|
|
|
none |
● |
|
|
6 |
● |
|
|
YES |
|
|
|
none |
|
|
|
none |
|
|
|
none |
|
|
|
CURRENT VALIDTIME for valid-time column; CURRENT TRANSACTIONTIME for transaction-time column |
● |
|
|
0 for FastLoad; 4 for FastExport and MultiLoad |
● |
|
|
YES |
● |
|
|
NO |
● |
|
|
4 |
● |
|
|
1 |
● |
|
|
NO |
● |
|
|
NO |
● |
|
|
● |
||
|
none |
● |
|
|
none |
● |
|
|
NO |
|