Skip to Main Content

SAS Tutorials: Intro to the SAS Environment

Part 1: The SAS Environment

SAS is a command-driven program used for statistical analysis. Because of this, there is a steep learning curve for new users, especially those new to programming. This part of the tutorial will familiarize you with basics of the SAS environment.

Part 2: Data Creation and Import

Before you can do any data manipulation and analysis, you need to have access to a SAS dataset file in your current session. You can do that in a number of ways. This tutorial will start off with a discussion about SAS Libraries and then discuss how to import or create SAS datasets.

Part 3: Working with Variables

Now that you have a SAS dataset that you can work with, let’s talk about what you can do with your variables. Much of this tutorial will cover data management standards and practices that, when followed, will make the rest of your work in SAS a lot easier. This tutorial will cover variable formats and labeling, missing values, manipulating variables, and calculating variables.

Changes to the default output in SAS 9.3

SAS produces high-quality graphics and formatting using its Output Delivery System (ODS). While ODS output is attractive, it requires a large amount of computing power. In SAS 9.2 and earlier, ODS was turned off by default, and had to be specifically enabled and disabled with a set of commands. In SAS 9.3, ODS is turned on by default. Because ODS can sometimes cause older computers to run more slowly, you may wish to disable ODS until you have a need to use it.

Additionally, our tutorials were produced using SAS 9.3, but all of our screencaps show our results going to the Output window. This was the default method of display in earlier versions of SAS. In SAS 9.3, the default option is to produce the output as an HTML file, and not send any text to the Output window. One advantage of using the HTML output is that copying-and-pasting the results into a word processing program is much less error prone. However, you may want to change this setting in your copy of SAS so that it is easier to compare your results to those in the tutorials. (Additionally, the majority of SAS tutorials online still use the Output window to display results.) 

You can make changes to both of these settings by doing the following:

1. From the drop-down menus, select Tools > Options > Preferences.

2. In the Preferences window, click on the Results tab.

  • To disable the results being saved as an HTML file, un-check the box next to Create HTML.
  • To turn off ODS Graphics, uncheck the box next to Use ODS Graphics.
  • To have the results printed in the Output window, click on the drop-down menu next to View results using, and select Internal Browser. Alternatively, if you choose to save your output as an HTML file, you can use this drop-down menu to specify which browser to view the HTML document in.