BookmarkSubscribeRSS Feed
IgawaKei29
Quartz | Level 8
I was really curious, I am new to the SAS programming, but an idea came to mind, and I wanted to see if it was possible to implement. I wanted to be able to set up a timer using SAS, or another program that works with SAS to submit batch jobs to sas when I am not at the computer. For example, I write 2 - 3 programs, and I know I am going to be gone for a week, I would do the following:

*Monday April 9, 2007 at 8:00am* What I would want to happen would be: SAS would take the file from the path I supplied and then run the batch file during that time.

I am no way an expert with SAS, but I do have a lot of ideas, I was just curious if this was even possible to do.

Thanks
3 REPLIES 3
Cynthia_sas
SAS Super FREQ
Hi:
Perhaps this info from Tech Support will get you started with what you want to do:
VSE:
http://support.sas.com/faq/005/FAQ00560.html

Windows:
http://support.sas.com/techsup/technote/ts648/ts648.pdf
http://support.sas.com/techsup/unotes/SN/007/007769.html

If you need more help, you should consider contacting Tech Support, because they can find out your exact operating system configuration and SAS setup and help you with the correct method for doing batch submits. To find out how to contact Tech Support, refer to:
http://support.sas.com/techsup/contact/index.html

Good luck!
cynthia
John_d_WiseGuy
Fluorite | Level 6
Yes, what you want to do is quite simple, but the technique is operating system dependent, as Cynthia pointed out. I don't think you are using VSE (heh!) so I am going to assume that you are running on Windows XP.

Just write your SAS code in a text file and save as foo.sas. Then run it one time from a windows command prompt. Start -> Run -> cmd.exe

> "C:\Program Files\sas\SAS 9.1\sas.exe" c:\projects\stuff\foo.sas

You can tweak this further by naming the sas log file and output with additional command line options. But this is the basic gist. And make sure that the SAS program is the first argument after the SAS executable. Options should follow. There are other incantations, but this way works.

Now go to the Windows control panel and schedule it. Double click on "Scheduled Tasks" then double click "Add a Scheduled Task" and follow the nifty dialogs. Select the sas.exe executable as the application that you want to schedule. When you get to the final dialog in the scheduler check the box that says "open advanced properties...". On the advanced dialog you can edit the "Run:" box to insert the path to your SAS file and any other parameters that you want. Remember to insert your SAS program just after sas.exe. There will probably be a -CONFIG option on the command line - just leave it.

Change the "Start in" folder to match the folder where your SAS program resides. This will get your SAS log to come out along side the program.

Finally, when you save the advanced dialog it will create a schedule task icon that just says "sas". You probably want to right click and rename the task to something more specific like "My Foo Program".

This works well, but you may get annoyed by the SAS splash screen that comes up when the program runs and you are logged on to the machine. Simply double click the scheduled task, edit the SAS command and tack on the -nosplash option to supress the splash screen.

Good luck,
John
IgawaKei29
Quartz | Level 8
Thank you very much this has helped out a lot in the past few weeks. I appreciate your assistance.

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
  • 3 replies
  • 1163 views
  • 0 likes
  • 3 in conversation