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

Popular posts from this blog

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -

javascript - oscilloscope of speaker input stops rendering after a few seconds -