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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

New Learning Events in April

 

Join us for two new fee-based courses: Administrative Healthcare Data and SAS via Live Web Monday-Thursday, April 24-27 from 1:00 to 4:30 PM ET each day. And Administrative Healthcare Data and SAS: Hands-On Programming Workshop via Live Web on Friday, April 28 from 9:00 AM to 5:00 PM ET.

LEARN MORE

Discussion stats
  • 3 replies
  • 969 views
  • 0 likes
  • 3 in conversation