|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 3/24/2008 3:03:46 AM
Posts: 2,
Visits: 15
|
|
|
Anybody who knows how to do a pass through statement from SAS to Teradata?
|
|
|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 4/1/2008 2:49:57 PM
Posts: 6,
Visits: 44
|
|
It's very simple; use PROC SQL. For convenience sake, I create SAS macro variables "terauser" and "terapass" that contain my Teradata login ID and password. I put the macro definitions in my autoexec.sas program (which is read-only to my ID). That way, my code doesn't need to change whenever my password changes.
Here's a trivial example to create a SAS dataset containing the Teradata system date:
proc sql;
connect to teradata (user="&terauser" password="&terapass" mode=TERADATA);
create table TERADATA_DATE as
select *
from connection to teradata (
/* Teradata SQL goes here */
select current_date
);
quit;
The "from connection to teradata" structure is part of the FROM component of the SELECT statement and means to submit everything between the parentheses to Teradata.
To run a Teradata SQL statement that does not return a result (like CREATE TABLE or COLLECT STATISTICS), use the SAS "execute" statement:
proc sql;
connect to teradata (user="&terauser" password="&terapass" mode=TERADATA);
execute (
collect statistics on mydb.mytable index (myindex)
) by teradata;
quit;
|
|
|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 3/24/2008 3:03:46 AM
Posts: 2,
Visits: 15
|
|
|
Wow! it worked. Thanks Bobduell..
|
|
|
|