I have a SQL statement that I wish to automate using SAS EG (9.4). The following statement has been tested in Teradata SQL Assistant and works.
select * from TD.DATA where date='2015-06-01'
Now I wish to push this through a proc SQL pass through, and feed the date to the SQL program, like so....
proc sql;
connect to teradata as tera(user=&tera_user password="&tera_pwd" tdpid=terap);
create table MYDATA as
select * from connection to tera
(
select * from TD.DATA where date='2015-06-01'
);
disconnect from tera;
quit;
The above code has been tested and produces the exact same output as the previous SQL statement. However, what I really want is to do something like this:
%let input_date='2015-06-01';
proc sql;
connect to teradata as tera(user=&tera_user password="&tera_pwd" tdpid=terap);
create table MYDATA as
select * from connection to tera
(
select * from TD.DATA where date=&input_date.
);
disconnect from tera;
quit;
I have tried various combinations of quotations and different date formats....what am I missing here? Thanks.