|
Simple
Example
Data
|
Subject
|
ID Number
|
Age
|
Gender
|
|
Mary
|
1
|
16
|
F
|
|
Sam
|
2
|
18
|
M
|
|
Heather
|
3
|
17
|
F
|
|
Juan
|
4
|
18
|
M
|
To create a SAS Data set, we need
to:
|
Task
|
SAS
Statements
(SAS
Program)
|
|
|
DATA dem1;
|
- name the variables ("id
age and gender") in the
columns, and identify the
columns and character
variables (with a "$")
|
INPUT id age gender
$;
|
- tell SAS where to find the
data-
data follows the CARDS
statement
|
CARDS;
|
|
Give Data
|
1 16 F
|
|
|
2 18 M
|
|
|
3 17 F
|
|
|
4 18 M
|
- tell SAS the data have
ended
|
;
|
- tell SAS to execute the
previous step
|
RUN;
|
  
|