Pass Through in SAS
Teradata Teradata Discussion Forums Teradata.com Discussion Forum
Visit Teradata.com
Home       Guidelines    Member List
Welcome Guest ( Login | Register )
        


This online forum is for user-to-user discussions of Teradata products, and is not an official customer support channel for Teradata. If you require direct assistance, please contact Teradata support.


Pass Through in SAS Expand / Collapse
Author
Message
Posted 10/23/2007 11:41:21 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum 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?
Post #9367
Posted 10/24/2007 2:50:24 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum 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;
Post #9432
Posted 3/9/2008 11:00:58 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 3/24/2008 3:03:46 AM
Posts: 2, Visits: 15
Wow! it worked. Thanks Bobduell..
Post #10854
« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 0 ( 0 guests, 0 members, 0 anonymous members )
No members currently viewing this topic.


All times are GMT -5:00, Time now is 1:10am

Powered By InstantForum.NET v4.1.4 © 2008
Execution: 0.078. 7 queries. Compression Disabled.