Help using Base SAS procedures

Schedule to run a SAS program

Reply
N/A
Posts: 0

Schedule to run a SAS program

Hey,

Do you guys know how to schedule to run a SAS program? For eg: say I want a particular code to run at Sunday morning 10:00 AM. How do I do that...?

Regards,
Shalini
Super Contributor
Super Contributor
Posts: 3,174

Re: Schedule to run a SAS program

Posted in reply to deleted_user
What OS platform? There are several technical reference papers on the SAS support http://support.sas.com/ website that discuss this topic for various OS environments.

Scott Barry
SBBWorks, Inc.
N/A
Posts: 0

Re: Schedule to run a SAS program

Posted in reply to deleted_user
Hi,

Traduce :

Tu peux créer une tâche planifiée en cliquant sur :

démarrer => panneau de configuration => tâche planifiée => création d'une tâche planifiée

Je ne sais pas si ton PC est conçu pareil...

Bye
Trusted Advisor
Posts: 2,115

Re: Schedule to run a SAS program

Posted in reply to deleted_user
Depends on your platform.

In Unix, use the AT command for a one-off schedule or the CRON tool for a repeating schedule.

In Windows, use the Windows Scheduler (available from the control panel).

In both, you have to know the syntax to run a SAS job in batch from the command line. Many Unix admins have written local scripts so batch jobs are easy to set up. In Windows, you have to put the options in yourself, so I usually develop the script in a Windows batch file (.bat extension) and then point the scheduler to the batch file.

My mainframe use is too rusty to give you pointers, beyond that it can be done there too.
Trusted Advisor
Posts: 2,115

Re: Schedule to run a SAS program

Posted in reply to deleted_user
Shalini,

One other note. If you are using Windows and don't see the "Scheduled Tasks" in the Control Panel, that means that your network admins have disabled it and you'll need to contact them to get it back.

Doc
Super Contributor
Posts: 474

Re: Schedule to run a SAS program

Posted in reply to deleted_user
Hello.

As previously said, adding the task to the system scheduler would be the simplest and safest way.

But, if you wish to run your SAS program from a workstation and lets say, its a one time run only, I guess you could prepare a "special" datastep at the beginning of the program that will wait until the desired hour.

Something like this:

data _null_;
do until(datetime() gt '19APR2009 10:00:00'dt); /* check date/time */
call sleep(10,60); /* wait 10x60 seconds = 10mins until next check */
end;
run;

/* your code, here */

Greetings from Portugal.

Daniel Santos at www.cgd.pt
Respected Advisor
Posts: 3,799

Re: Schedule to run a SAS program

Posted in reply to DanielSantos
Try wakeup for a more direct solution

[pre]
data _null_;
rc = wakeup('08:47't);
run;
[/pre]
N/A
Posts: 0

Re: Schedule to run a SAS program

Posted in reply to data_null__
So if I include the date and the time... this is how it should be right ?

**************************************************
data _null_;
rc = wakeup('20APR2009 08:47:00'dt);
run;
**************************************************
Super Contributor
Super Contributor
Posts: 3,174

Re: Schedule to run a SAS program

Posted in reply to deleted_user
Yes.

Scott Barry
SBBWorks, Inc.
Super Contributor
Super Contributor
Posts: 3,174

Re: Schedule to run a SAS program

However, again, you never replied with OS information - this function is not implemented on the IBM z/OS MVS (mainframe) SAS environment - so it's OS-platform dependent.

Scott Barry
SBBWorks, Inc.
Ask a Question
Discussion stats
  • 9 replies
  • 202 views
  • 0 likes
  • 5 in conversation