BookmarkSubscribeRSS Feed

How to run SAS Studio 5 program on a schedule?

Started ‎09-13-2019 by
Modified ‎09-13-2019 by
Views 7,442

Question

How to run SAS Studio 5 program on a schedule?

Answer

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.

1_cronprogram.png

2. Save a program, in this example I’ve used /My Folder/My Snippets

2_cronprogram_save_to_my_snippets.png

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

3_job_execution_new_definition.png

 

4_job_execution_definition.png

 

5. Select a newly created job definition and click “Edit”

5_edit_cronprogramdefinition.png

 

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;

6_cronprogramdefinition_save_and_submit.png

7. Go to Jobs inside SAS Job Execution, highlight a job definition and click “Schedule Job”

 

7_job_execution_schedule_a_job.png

8. Go to Scheduling inside SAS Environment Manager Jobs, highlight a job definition and click “Edit schedule”

 

8_Environment_Manager_Schedule_A_Job.png

9. Create a new trigger. I did create a trigger which will execute a program every 5 minutes

 

9_new_trigger.png

10. Save both trigger and schedule. If you did everything correctly, you will a clock icon, which means your program has been scheduled successfully.

 

10_job_scheduled.png

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.

 

11_SAS_Environment_Manager_Jobs_Monitoring.png

12. If your program producing output, you can retrieve it in SAS Job Execution -> Jobs -> right-click on the desired job -> Retrieve job output

 

12_job_execution_output.png

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.

Version history
Last update:
‎09-13-2019 10:54 AM
Updated by:
Contributors

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

Free course: Data Literacy Essentials

Data Literacy is for all, even absolute beginners. Jump on board with this free e-learning  and boost your career prospects.

Get Started

Article Tags