This document provides a basic introduction to the SAS system and the
handling of data through the Data Step. No previous SAS
experience is assumed. Users will need to have a licensed SAS Base
product or the free SAS University version installed to run the
examples. Further information may also be found through the SAS Forums and
SAS Blog
posts. A useful introductory text is The Little SAS Book: A Primer.
SAS is a system of data analytic tools encompassing data management,
statistical analysis, graphics, reporting, and publication. SAS can be
run on many different operating systems and through various user
interfaces. This document will focus on running SAS in a command line
framework in a Windows environment, although the basic SAS information
here will translate across operating systems and interfaces. For users
of Apple Mac systems, SAS can be run through either the SAS University
installation mentioned above, or through a Windows SAS version installed
on a virtual OS package such as Parallels Desktop (This requires a copy of Windows
as well). This introduction does NOT cover SAS JMP, which is a separate
point and click product for similar SAS analytical tools.
When starting a SAS session, the user will be presented with several
windows. In the default configuration, two overlapping windows on the
left hand side are called Results and Explorer. In the
demonstrations below, these windows are closed for better clarity and
they will accessed separately as needed. The remaining windows represent
the three basic components of a SAS session: An Editor, a Log window,
and a Listing or Output window. The Editor is where SAS commands
(programs) will be written and run. The Log window will provide a
history of each program as it runs. This is useful for identifying
errors, warnings, and general information about the results of the
program being run. The Output window will provide a text version of any
printed output from the program, such as analysis results, data
printouts, etc. In more recent versions of SAS, this window has become
somewhat redundant as a newer output presentation format is now
available. These newer and cleaner looking outputs will automatically
open up in a new window called Results Viewer when a program is
run. By default, these results are produced in HTML, which can be viewed
in the default SAS browser or any Web browser set by the user.
I find that reorganizing the SAS windows from their default positions
and sizes is more productive. I prefer to close the Results and Explorer
windows, and to make the Editor window the largest and the Log and
Listing windows smaller and not overlapping. This allows me to easily
see the code I am writing and watch the Log and Listing windows as
needed. Each window can be accessed from the labeled tabs at the bottom
of the screen.