Execute SAS scripts at specific times from within SAS Enterprise Guide without user input (e.g. over night).
Working in a fast paced development environment, we needed a way to quickly scheduled jobs to run over night ready for the next morning. Following the usual process to get jobs added to a scheduler required too much time when code that was written in the afternoon needed to be scheduled to run that night. This solution was to write a script which ran jobs at specific times without user input which was under our control.
Please note, it is not recommended that this method be used as a replacement for a production environment scheduler.
Using the tools available the below code was written to solve this problem. Many iterations of this code have followed but the fundamental components have stayed the same. The basic principle is you add jobs to the code and specify what time you want them run, then you kick off the script within SAS Enterprise Guide (or Base SAS) and leave it to run. The script will loop through the jobs each day and run for as many days as you specify in the &rundays. Macro.
Below is the macro code which defines the scheduling logic.
The script creates a single log file for each day where all the logging messages are written to, this also means that if a job fails, jobs which follow will still be run (due to the use of proc printto). The script does not handle dependencies i.e. if job A fails then do not run job B.
As you have probably gathered, the way this script is run means that it needs to be run for a client machine which will need to remain powered on for the script to execute. Furthermore the user who runs the script will need all the applicable permissions needed to run the jobs.