Chapter Contents

Previous

Next

The DATA Step

The DATA step processes input data. In a DATA step, you can create a SAS data set, which can be a SAS data file or a SAS data view. The DATA step uses input from raw data, remote access, assignment statements, or SAS data sets. The DATA step can, for example, compute values, select specific input records for processing, and use conditional logic. The output from the DATA step can be of several types, such as a SAS data set or a report. You can also write data to the SAS log or to an external data file. For more information about DATA step processing, see "DATA Step Processing" in DATA Step Processing.


DATA Step Output

The output from the DATA step can be a SAS data set or an external file such as the program log, a report, or an external data file. You can also update an existing file in place, without creating a separate data set. Data must be in the form of a SAS data set to be processed by many SAS procedures. You can create the following types of DATA step output:
SAS log contains a list of processing messages and program errors. The SAS log is produced by default.
SAS data file is a SAS data set that contains two parts: a data portion and a data descriptor portion.
SAS data view is a SAS data set that uses descriptor information and data from other files. SAS data views allow you to dynamically combine data from various sources without using disk space to create a new data set. While a SAS data file actually contains data values, SAS data views contain only references to data stored elsewhere. SAS data views are of member type VIEW. In most cases, you can use a SAS data view as though it were a SAS data file.
External data file contains the results of DATA step processing. These files are data or text files. The data can be records that are formatted or free-formatted.
Report contains the results of DATA step processing. Although you usually generate a report by using a PROC step, you can generate the following two types of reports from the DATA step:
Listing file contains printed results of DATA step processing, and usually contains headers and page breaks.
HTML file contains results that you can display on the World Wide Web. This type of output is generated through the Output Delivery System (ODS). For complete information about ODS, see The Complete Guide to the SAS Output Delivery System.


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.