Our tutorials reference a dataset called "sample" in many examples. If you'd like to download the sample dataset to work through the examples, choose one of the files below:
When you start SAS, five windows will be open in the SAS environment. The Explorer, Log, and Editor windows will be immediately visible, while the Results and Output windows will be hidden.
Like most Windows-based programs, SAS has a Menu Bar and Toolbar above the windows. Most options available on the Menu Bar and Toolbar are similar to other programs, but the options may be different depending on which window you have active within the SAS environment. Let’s briefly look at these windows and the purpose of each of them.
The Explorer window is where you can browse and view the content in your SAS libraries, or directories where SAS data is stored. The default icons that appear in your Explorer window may differ depending on the version of SAS you’re running.
The main icon you’ll want to note is the file cabinet icon for "Libraries". If you double-click on it, you will see icons that look like file cabinet drawers:
When you first open SAS, the six default libraries -- Maps, Mapsgfk, Mapssas, Sashelp, Sasuser, and Work -- are visible. If you define any other SAS libraries during your session, those will appear in this window as well. Clicking on any of these icons will open that library, where you can browse the data files stored in that library. Once a dataset has been referenced with a library name, it can be viewed via this window. Just locate the dataset and double-click on it. The data table will appear in the SAS environment.
Using libraries is an important part of working with data in SAS, so we recommend checking out our tutorial on SAS Libraries.
The Editor window is where you create and edit your SAS program. A program is a series of commands (or statements) that tell SAS what actions to do and how to do them. The default Editor window, called the Enhanced Editor, automatically recognizes special keywords in your program and uses color to highlight them. This will help you know if what you are typing conforms to SAS syntax rules. SAS also warns you if a statement is invalid or out of place by changing the text color to red. Note that if you don’t want your program to have color-coding, you can open a Program Editor window instead by going to the menu bar and clicking View > Program Editor.
The Log window is one of the most important tools you have to troubleshoot problems in SAS! This is where error messages and warnings appear that can help you troubleshoot when a program isn’t working.
When you first launch SAS, the Log window will show details about the version of SAS you have installed, the system it's running on, and what SAS products you have licensed. This information can be extremely useful for troubleshooting problems with SAS: not all SAS installations have the same features, so if you're trying to execute a procedure and are receiving messages like "procedure not found", this is where you'll want to look first.
As you use SAS, the Log window will report the success or failure of any SAS programs or code you execute. Specifically, the Log window will show each line of code that has been executed, how long it took to execute, and what the result was. If there is an error in your code (or if SAS encounters a problem while trying to run your code), it will report error messages or warnings in the Log window.
The Log window uses color-coded text to communicate issues. Notes appear in blue, Warnings appear in green, and Errors appear in red. Notes are generally benign messages that confirm that your code was successfully executed. Warnings indicate when SAS found potential issues with the data or task, but was still able to run the code. Errors appear when SAS can not execute the program statements you told it to run.
Always check your Log window every time you run a program or a piece of a program. This will ensure that you do not miss an Error, Warning, or Note.
The Output window displays the printable results of any analysis you submitted in your program. It is initially hidden behind the Log and Editor windows, but can be viewed by clicking on the tab at the bottom of the SAS environment. Text displayed in the Output window is not editable. You must copy and paste the text into a word processing program, or save the output file as a text file and open it in a word processing program in order to edit it.
Note: Prior to SAS version 9.3, output was written to the Output window as "plain text". As of SAS version 9.3, output is created as HTML files. Please see Changes to the default output in SAS 9.3 for more information about these changes, and for instructions on how to change this setting.
The Results window serves as a table of contents for all output you've created during the current SAS session. It allows you to quickly navigate through your output by clicking on the command that generated it.
The Results window is a tab within the Explorer window. You can access it by clicking on the Results tab at the bottom of the Explorer window.
Most options available on the Menu Bar and Toolbar are similar to other programs, but there are a few that are particular to SAS. Here are descriptions of the most common SAS-specific options in the toolbar:
Icon | Tooltip | Action |
---|---|---|
Submit | Executes any statements you've entered into the Editor window. (If you have highlighted lines of codes in the Editor window, clicking Submit will execute just those lines.) | |
Break | Interrupts SAS processing. Click when you want SAS to stop executing the statements you've submitted. | |
Help | Quick access to SAS Help and Documentation. |
Clicking on the SAS Help and Documentation icon will open a new window.
For new users, a good place to start is the Base SAS folder. You can also view an index of all topics or search for a particular topic.
What file types are typically associated with SAS?