Access a permanent data set stored on a disk in SAS

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 stat '~/data';

DATA stat.new_grade;
 SET stat.grade;

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 (for example, 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.

If you have questions about using statistical and mathematical software at Indiana University, contact the UITS Research Applications and Deep Learning team.

This is document afdu in the Knowledge Base.
Last modified on 2023-11-07 16:06:13.