Indiana University
University Information Technology Services
  
What are archived documents?
Login>>
Login

Login is for authorized groups (e.g., UITS, OVPIT, and TCC) that need access to specialized Knowledge Base documents. Otherwise, simply use the Knowledge Base without logging in.

Close

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 stat '~/data'; DATA stat.new_grade; SET stat.grade; ... RUN;

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.

This is document afdu in domain all.
Last modified on January 24, 2011.

Comments/Questions/Corrections

Use this form to offer suggestions, corrections, and additions to the Knowledge Base. We welcome your input!

If you are affiliated with Indiana University and would like assistance with a specific computing problem, please use the Ask a Consultant form, or contact your campus Support Center.

Contact Information

Note: We will reply to your comment at this address. If your message concerns a problem receiving email, please enter an alternate email address.