O'Reilly logo

SAS Certification Prep Guide: Base Programming for SAS 9, Third Edition by SAS Institute

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Writing a DATA Step Program

Naming the Data Set

The DATA statement indicates the beginning of the DATA step and names the SAS data set to be created.
Naming the Data Set
To do this...
Use this SAS statement...
Example
Reference a SAS library
LIBNAME statement
libname libref 'SAS-data-library';
Reference an external file
FILENAME statement
filename tests 'c:\users\tmill.dat';
Name a SAS data set
DATA statement
data clinic.stress;
General form, basic DATA statement:
DATA SAS-data-set-1 <...SAS-data-set-n>;
where SAS-data-set names (in the format libref.filename) the data set or data sets to be created.
Remember that the SAS data set name is a two-level name. For example, the two-level name Clinic.Admit ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required