How to run SAS Studio 5 program on a schedule?
As you might know, SAS Studio 5 stores its data on SAS Drive. If you want to run a program, that was written in SAS Studio 5, on a schedule, you have to follow these steps.
1. First of all, you have to write a program. In my case, I did create a very simple program that prints the first ten observations from a standard SASHELP.CARS dataset.
2. Save a program, in this example I’ve used /My Folder/My Snippets
3. Open SAS Job Execution and go to /My Folder/My Snippets. SAS Job Execution URL will be http://viya.sas.com/SASJobExecution/
4. Click on a “New” button and create a job definition as shown below
5. Select a newly created job definition and click “Edit”
6. Paste the following code, click “Save” and “Submit”. You can get more information about FILENAME FILESRVC on this page. The code will be executed and you will see output if you have any.
filename job filesrvc folderpath='/Users/YOUR_ID/My Folder/My Snippets' filename='CronProgram.sas';
%include job / source;
7. Go to Jobs inside SAS Job Execution, highlight a job definition and click “Schedule Job”
8. Go to Scheduling inside SAS Environment Manager Jobs, highlight a job definition and click “Edit schedule”
9. Create a new trigger. I did create a trigger which will execute a program every 5 minutes
10. Save both trigger and schedule. If you did everything correctly, you will a clock icon, which means your program has been scheduled successfully.
11. If you would like to monitor job execution, go to SAS Environment Manager -> Jobs -> Monitoring. As you can see below, my program was executed two times before I disabled a trigger.
12. If your program producing output, you can retrieve it in SAS Job Execution -> Jobs -> right-click on the desired job -> Retrieve job output
Thanks for reading this and let me know if you have any questions. Here some useful information for you: SAS® Viya® 3.4 Administration Jobs.
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!
Data Literacy is for all, even absolute beginners. Jump on board with this free e-learning and boost your career prospects.