SAS Libraries

Definition

A SAS library contains one or more files that are defined, recognized, and accessible by SAS, and that are referenced and stored as a unit. One special type of file is called a catalog. In SAS libraries, catalogs function much like subfolders for grouping other members.

Predefined SAS Libraries

By default, SAS defines several libraries for you:
Sashelp
a permanent library that contains sample data and other files that control how SAS works at your site. This is a Read-Only library.
Sasuser
a permanent library that contains SAS files in the Profile catalog and that stores your personal settings. This is also a convenient place to store your own files.
Work
a temporary library for files that do not need to be saved from session to session.
You can also define additional libraries. When you define a library, you indicate the location of your SAS files to SAS. After you define a library, you can manage SAS files within it.
Note: If you are using SAS Studio, you might encounter the Webwork library. Webwork is the default output library in interactive mode. For more information about the Webwork library, see SAS Studio: User’s Guide.

Defining Libraries

To define a library, you assign a library name to it and specify the location of the files, such as a directory path.
You can also specify an engine, which is a set of internal instructions that SAS uses for writing to and reading from files in a library.
You can define SAS libraries using programming statements. For information about how to write LIBNAME statements to define SAS libraries, see Assigning Librefs.
Tip
Depending on your operating environment and the SAS/ACCESS products that you license, you can create libraries with various engines. Each engine enables you to read a different file format, including file formats from other software vendors.
When you delete a SAS library, the pointer to the library is deleted, and SAS no longer has access to the library. However, the contents of the library still exist in your operating environment.

How SAS Files Are Stored

A SAS library is the highest level of organization for information within SAS.
For example, in the Windows and UNIX environments, a library is typically a group of SAS files in the same folder or directory.
The table below summarizes the implementation of SAS libraries in various operating environments.
Table 2.1 Environments and SAS Libraries
Environment
Library Definition
Windows, UNIX
a group of SAS files that are stored in the same directory. Other files can be stored in the directory, but only the files that have SAS file extensions are recognized as part of the SAS library.
z/OS
a specially formatted host data set in which only SAS files are stored.

Storing Files Temporarily or Permanently

Depending on the library name that you use when you create a file, you can store SAS files temporarily or permanently.
Table 2.2 Temporary and Permanent SAS Libraries
Temporary SAS libraries last only for the current SAS session.
If you do not specify a library name when you create a file, the file is stored in the temporary SAS library, Work. If you specify the library name Work, then the file is stored in the temporary SAS library. When you end the session, the temporary library and all of its files are deleted.
Permanent SAS libraries are available to you during subsequent SAS sessions.
To store files permanently in a SAS library, specify a library name other than the default library name Work.
In the example, when you specify the library name Cert when you create a file, you are specifying that the file is to be stored in a permanent SAS library.
Last updated: August 23, 2018
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.73.187