Indiana University
University Information Technology Services
  
What are archived documents?

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, the Libra Cluster), 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 are using 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.

Also see:

This is document afdt in domain all.
Last modified on May 12, 2008.
Please tell us, did you find the answer to your question?