Using SAS

Author

Doug Hemken

Published

February 15, 2024

There are several different ways you can work with SAS in the SSCC.

If you are learning to use SAS or beginning to develop code for a project, you probably want to work interactively so that you can write, submit, and troubleshoot small blocks of SAS code.

If you already have your code mostly worked out, if your code takes a long time to run, or if your code would benefit from more CPUs or more RAM, you probably want to submit batch jobs.

We think it is perfectly normal to work both ways! Well written code will work either in either mode.

You can work with an interactive interface or in batch mode using either a Windows computer (Winstat) or a Linux computer (Linstat). If your program requires a lot of computing power (CPUs or RAM), you can submit batch jobs to Slurm.

Besides computing power, the main difference between Windows and Linux is how you write file references (paths).

Windows or Linux?

Windows for Typical SAS jobs

If you are developing your code and your data do not require too much time to process, it is appropriate to use SAS on a Windows computer, either Winstat or a lab computer.

Logging on to Winstat

Linux for Big SAS jobs

For SAS jobs that can take advantage of multiple CPUs, more memory, or that take a long time to run, use SAS on a Linux computer - Linstat or Slurm.

Logging on to Linstat

Multiple Cores

If you are using

  • proc means or proc sort with large data sets,
  • proc glm or proc mixed with many variables,
  • or any of the hp procs (see the SAS documentation)

this could be a good task for Linux. See Setting CPUCOUNT.

More Memory

If your data set is 1 GB or more, or if you will be reading data sets many times, you can also configure SAS to store data in computer memory (RAM). A little extra set up will greatly speed up your work. Use Linstat or Slurm. See Loading Data in Memory.

Interactive or Batch?

Use SAS interactively to develop your code, and for small tasks. Use SAS in batch mode for time-consuming tasks, or where you do not need to check the results of each line of code. SAS can be run in either mode on both Windows and Linux computers.

Interactive Interfaces for Development

If you anticipate working interactively in both Windows and Linux environments, use SAS Studio.

SAS Studio

This runs in a web browser, and works the same way on both Windows and Linux computers. Very similar to “SAS” (see below), but more consistent across operating systems.

  • Winstat: from the Windows Start menu find SAS > SAS Studio.

    Launching SAS Studio on Winstat

  • Linstat: first log on to Winstat. Then from the Windows Start menu find Linstat > Linstat SAS Studio. You need your user name and password to log on.

You can also bookmark this in your own web browser. However, your computer must be on the SSCC network (see VPN) to use this.

  https://ssc.wisc.edu/sas-studio

SAS (a.k.a. SAS Display Manager, or DMS)

A dedicated application that is similar on both Windows and Linux computers. It has more of an old-school look, but on Windows it makes it easy to open files in a project folder.

  • Winstat: from the Windows Start menu find SAS > SAS 9.4 (either English or Unicode).
  • Linstat: (Not recommended for Linux)

You’ll need to be familiar with the very old-school Program Editor, capturing ODS listing output, and logging off by typing endsas in the Command Box. Use SAS Studio Server, instead - see above.

To use this interface on Linstat, first log on to Linstat via X-Win32. Then at the linux command prompt type

linstat> sas &

Jupyterlab

Jupyter notebooks allow you to put text and code in the same document - useful for writing tasks that involve showing both code and output. Runs in a web browser.

  • On Winstat (Not recommended.), you would have to install the SAS kernel yourself.

  • On Linstat, first log on to Linstat with any terminal software. Then at the linux command prompt type

    linstat> sscc-jupyterlab

    Copy and paste the URL into a web browser, select the SAS kernel, and being your document. See our guide to Jupyterlab.

    Launching Jupyterlab, using Linstat from Winstat

Batch Interfaces for Final, Big Runs

Winstat

Once logged on to Winstat, open a File Explorer, and navigate to your .sas file. Right-click on the file, and pick Batch Submit with SAS 9.4 from the context menu. Your output file will have the same file name, with an .lst file extension, and will be found in the same folder.

Linstat

Once logged on to Linstat, navigate (cd) to the folder with your .sas file. At the linux command prompt issue a command like

linstat> sas mysasfile.sas &

Your output file will have the same file name, with an .lst file extension, and will be found in the same folder.