2GETTING DATA INTO SAS®

Before you can perform any analysis, you must have data. SAS contains powerful tools you can use to enter, import, and manage your data. This chapter introduces the most commonly used methods for getting data into SAS. Additional techniques are covered in Chapter 3.

The main way to enter and manipulate data in SAS is by using the SAS DATA step. This DATA step creates a specially formatted type of file referred to as a “SAS data set” or “SAS data file.” A SAS data set contains the raw data plus other information. It contains variable names, how data values are read and interpreted, how values are displayed in output, labels associated with the variable names, and other information.

Entering and manipulating data are the primary topics of the following several chapters. In the initial SAS examples, you may have noted that the programs begin with the keyword DATA, followed by lines of code defining the data for analysis. As noted in Chapter 1, this is called the DATA step. Within the DATA step, data are manipulated, cleaned, and otherwise prepared for analysis. Depending on how carefully the data have been collected and entered, this process can be quick and simple or long and detailed. Either way, the DATA step is ...

Get SAS Essentials: Mastering SAS for Data Analytics, 2nd 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.