Reading a Single Data Set to Create Another
The
data set Sasuser.Admit contains health information about patients
in a clinic, their activity level, height, and weight. Suppose you
want to create a subset of the data. Specifically, you want to create
a small data set containing data about all the men in the group who
are older than 50.
To create the data set, you must first reference the
library in which Sasuser.Admit is stored. Then you must specify the
name of the library in which you want to store the Males data set.
Finally, you write a DATA step to read your data and create a new
data set.
Syntax, DATA step for
reading a single data set:
DATA SAS-data-set;
SET SAS-data-set;
<...more
SAS statements...>
RUN;
|
Get SAS Certification Prep Guide, 4th Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.