In SAS, how do I access a permanent data set stored on a disk?
Use the LIBNAME statement to access SAS permanent data
sets. Depending on releases, the extension of a SAS data set can be
.ssd (version 6.04 for DOS/Windows), .ssd01
(version 6 for Unix), .sd2 (version 6.08 to 6.12),
.ssd04 (DEC machines), .sd7 (version 7 or
8), or .sas7bdat (version 8 and later).
Suppose you want to read a SAS data set named
grade.sas7bdat in the ~/data directory. The
following example shows how to retrieve a SAS data set:
LIBNAME associates a SAS library reference (libref)
with a directory. In this example, stat is the libref
that aliases ~/data. In Windows, an alias consists of
drive and directory names (e.g., c:\data\). The
SET statement reads existing SAS data sets
specified. This example tells SAS to read a SAS data set
grade.sas7bdat from the library stat;
perform some data manipulation; and then write the result into
new_grade.sas7bdat in ~/data, which is
associated with the library stat.
For more about statistical and mathematical software, email the UITS Stat/Math Center, visit the center's web page, or phone 812-855-4724 (IUB) or 317-278-4740 (IUPUI). The center is located in Bloomington at 410 N. Park Avenue, and is open for consultation by appointment Monday-Friday 9am-5pm.
Last modified on January 24, 2011.







