2. Navigating the SAS interface

SAS is a windows program, however a web based version, SAS Studio, can be accessed via programs such as Oracle VM VirtualBox for Mac users, or similar for Windows users.

There are three main windows: program editor window, log window, output window. A side panel with two windows can help you manage your files and output (explorer and results).

The program editor window

Programs can be opened, saved and edited within this window. There are two versions of this window: Program Editor and Enhanced Editor. The latter will colour code your command statements.

The log window

As you run(or execute) you data steps and procedures they will appear in the log window. Errors in your code will be highlighted in this window. SAS usually points out your mistakes or other issues with warning and error messages so that you can correct them:

 Note (blue text): information which does not indicate errors. They are usually informative to rule out any methodological errors in your programming. E.g. how many observations were read, and if there were any missing values

 Warning (green text): points out errors which SAS could correct itself. The execution was performed with these changes. Still you should check whether it was done properly. Example: misspelled keywords

 Error (red text): serious errors which SAS could not handle. The execution was stopped. These errors must be corrected by you. Example: forgotten semicolons, invalid options, misspelled variable names. etc

Especially if you are updating datasets, be aware that red errors mean NO update has occured!

Make a habit of checking the Log window after every execution. Even if SAS has accepted and executed your program, you may have made a mistake in your code.

The output window

When you open SAS the Output window contains you ‘printed’ output from the SAS procedures that you have run. When you run your first program, by default SAS will create a Results window that will show the printed output from your procedure in HTLM format. To change this preference so that your output is only sent to the Output window (the choice is yours) - click on the Tools button, select Options, then Preferences, the Results tab and in this box - remove the tick from Create HTML and tick Create listing.

It may be necessary (running out of memory) or convenient to clear the contents of the output and log windows. To clear the output window press the blank page button. It’s important to remember that you cannot edit a LOG file or an OUTPUT file in their windows. You can only read them (or delete them). To edit these files you will need to save/copy the contents, then open/paste in the SAS Editor or Word.

The results tab

This window displays a summary of your output and can help navigate your results.

There are some variations in the user interface between SAS and SAS Studio. If you are used the web based version SAS Studio, the following video is a good introductory guide: