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 create a permanent SAS data file?

A SAS data file is a type of SAS-formatted data set that stores data values and descriptor information in an external file. To create a SAS data file, you must define a SAS data library (an alias of a collection of one or more SAS data sets referenced and stored as a unit in SAS) using the LIBNAME statement.

As an example, to create a SAS data file from a raw data file datafile.dat on a Unix system (e.g., Quarry), you would enter:

LIBNAME misc '~/work'; DATA misc.job1; INFILE datafile.dat; INPUT var1 var2 var3; RUN;

LIBNAME aliases the library reference (libref) misc to the physical space (directory) ~/work. Be aware that misc is a logical reference and thus does not exist in a physical storage unit. If you use SAS for Windows, use appropriate filename and pathname conventions as follows:

LIBNAME misc 'c:\work';

Note: The extension of a SAS data file depends on the operating system and SAS release (or engine). In SAS for Windows, extensions are, for example, .sd2 (version 6.xx) and .sas7bdat (version 7 through 9.xx).

For more, see Getting Started with SAS for Windows and Getting Started with SAS for UNIX.

For more information 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 afdt in domain all.
Last modified on September 30, 2009.

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.