Training Schedule: Basic Data Manipulation
Training Schedule: Basic Data Manipulation
Training Schedule: Basic Data Manipulation
Introduction to SAS
Training schedule
Basic Data Manipulation (cont.)
Week 3: Chapters 5 & 6 (and 3.9 through 3.14)
Conditional processing
Subsetting and combining SAS datasets
Training schedule
Basic Data Manipulation (cont.)
Week 5: Chapters 9, 11, & 12 (and
10.13)
Training schedule
Basic Reporting
Week 6: Chapters 14 & 19
Training schedule
Basic Reporting (cont.)
Week 8: Chapter 15
Week 9: Chapter 18
Training schedule
Advanced Topics
Week 10: Chapter 26
Introduction to SQL
Training schedule
Advanced Topics (cont.)
Week 12: Chapter 25
Training schedule
Advanced Topics (cont.)
Week 14: Chapters 21, 22 & 23
The Leftovers!
Restructuring SAS datasets (PROC
Transpose)
Using advanced features of user-defined
formats and informats
Using advanced input techniques
Saving and storing macros
Explorer
Window:
See libraries
and SAS
datasets
Log:
Details about jobs youve
run, including error
messages
Enhanced Editor:
Where you write your SAS
code
Results tab:
List of
previously run
results
Output Window:
Basic view of results and
output
(Also known as Listing
Destination)
Run:
Submits your SAS code
(The Running Man)
DATA steps:
Read and write data,
manipulate data, perform
calculations, etc.
Every DATA step creates a new
dataset
Every SAS
program can
have
multiple
DATA and
PROC steps
PROC steps:
Produce reports, summarize data, sort
data,
create formats, generate graphs, etc. etc.
etc.
Global statements:
Remain in effect until changed by
another global statement or SAS
session ends
Examples:
Titles, Footnotes, Options, Macros,
Libname
Comment statements:
Ignored by SAS when code is run
Used to write comments to yourself or
others or
comment out code you dont want to
run
*comment statement;
or
/* comment statement */
Programming in SAS
DATA demographic
DATA demographic creates a dataset called
Demographic
Infile statement reads the text file with the data
Input statement tells SAS what to name the new variables.
$ sign after Gender indicates that this is a character
variable. The remaining variables are numeric.
DATA newdemo
DATA newdemo creates a dataset called newdemo
SET demographic references the previous dataset
demographic as the basis for the new dataset
BMI = creates a new variable called BMI that is
calculated as shown. This is called an assignment
statement.
Other notes
Step boundaries:
Each step is executed when a step
boundary is encountered
Explicit step boundary: RUN or
QUIT statement
Good SAS
programmer
s use
EXPLICIT
step
boundaries
Other notes
Referencing datasets:
Most procedures and DATA steps
reference an existing dataset
Explicit dataset reference: DATA=
or SET statement
Good SAS
programmer
s use
EXPLICIT
dataset
references
SAS Help
Technical papers
SAS User Groups
Websites
Books
Classes
http://www.sascommunity.org/wiki/
Learning_SAS_-_Resources_You_Cant_Live_Without
Popular Websites
www.google.com
Popular Websites
www.ats.ucla.edu/stat/
Popular Websites
sas
Explains
both the
stats and
the SAS
code
www.ats.ucla.edu/stat/
Popular Websites
sas
www.lexjansen.com
Popular Websites
Popular Websites
Sample datasets
SAS Datasets:
Permanent location of all SAS
Datasets