I have created a batch (.bat) file to run my SAS 9.4 program. When I manually run the batch file, the program runs perfectly fine. However, when I schedule the batch file to run using the windows task scheduler, the program doesn't run properly. It seems to get hung up when I start to use relative paths in my libname statements. Here is the piece of my SAS code that is having trouble when run as a scheduled task: data _NULL_;
%let Prog = %sysfunc(getoption(sysin));
run;
proc sql noprint;
select tranwrd(xpath,"\&prog","") into :source
from dictionary.extfiles
where index(xpath,"&prog") > 0;
quit;
X "cd &source";
libname Derived "..\Datasets"; When I run the SAS program or the batch file manually, the relative paths work great. But for some reason when the batch file is run as a scheduled task, I get a note in the log saying "Library DERIVED does not exist." Does anyone know why the relative paths aren't working when run as a scheduled task? I'd really prefer not to have to change every relative path to absolute paths if possible.
... View more