Introduction

You've learned about creating a SAS data set from raw data. However, you may often want to create a new data set from an existing SAS data set. To create the new data set, you can read a data set using the DATA step. As you read the data set, you can use all the programming features of the DATA step to manipulate your data.

Reading SAS data sets

This lesson shows you how to use the DATA step to read an existing SAS data set. When you create your new data set, you can choose variables, select observations based on one or more conditions, and assign values conditionally. You can also assign variable attributes such as formats and labels.

Note: You can also merge, concatenate, or interleave two or more data sets. For details, see the lesson



1 hour



In this lesson, you learn to

  • create a new data set from an existing data set
  • use BY groups to process observations
  • read observations by observation number
  • stop processing when necessary
  • explicitly write observations to output
  • detect the last observation in a data set
  • identify differences in DATA step processing for raw data and DATA step processing for existing data sets.

complete the following lessons:

  • .