Skip to content
Tutorials Center
My learning

Topics

Lesson 2 of 37 ยท Getting Started

SAS Interfaces: Studio, Enterprise Guide and Batch

A guided tour of the ways to run SAS code: SAS Studio in the browser, Enterprise Guide, the classic windowing environment, and batch mode with .log and .lst files.

The SAS language is the same everywhere, but you can reach it through several programs. Which one you use depends on your employer and your task. This lesson describes each interface so you know what you are looking at on your first day. SAS cannot run on this site, so there are no screenshots here: the descriptions name the menus and panes you will find, and the stand-in at the end models one batch-mode rule.

SAS Studio

SAS Studio runs in a web browser and connects to a SAS server. It is the interface of SAS OnDemand for Academics and of SAS Viya. The main areas are:

  • Navigation pane (left). Tabs such as Server Files and Folders, Tasks and Utilities, Snippets and Libraries. The Libraries tab shows every library and its data sets, which is the fastest way to check what exists.
  • Work area (centre). Tabs for your programs. A Code tab holds the editor, with buttons to run the program (a running figure icon) and to save it.
  • Results area (below or beside the code). Tabs named Log, Results and Output Data. After you run a program you check the Log first, then the Results.

You can also build a program visually from Tasks: choose a task such as a summary or a chart, assign variables to roles, and SAS Studio writes the code for you. Reading the generated code is a good way to learn syntax.

SAS Enterprise Guide

Enterprise Guide is a Windows desktop client that connects to SAS servers. Its signature feature is the process flow: a diagram of data sets, programs and tasks linked by arrows, so that a whole project can be re-run and shared as one file. You can write code in a Program node or use point-and-click Tasks. Many analysts like it because every result is stored with the project.

The classic windowing environment (Display Manager)

The older desktop SAS, sometimes called Display Manager, has separate windows:

Window Purpose
Editor (Program Editor) Where you type code
Log Messages about what SAS did
Output Text output from procedures
Results and Explorer A tree of results; browse libraries and data sets

You submit code with the Run menu or the running-man toolbar button. You can still meet this interface in older training material and on some company machines.

Batch mode

Production jobs usually do not use an interface at all. The program is a plain text file with the extension .sas, and SAS is started from the command line or a scheduler, which runs the file and exits. Conceptually:

TEXT
sas myjob.sas

The exact command and options depend on your operating system and installation. In a default batch run SAS writes the messages to a log file with the same base name (myjob.log) and, if the program produces listing output, an output file (myjob.lst). Batch mode is how overnight reports and regulatory programs are executed, and the log is how you check them afterwards.

flowchart LR
    P["myjob.sas<br/>program file"] --> S["SAS session"]
    S --> L["myjob.log<br/>messages"]
    S --> O["myjob.lst / HTML / PDF<br/>results"]
    S --> D["Data sets<br/>in libraries"]

Figure: what a batch run produces.

What happens when you click Run

Regardless of the interface, the same thing happens:

  1. The program text goes to the SAS session.
  2. SAS reads one step at a time. A step is compiled and executed when SAS reaches its boundary (a run; or quit; statement, or the beginning of the next step).
  3. Messages go to the log. Output goes to the results area. Data sets are written to libraries.

A SAS session also remembers things: the temporary WORK library keeps the data sets you created until you close the session, so you can run a program in pieces. That is convenient and also a source of confusion: a program may only work because of a data set left from an earlier run. Run the whole program from a fresh session before you trust it.

Good habit: after every run, read the log from the top. Output that looks right can still hide warnings. The Log and Common Errors shows what to look for.

Choosing an interface

You are... Likely choice
Learning on your own SAS OnDemand for Academics (SAS Studio)
An analyst who likes visual projects Enterprise Guide
Running scheduled production jobs Batch mode
On a Viya platform SAS Studio
Python Python stand-in: which files does a batch run create?

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Which SAS Studio tab should you check first after running a program?

    The Log lists notes, warnings and errors. Results can look fine while the log shows a problem.
  2. 2. What is the signature feature of Enterprise Guide?

    A process flow links the nodes of a project so it can be re-run and shared.
  3. 3. A batch run of daily.sas writes its messages to which file by default?

    The log has the program's base name with the .log extension.
  4. 4. Why should you run a program from a fresh session before trusting it?

    The WORK library survives between runs in a session, so a program can depend on leftovers.

Summary

  • SAS Studio is browser-based, Enterprise Guide is a Windows client with process flows, and Display Manager is the classic windowed tool.
  • Batch mode runs a .sas file without an interface and writes a .log file (and a listing if there is one).
  • Always check the Log, then the Results.
  • WORK data persists during a session, so test the full program in a clean session.

Next: Program Structure: Steps, Statements and Comments