Page tree



Back to Knowledge Base

How to Create/Delete a Scheduled Job in SAS Viya

The following procedure outlines steps to schedule/unschedule jobs, delete a job, and view the properties of jobs. Jobs can be scheduled to run either immediately, at a specific time (daily, yearly), or in response to a trigger.

Note: Background jobs run on a separate workspace server, and as a result the log is not displayed “live” in the same main Log window as running code directly within SAS Studio using the Run icon. Additionally, any libraries that are created by your background program will not appear in the Libraries section of the SAS Studio.

Using SAS Studio to Schedule a Job

Jobs can also be scheduled using SAS Studio.
1. Click on the following link to access SAS Viya: https://qnetanalytics-viya.cms.gov/
2. Go to SAS Studio.
3. Right click on the code to be scheduled as a job and select Schedule as a job.

4. To create a New Trigger, enter Name, Frequency, Interval, Time, Time zone, Start date, and End type. Click Save.


Note: If you want your job to only run once, then change the End type to After number of times and select 1 for the number of times.

5. Job can be viewed in SAS Environment Manager.

Using Environment Manager to Schedule a Job

  1. Click on the following link to access SAS Viya: https://qnetanalytics-viya.cms.gov/SASDrive/
  2. Go to Manage Environment.

3. Click the Jobs icon on the left panel.

4. Click the Scheduling tab.

5. Click the New drop-down menu and select → Job.

6. Enter name of the New job, then click the Browse icon.

7. Locate the SAS file the job will run. Select the job and click OK

8. Once again, click OK to save the job.


9. Right click on the job name and select Schedule.


10. Click the plus sign to add a new trigger.


11. To create a New Trigger, enter Name, Frequency, Interval, Time, Time zone, Start date, and End type. Click Save.

12. Once again, click Save.

Note: Prior to saving, additional triggers can be created.


Note: Once the job is complete, the entire log file is written to your folder of choice. The output folders can be changed in Options > Preferences > Background Submit.


If the code is running too long in background mode and encountering errors, then steps can be added manually throughout the SAS code to stop the program from running once the conditions are met (e.g. if _ERROR_ = 1 then abort return; to stop the SAS session). Once the SAS code stops running, the SAS log can then be opened in full.

Deleting a Job

1. Click on the following link to access SAS Viya: https://qnetanalytics-viya.cms.gov/
2. Go to the list of Jobs in SAS Environment Manager.

3. Right click on the job you wish to delete and click Delete.


4. Click Yes, when prompted to confirm that you want to delete the job.

View the Properties of Jobs

1. Click on the following link to access SAS Viya: https://qnetanalytics-viya.cms.gov/
2. Go to the list of Jobs in SAS Environment Manager.


3. Right click on the job name and select Properties.