Setting Up Your Environment
Prerequisites: Getting Set Up
SAS Studio is a browser-based editor for SAS programs.
The layout
- Navigation pane (left) — Server Files and Folders (your home folder), Libraries (every data set you can use, including SASHELP), Snippets (ready-made code), and Tasks (point-and-click analyses that generate code for you).
- Work area (right) — each program opens in a tab with three sub-tabs:
- CODE — where you type.
- LOG — SAS's messages about what it did.
- RESULTS — tables and graphs your program produced.
- OUTPUT DATA appears too when a step creates a data set.
Running code
Press F3 or click the Run button (the running-figure icon). To
run just part of a program, select those lines first. Save programs with
the .sas extension in your home folder.
Always read the log
The log is the most important habit in SAS. Every step writes messages to it, color-coded:
- NOTE (blue) — information, such as how many rows were read and written. Read these: they tell you whether the step did what you expected.
- WARNING (green) — something unusual happened, but SAS continued.
- ERROR (red) — the step failed.
A program can produce results and still have problems that only the log reveals — for example, a note that missing values were generated. SAS Studio shows a count of errors, warnings, and notes at the top of the LOG tab.
Handy settings
- Preferences (the menu at the top right) lets you change the font, turn on autocomplete, and choose whether results appear in HTML, PDF, or RTF.
- The Format code button on the editor toolbar tidies indentation.