Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Include Page
Data Nav_T&O
Data Nav_T&O


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 Open 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.

Image RemovedSchedule a job optionImage Added

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

Save option under New TriggerImage AddedImage Removed

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

5. Job can be viewed in SAS Environment Manager.

Scheduling tabImage Modified

Using Environment Manager to Schedule a Job

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

Image RemovedManage environment optionImage Added

3. Click the Jobs icon on the left panel.

Image RemovedJobs iconImage Added

4. Click the Scheduling tab.

Image RemovedScheduling tabImage Added

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

Image RemovedJobs under New drop-down menuImage Added

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

Image RemovedBrowse iconImage Added

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

Image RemovedOk optionImage Added

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

Image RemovedOkay option under New JobImage Added


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

Image RemovedSchedule option under JobsImage Added


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

Image RemovedPlus sign to add a New TriggerImage Added


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

Image RemovedSave option under New TriggerImage Added

12. Once again, click Click Save.

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

Image RemovedSave buttonImage Added


Note: Once the job is complete, the entire log file is written to your a user's 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/Open SAS Viya.

2. Go to the list of Jobs in SAS Environment Manager.

Image RemovedImage Added

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

Image RemovedImage Added


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

View the Properties of Jobs

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

Image RemovedImage Added


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

Image AddedImage Removed


Content by Label
showLabelsfalse
max5
spacesDATA
showSpacefalse
sortmodified
reversetrue
typepage
cqllabel in ("sas","work","folder","viya") and type = "page" and space = "DATA"
labelssas viya work folder


Page properties
hiddentrue


Related issues




HTML
<style>#title-text {
		display:none !important;
	}
.aui-navgroup-primary {  
                font-size: 1.25em;  
                font-weight:  bold;  
    }  
.page-metadata-modification-info {
		display:none !important;
	}
</style>