SAS/ACCESS Interface to Teradata |
Teradata Conventions |
For general information about this feature, see SAS Names and Support for DBMS Names.
You can use these conventions to name such Teradata objects as include tables, views, columns, indexes, and macros.
A name must begin with a letter unless you enclose it in double quotation marks.
A name can contain letters (A to Z), numbers from 0 to 9, underscore (_), dollar sign ($), and the number or pound sign (#). A name in double quotation marks can contain any characters except double quotation marks.
A name, even when enclosed in double quotation marks, is not case sensitive. For example, CUSTOMER and Customer are the same.
The name must be unique between objects, so a view and table in the same database cannot have an identical name.
SAS Naming Conventions |
Use these conventions when naming a SAS object:
A name must begin with a letter (A to Z) or an underscore (_).
A name can contain letters (A to Z), numbers from 0 to 9, and an underscore (_).
Names are not case sensitive. For example, CUSTOMER and Customer are the same.
Naming Objects to Meet Teradata and SAS Conventions |
To easily share objects between SAS and the DBMS, create names that meet both SAS and Teradata naming conventions:
Accessing Teradata Objects That Do Not Meet SAS Naming Conventions |
The following SAS/ACCESS code examples can help you access Teradata objects (existing Teradata DBMS tables and columns) that have names that do not follow SAS naming conventions.
libname unusual teradata user=testuser password=testpass; proc sql dquote=ansi; create view myview as select * from unusual."More names"; proc print data=myview;run;
SAS/ACCESS automatically converts Teradata column names that are not valid for SAS, mapping such characters to underscores. It also appends numeric suffixes to identical names to ensure that column names are unique.
create table unusual_names( Name$ char(20), Name# char(20), "Other strange name" char(20))
In this example SAS/ACCESS converts the spaces found in the Teradata column name, OTHER STRANGE NAME, to Other_strange_name. After the automatic conversion, SAS programs can then reference the table as usual.
libname unusual teradata user=testuser password=testpass; proc print data=unusual.unusual_names; run;
Name_ Name_0 Other_strange_name
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.