Sas Libname

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Create a library (1 of 4) Page 1 of 2

Create a library 1 of 4

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

l identifies a SAS library to SAS


l associates an engine with the library
l allows you to specify options for the library
l 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.

http://127.0.0.1:50712/help/sastut.hlp/m6_1.htm 8/3/2015
Create a library (1 of 4) Page 2 of 2

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 View Explorer.


2. Click File 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.

http://127.0.0.1:50712/help/sastut.hlp/m6_1.htm 8/3/2015

You might also like