I'm now using SAS9.2, and I want to get my sas code run automatically to do some rountine work, is there any possible way? Thanks!
The handling of the Windows Task Planner is described here:
http://www.digitalcitizen.life/how-create-task-basic-task-wizard
I would advise to create a batch file first that runs SAS with your program.
It should contain a line with something like this:
"C:\Program Files\SAS\SASFoundation\9.2(32-bit)\sas.exe" -sysin insert_program_here.sas -log where_you_want_a_log.log
Test this batch file from the cmd window first to see if it works, then use the Task Planner to create a scheduled event that runs the batch file.
Mostly depends on your setup. If you have SAS on a server, that server will provide a scheduling tool.
What you need is a script (batch, whatever your system wants) that runs SAS in batch mode with the supplied program.
Enterprise Guide already provides a method to create a job for a project so that the Windows scheduler can run it.
Hi,KurtBremser
Thanks for your reply. I don't have SAS EG on my personal PC. I have SAS 9.2 BASE installed in my PC, and my system is WIN7. I wonder if I can use base SAS code to get the SAS file run automatically . If not, could you give a sample script that can get the job done? Thanks a lot.
The handling of the Windows Task Planner is described here:
http://www.digitalcitizen.life/how-create-task-basic-task-wizard
I would advise to create a batch file first that runs SAS with your program.
It should contain a line with something like this:
"C:\Program Files\SAS\SASFoundation\9.2(32-bit)\sas.exe" -sysin insert_program_here.sas -log where_you_want_a_log.log
Test this batch file from the cmd window first to see if it works, then use the Task Planner to create a scheduled event that runs the batch file.
BTW, you should take a look at your SAS install media. EG is usually included with Base SAS and works with a locally installed SAS without need for additional server processes (Metadata, Spawner).
This is a guide for SAS 8/Win2K.
I think it still applies, even if some windows/search paths may be different from your setup.
http://support.sas.com/techsup/technote/ts648.pdf
Hope it isn't important stuff it should do, doesn't sound too reliable to execute batch jobs on a client PC.
Hi, LinusH
Thanks for your reply, I help me a lot.
Linus,
since his "client PC" also holds the core SAS software, I guess it is of a workstation type and is supposed to run round the clock. I also guess that scheduling in this context isn't so much a production thing and time-critical, but more of a personal helper.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.