Exparementing with SAS

Posts: 23

Exparementing with SAS

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.

Posts: 9,326

Re: Exparementing with SAS

Posted in reply to IgawaKei29
Perhaps this info from Tech Support will get you started with what you want to do:


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:

Good luck!
Occasional Contributor
Posts: 8

Re: Exparementing with SAS

Posted in reply to IgawaKei29
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,
Posts: 23

Re: Exparementing with SAS

Posted in reply to John_d_WiseGuy
Thank you very much this has helped out a lot in the past few weeks. I appreciate your assistance.
Ask a Question
Discussion stats
  • 3 replies
  • 3 in conversation