Chapter 27
SAS Data Sets
Definition of a SAS Data Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 601
Descriptor Information for a SAS Data Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 602
Data Set Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 604
Where to Use Data Set Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 604
How and When SAS Data Set Names Are Assigned . . . . . . . . . . . . . . . . . . . . . . . 604
Parts of a Data Set Name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 604
Two-level SAS Data Set Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 605
One-level SAS Data Set Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 605
Data Set Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 606
Special SAS Data Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 607
Null Data Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 607
Default Data Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 607
Automatic Naming Convention . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 607
Sorted Data Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 608
The Sort Indicator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 608
How SAS Uses the Sort Indicator to Improve Performance . . . . . . . . . . . . . . . . . 613
Validating That a Data Set Is Sorted . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 613
Tools for Managing Data Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 614
Viewing and Editing SAS Data Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 614
Definition of a SAS Data Set
A SAS data set is a SAS file stored in a SAS library that SAS creates and processes. A
SAS data set contains data values that are organized as a table of observations (rows)
and variables (columns) that can be processed by SAS software. A SAS data set also
contains descriptor information such as the data types and lengths of the variables, as
well as which engine was used to create the data.
A SAS data set can be one of the following:
SAS data file
contains both the data and the descriptor information. SAS data files have a member
type of DATA. For specific information, see Chapter 28, “SAS Data Files,” on page
615.
601

Get SAS 9.4 Language Reference, 6th 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.