Introduction to the SAS System - PowerPoint PPT Presentation

1 / 23
About This Presentation
Title:

Introduction to the SAS System

Description:

Multiple program submissions can (and likely will) be made in a given session. ... A SAS data library is a directory on your computer where SAS data sets are ... – PowerPoint PPT presentation

Number of Views:25
Avg rating:3.0/5.0
Slides: 24
Provided by: BLU54
Category:

less

Transcript and Presenter's Notes

Title: Introduction to the SAS System


1
Introduction to the SAS System
  • STT 305

2
The SAS Environment
3
The SAS Environment
The Log Notes, Warnings and Errors
The Explorer Navigation of SAS Libraries
The SAS Environment has five main windows
The Program Editor
4
The SAS Environment
The Results Window Index of current output
The Output Window
5
The SAS Environment
To run a program
Select submit from the run menu
Click on the running man
Or press F8 on your keyboard
6
Managing Results
The Results Window provides bookmarks for all
output
7
Managing Results
  • Multiple program submissions can (and likely
    will) be made in a given session.
  • In fact, blocks of code can be submitted
    individually.
  • Submissions are cumulative in both the log and
    output windows.

8
Managing Results
Typing clear into the command box
Since log and output results are cumulative,
clearing windows is often necessary. You can
clear a window by
9
Managing Results
Selecting Clear All from the edit menu
10
Managing Results
You can also right click in the window to bring
up menu options
11
Assigning Hotkeys
  • The function keys and other key combinations can
    be mapped to certain commands.
  • To bring up the keys window type keys in the
    command box or press F9.
  • Any legal SAS commands can be used, multiple
    commands are separated by semicolons.

12
Assigning Hotkeys
I have F12 mapped to a series of commands that
clear the log and output windows and return me
to the program editor.
13
Other Stuff to Know
The Break button
The working directory where SAS looks for
input and directs output when a path is
not specified
14
Other Stuff to Know
The help menu
15
Some Basics
The libname statement assigns a SAS data library
The library name (libref)
The path to where data sets are stored or will be
stored
16
Some Basics
  • A SAS data library is a directory on your
    computer where SAS data sets are stored or will
    be stored.
  • A library reference name (libref) can be assigned
    using the libname statement
  • libname libref path-specification
  • The libref must be 8 characters or less contain
    only letters, numbers or underscores and begin
    with a letter.

17
Some Basics
  • The path specification can be of two types
  • full--beginning with a drive letter or computer
    name.
  • partiala path assumed to be an extension of the
    working directory.
  • Three data libraries are created by default
  • worka temporary library, all of its contents are
    deleted when the SAS session is ended.
  • sasusera library designed to give you a
    permanent storage location for datasets without
    having to assign your own library.
  • sashelpcontains data sets for examples shown in
    the SAS online help (plus some other stuff).

18
Some Basics
One option youll need to specify is which
data set to use
Datasets have two- level names in
SAS libref.filename
Analyses are typically done with procedures (proc
for short)
19
Data Set Names
  • In any SAS session, SAS data sets have two level
    names
  • libref.filename
  • If the libref is omitted, the work library is
    taken as default.

Library Name
Data Set Name
20
Viewing data sets
The Libraries icon allows you to view
all available libraries
Each library is displayed as a file drawer.
Opening any will show all data sets in it.
Double clicking on a data set icon will open it
in table view mode.
21
Viewing data sets
By default, variable labels are displayed as the
column headings.
In the data set, each column is a variable, while
each row is an observation
22
Viewing data sets
To change this, select Column Names from the View
menu.
These are what you will reference when writing
your SAS code.
23
A few other things
  • The editor uses color coding
  • Bright blue Commands and options
  • Purple Quoted text
  • This color Numbers and formats
  • Red Bad
  • (usually)
  • All SAS statements end with a semicolon.
Write a Comment
User Comments (0)
About PowerShow.com