sql - Convert date into varchar with sas -
i hope can assist.
when run code:
libname odbc ### user='abc' password='****' dsn='bleh' schema='dbo'; %let date=%sysfunc(intnx(day,%sysfunc(today()),-1,b),yymmddd10.); %put &date.; run;
it works!
but if run call execute error – reads sql – yet date in sql varchar:
data _null_; set odbc.sqltablename; if ((date= &date.) , (datecomplete ne .))then call execute("%include 'path';"); run; datecomplete=jun 10 2015 1:54pm _error_=1 _n_=1
i looking way convert date.
so reads today()-1
(technically yesterday’s date)
your appreciated!!!
shouldn't using single quotes instead of double quotes? don't want macro executed before data step ends?
call execute("%include 'path';");
try:
call execute('%include "path";');
Comments
Post a Comment