logo Getting Started with SAS Main menuGlossaryBackNext
    

Overview

In Work with SAS data sets, you learned that before you access a SAS file, you generally define a SAS library to show SAS where the file is.

You've already created a SAS library interactively by using the New Library window. Another way to define a SAS library is by using a LIBNAME statement. The LIBNAME statement

  • identifies a SAS library to SAS
  • associates an engine with the library
  • allows you to specify options for the library
  • assigns a libref (library reference name) to it.

The advantage of the LIBNAME statement is that you can store it in a SAS program to reference the SAS library automatically when you submit the program.

Once the libref is assigned, you can read, create, or update files in a SAS library. In SAS programs, you specify the libref as the first part of the two-level name for the SAS file:

libref.filename

In the two-level name, libref is the name of the SAS library that contains the file, and filename is the name of the file itself. A period separates the libref and filename.


two-level SAS name

More Information If you have licensed one or more SAS/ACCESS products, you can create a SAS library that references a relational DBMS database, schema, server, or group of tables and views.


Point-and-Click Method

You can create SAS libraries using a point-and-click interface.

  1. Click Viewthen Explorer.
  2. Click Filethen New.
  3. In the New Library window, specify information for the new library. If you want the library to be created at the beginning of each SAS session, click Enable at startup.
  4. Click OK.


Main menuGlossaryBackNext