Previous Page | Next Page

Introduction to DATA Step Processing

Review of SAS Tools


Statements

DATA <libref.>SAS-data-set;

tells SAS to begin creating a SAS data set. If you omit the libref, then SAS creates a temporary SAS data set. (SAS attaches the libref WORK for its internal processing.) If you give a previously defined libref as the first level of the name, then SAS stores the data set permanently in the library referenced by the libref. A SAS program or a portion of a program that begins with a DATA statement and ends with a RUN statement, another DATA statement, or a PROC statement is called a DATA step.

FILENAME fileref 'your-input-or-output-file';

associates a fileref with an external file. Enclose the name of the external file in quotation marks.

INFILE fileref|'your-input-file';

identifies an external file to be read by an INPUT statement. Specify a fileref that has been assigned with a FILENAME statement or with an appropriate operating environment command, or specify the actual name of the external file.

INPUT variable <$>;

reads raw data using list input. At least one blank must occur between any two data values. The $ denotes a character variable.

INPUT variable<$>column-range;

reads raw data that is aligned in columns. The $ denotes a character variable.

INPUT variable informat;

reads raw data using formatted input. An informat supplies special instructions for reading the data.

LIBNAME libref 'your-SAS-data-library';

associates a libref with a SAS data library. Enclose the name of the library in quotation marks. SAS locates a permanent SAS data set by matching the libref in a two-level SAS data set name with the library associated with that libref in a LIBNAME statement. The rules for creating a SAS data library depend on your operating environment.

Previous Page | Next Page | Top of Page