Im going to try to answer all your questions, hopefully this clears it up.
SAS is located on my local machine. I do not remote in for my SAS sessions. I use BAT files that point to the SAS software and the program I want to run. Below is what the old BAT file text looks like:
ROBOCOPY U:\DataDump\ICECAP C:\Users\clevenge\Desktop\Grey\SAS_Batch\ICECAP\Batch_Programs\Data "C:\Program Files\SASHome\SASFoundation\9.4\sas.exe" -lrecl max -sysin "C:\Users\clevenge\Desktop\Grey\SAS_Batch\ICECAP\Batch_Programs\Icecap_Temp_Graphs.sas"
The call for the SAS.exe and program file stays the same but i have removed the Robocopy in the BAT and replaced it with this section of code in the program:
%if %sysfunc(getoption(sysin)) ne %str() %then %do;
%let fullname=%sysfunc(getoption(sysin));
%let Auto_path=%substr(&fullname,1,%length(&fullname)-%length(%scan(&fullname,-2,%str(\/.)).%scan(&fullname,-1,%str(\/.)))-1)\data ;
/*Location and File of Transpose SAS program Locally*/
%let Trans_path=C:\Users\clevenge\Desktop\Grey\Macro Transpose.sas;
x %unquote(%str(%'mkdir "&Auto_Path.\" %'));
X %unquote(%str(%'xcopy U:\DataDump\ICECAP "&Auto_Path.\" /S /K /Q %'));
%end;
Where it goes awry is at the lasts X statement is that block. If i double click the BAT file that calls SAS.exe and the program everything runs normally and works.
However, If i were to set the Task scheduler to run at 12:30 pm, go to the windows icon on my desktop and select "LOCK" and leave for lunch at 12:25 pm, I would return to find that the program ran but could not complete because the data was not copied from the U:/ server.
The only difference between these two is whether I have entered my password to my computer to bring up my windows profile. The old BAT file worked perfectly, but the desire to move to this way is based on the ability to move, dynamically named files to shared locations so i don't have to remember to do it manually every time the program runs.
X %unquote(%str(%'xcopy "C:\Users\clevenge\Desktop\Grey\SAS_Batch\ICECAP\Tempurature_log_graphs\Graphs_&Today.\Robert DSMB ICECAP TEMPERATURE LOG GRAPHS &Today..pdf" "U:\Projects\ICECAP\Programs\Greys_Code\Scheduled Programs\Tempurature Logs\" /q %'));
... View more