Introduction to SAS Files, Libraries, and Engines in UNIX Environments

SAS Files

What Is a SAS File?

Your data can reside in different types of files, including SAS files and files that are formatted by other software products, such as database management systems. Under UNIX, a SAS file is a specially structured UNIX file. Although the UNIX operating environment manages the file for SAS by storing it, the operating system cannot process it because of the structure built into the file by SAS. For example, you can list the filename with the ls command, but you cannot use the vi editor to edit the file. A SAS file can be permanent or temporary.

Case Sensitivity in Data Set Names

In UNIX operating environments, SAS data set names are written in all lowercase characters. Because of this requirement, SAS reads only data set names that are written in all lowercase characters.
If you use the UNIX utilities mv or cp to rename SAS data set names with uppercase or mixed-case characters, SAS can no longer read the data set names.
UNIX is case sensitive. Therefore, a data set named xxx.sas7bdat is not the same as a data set named XXX.sas7bdat. In fact, both of these data sets can reside in the same directory as completely different data sets.

SAS Libraries

What Are SAS Libraries?

SAS files are stored in SAS libraries. A SAS library is a collection of SAS files within a UNIX directory. Any UNIX directory can be used as a SAS library. (The directory can also contain files called external files that are not managed by SAS. See Using External Files and Devices for how to access external files.) SAS stores temporary SAS files in a Work library, which is automatically defined for you. You must specify a library for each permanent SAS file. For more information, see Work Library.

What Is a Libref?

SAS libraries can be identified with librefs. A libref is a name by which you reference the directory in your application. For more information about how to assign a libref, see Referring to SAS Files by Using Librefs in UNIX Environments.

Engines

What Is an Engine?

SAS files and SAS libraries are accessed through engines. An engine is a set of routines that SAS must use to access the files in the library. SAS can read from and, in some cases, write to the file by using the engine that is appropriate for that file type. For some file types, you need to tell SAS which engine to use. For others, SAS automatically chooses the appropriate engine. The engine that is used to create a SAS data set determines the format of the file.

Additional Resources

For more information about SAS files, libraries, and engines, see SAS Language Reference: Concepts.