Introduction to SAS [8-19]

h

Creating Multiple Observations

The majority of the SAS data sets contain multiple observations.

In order to create a data set that contains more than one observation, you need the Input and Datalines statements

Input and Datalines Statement

Example

Data Test;
    Input a b c;
    Datalines;
    1 3 4
    2 7 9
    12 444 123
    ;
Run;


(1) Input Statement

The Input statement lists the variables to be created.

In our example, the Input statement tells SAS to create three variables: a, b and c

(2) Datalines

Datalines statement signals SAS to begin reading the data on the next line.

Together with these statements, you can create a data set with multiple observations.

💪 Sign up for a free SASCrunch account now and keep track of your learning progress!

Exercise

Create a data set that contains the following variables:

Name the data set as SCORE

Need some help?

Get Hint

Get Solution