UMASS Department of:
Biostatistics and Epidemiology

SAS:The Statistical Analysis System
Basics
Combo
Desc Stats
Advanced
Index
SASHome
Intro
Data In
Data Out
Pretty
Cleaning
Documentation
Environs

Reading Data by Typing it Into the Computer.


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)

  • name the data set "dem1"

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;




Last Update: 9/15/98
Comments: Ed Stanek
Email:
stanek@schoolph.umass.edu
\ed\web\be691f\webready\sbint2.html