logo Getting Started with SAS Main menuGlossaryBackNext


You may often want to create a new SAS data set from an existing SAS data set. In Create and run SAS programs, you saw examples of DATA steps that read existing data sets using a SET statement. Reading a SAS data set in a DATA step is simpler than reading raw data because the work of describing and converting the data has already been done.

Also, when you use existing SAS data sets or subsets created from SAS data sets, you can make more efficient use of computer resources than if you use raw data or if you are working with large data sets. Reading fewer variables means that SAS creates a smaller program data vector, and reading fewer observations means that fewer iterations of the DATA step occur.

You can read from one or more SAS data sets and combine and modify data in different ways. For example, you can

  • combine two or more input data sets to create one output data set
  • merge data from two or more input data sets that share a common variable
  • update a master file based on transaction records.

In the simplest case, you read data from a single SAS data set:

Reading SAS data sets

As the primary tools for reading, combining, and modifying SAS data sets, you can use four statements: SET, MERGE, MODIFY, and UPDATE. To process the data and create an output data set, you can use additional SAS programming statements in your DATA step.

This task focuses on reading a single SAS data set using the SET statement.

Main menuGlossaryBackNext