10-24-2011 10:00 AM
I am trying to schedule a SAS task to run automatically every day, using the task scheduler. I was able to do this comfortably in windows XP.The first step in task scheduler in XP is to locate the SAS software and there by telling the task scheduler where to execute the program. How ever the setuo is completely changed in windows 7. Can any one help me in doing this. thanks in advance.
10-24-2011 01:05 PM
Sorry, I hadn't read the page prior to posting. The following one looks like it may actually provide some things you may not have considered: http://www.lexjansen.com/pharmasug/2011/ad/pharmasug-2011-ad11.pdf
10-26-2011 10:27 AM
I used the folowing on a bat file and executed it through task sccheduler -
start/w C:\Program Files (x86)\SAS\SAS 9.1\sas.exe –sysin \\Program location\BATCH18140.sas
However it gave me an error saying windows cannot find C:\program. Please correct the name and run again. Can some one let me know where I ma going wrong.
10-26-2011 10:33 AM
If you look at the paper I referred to, it shows the following example:
start/w C:\”Program Files”\SAS\v9\sas.exe –sysin \\SAS code location\test.sas -NOSPLASH -PRINT \\SAS output
location\test.lst -LOG \\SAS log location\test.log
I presume, like the above example, that "Program Files" has to be encased in double quotes because it contains a space.
10-26-2011 11:26 AM
Art297 is right,
To be on the safe side, you can enclose the entire path:
"C:\Program Files\SAS\SAS 9.1\sas.exe"
So the whole thing might look like:
"C:\Program Files\SAS\SAS 9.1\sas.exe" -icon -noterminal -nosplash -noxwait -noxsync -CONFIG "C:\Program Files\SAS\SAS 9.1\SASV9.CFG" -SYSIN "C:\Documents and Settings\My Documents\ScheduledProgram.sas" -LOG "C:\Documents and Settings\My Documents\ScheduledProgram.log"
Note that when using this method, your log will be overwritten each day.
10-26-2011 11:59 AM
start/w "C:\Program Files (x86)\SAS\SAS 9.1\sas.exe" -CONFIG "C:\Program Files (x86)\SAS\SAS 9.1\nls\en\SASV9.CFG" -SYSIN "\\USEWRNAS01\Biometrics$\sasprgms\BATCH.sas" -LOG "\\USEWRNAS01\Biometrics$\sasprgms\BATCH.log"
I am using the above , however it gives me an error windows cannot find '-CONFIG'. Please make sure the name is typed correctly. I am not sure if I am missing something here. If I use other options such as -icon, it gives same error saying - windows cannot find '-ICON'
10-26-2011 12:23 PM
I'm not sure what the issue is, but a few things to try might include:
-remove the "start/w" from your code. I don't have it in mine and it works.
-make sure there are no carriage returns in your code
-make sure you are using the right config file. Do a search for *.cfg and see if anything else returns
07-17-2013 05:45 AM
Following the problem which Madhu had, i am also facing the same problem however the task scheduler in windows 7 works fine to run the sas program at a schedule time but just opens the program without running it and which i would like to run at the same time.
thanks in advance !