BookmarkSubscribeRSS Feed
madhu
Calcite | Level 5

Hi All,

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.

24 REPLIES 24
madhu
Calcite | Level 5

The instructions were very generic and I followed them. The task started running at the scheduled time, but the program did not execute.

art297
Opal | Level 21

The first line of the microsoft help page stated that you had to have been logged on as an Administrator.  Were you when you created the task?

madhu
Calcite | Level 5

Yes I am the administrator priviliges on the computer and I am running the task with highest priviliges.

madhu
Calcite | Level 5

This code might run once i follow the instructions in the link. However my main task here is to schedule this to happen every day automatically.

art297
Opal | Level 21

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

madhu
Calcite | Level 5

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.

art297
Opal | Level 21

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.

Mishka1
Fluorite | Level 6

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.

madhu
Calcite | Level 5

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'

Mishka1
Fluorite | Level 6

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

Good luck!

madhu
Calcite | Level 5

Thanks Art297 and Mishka. The program finally worked if I remove the Start\w command in bat file.

sunboyss
Calcite | Level 5


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 !

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

Health and Life Sciences Learning

 

Need courses to help you with SAS Life Sciences Analytics Framework, SAS Health Cohort Builder, or other topics? Check out the Health and Life Sciences learning path for all of the offerings.

LEARN MORE

Discussion stats
  • 24 replies
  • 20908 views
  • 2 likes
  • 7 in conversation