Reading a Single Data Set

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 small data set containing all the men in the group who are older than fifty.
To create the data set, you must first reference the library in which admit is stored and then the library in which you want to store the males data set. Then you write a DATA step to read your data and create a new data set.
General form, basic DATA step for reading a single data set:
DATA SAS-data-set;
SET SAS-data-set;
<more SAS statements>
RUN;
where
  • SAS-data-set in the DATA statement is the name (libref.filename) of the SAS data set to be created
  • SAS-data-set in ...

Get SAS Certification Prep Guide: Base Programming for SAS 9, Third 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.