SAS Basics
This document covers the most common uses of SAS at USC:- SAS programming for data management,
- Statistical procedures,
- Graphics,
- Reporting and
- Using the Output Delivery System (ODS) for producing HTML, pdf or rtf files.
SAS can be used as far more than just a statistical package. SAS comes with its own programming language, a macro language, an enormous library of statistical procedures and a great deal more.
For additional information on these topics that is not covered in this documentation, or to learn about other SAS features and functions, please check our SAS recommended sites page. Starting SAS When you open SAS, the default view has five windows.
The three window options in the larger window on the right are the Output window, Log window and Program Editor window.
- The Output window, shown in the example above, displays the output from a SAS statistical or other procedure. In this example, a PROC CONTENTS procedure provides a complete description of the dataset, including number of observations, names, types and labels of variables.
- The second window that can be shown, the LOG window, displays system messages regarding the operation of the SAS program. For example, the LOG window can display the number of variables in a dataset created, the amount of time required to process the programming statements, and most importantly, any notes and ERROR statements. SAS uses color coding to distinguish the various notes and messages; with the normal system messages in blue, notes in green and errors in red, preceded by the word ERROR in capital letters. You should get in the habit of always reading your SAS log.
- The third window is one where you will spend a lot of your time. This is the Editor window. Here is where you will write your SAS code.
The two windows on the left are the Results window and the Explorer window. To switch back and forth between the two, click the tab at the bottom of the page. The selected window will show in the left pane.
- The Results window is essentially a Table of Contents for your output. In the example above, there is only one entry because there is only one procedure that has been run. If the user had run seven or eight procedures, each producing output, e.g., a frequency distribution, a correlation matrix, an entry for each of these would be listed as a line in the results window. Clicking the desired result will bring that output up in the output window.
- The Explorer window, the other window option on the left, shows the libraries available to the user, and the datasets within each library. These are explained further in the section on Opening and Editing SAS datasets.
Last updated:
February 24, 2010