SAS

About the service

The SAS Teaching and Research service in Faculty of Health is run on servers located in the faculty.

Who can use the service?

All Faculty of Health, students and staff have access to the Faculty of Health SAS service upon request. Students from other faculties who are enrolled in Faculty of Health courses requiring SAS should have their course instructor contact Health Computing and request access for the term.

How do I use the service?

  1.  To access SAS, open the following location in a web browser: https://ahs-sas-edu.uwaterloo.ca/SASStudio.
Screen capture of SAS address entered in browser window
  1. Log in with your 8-character WatIAM/Quest/Email userid and password - no nexus\ prefix or @uwaterloo.ca suffix
Screen capture of SAS login box
  1. While we’ve had success with a wide variety of browsers, the officially supported browsers are:
  • Microsoft Edge
  • Mozilla Firefox 21+
  • Google Chrome 27+
  • Apple Safari 6.0+ (on Apple OS X)
  1. If you are connecting from off-campus, you will need to use the campus VPN service to connect to the campus and then access the Faculty of Health SAS service using your browser and the address https://ahs-sas-edu.uwaterloo.ca/SASStudio.

Where are my files stored?

  • Your files are stored centrally on the server with each user having a dedicated storage area. The full network path to your data is: \\ahs-sas-appserv.nexus.uwaterloo.ca\sasusers$\userid (where userid is your  8-character logon id). Note: this can often be shortened to just "\\ahs-sas-appserv\sasusers$\userid"
  • If you have existing files on your PC or Mac, you can upload them to the server using the SAS Studio web interface. There is an annoyingly low 10MB file size limit for files uploaded through the SAS interface. If you run into that limit, see: Get around SAS server 10MB file upload limit.
  • If you have SAS files on servers elsewhere on campus (e.g. Research server space), you can reference those files from within SAS Studio by entering the server path in your SAS code (e.g. \\ahsfile\researchdata$).
  • To view your code and data stored elsewhere on the network, you can create a Folder shortcut in SAS to that location (you just need to know the full path (e.g. \\ahsfile\researchdata$\):
    1. Right-click on the “Folder Shortcuts”  folder and choose New – Folder Shortcut

    2. In the resulting popup window:

    • Give it a name (we recommend NOT having any spaces in the name)

    • Set the folder type as SAS Server Folder

    • Enter the path to your data in the Directory field (e.g. \\ahsfile\researchdata$\).

    • Click Save

Screenshot of New Folder Shortcut menu

Why should I use this service instead of running SAS locally?

  • The biggest benefit of using the service is that you can get at your data and programs with only a network connection and a browser.
  • Data storage on the server is backed up at three intervals:
    • hourly (kept for 48 hours)
    • daily (kept for 14 days)
    • weekly (kept for 17 weeks)

Are there cases where the SAS server is not a good choice?

  • If you want or need to access your data offline (without an internet connection) you will need to have SAS installed locally on your computer.
  • There are some SAS products that are not licensed to run on the SAS server and would need to be installed and run locally. You can still use a local install with network stored data (see next point).
  • If you are working with Protected data, the SAS server is not an appropriate choice as the infrastructure has not been audited or approved for use by Public Works Canada.

How do I use SAS installed locally (on a lab or personal computer) with data on the server?

  • You will need to ensure that your data are stored on network server (not local hard drives or USB storage drives) and that your SAS coding uses the network location address. For example (with userid fflintst): libname cat "\\ahs-sas-appserv\sasusers$\fflintst\studydata2016\";
Screen capture of sample code showing path

How do I run R code in my SAS program?

To run R code inside your SAS program, enclose the R code segment between the "submit" and "endsubmit" statements :

submit / R;
  >>> R code goes here
endsubmit;

A couple of things to note:

  1. You should set your R working directory to the full network path where your files are stored.  
  2. In order to graph, you will need to use the png or pdf functions in R to generate files (in your current working directory). 

Here is a code sample you can try (but you need to edit the path in the R code setwd function).

See SAS documentation: Calling R Packages from PROC IML

Where do I go for help?

  • Health Computing can provide assistance if you are having difficulty logging in to the service.
  • If you need assistance with SAS programming, you should contact your course TA or instructor.
  • SAS offers free tutorials and some free e-Learning courses that can help you get up and running.
  • LinkedIn Learning has beginner, intermediate and advanced online courses on using SAS.
  • There is extensive online help within SAS Studio (click on the question mark at the top right of the SAS Studio window). 
Screen capture of SAS Help logo in browser