SAS data libraries are generally stored as permanent data libraries; however, SAS provides a temporary or scratch library where you can store files for the duration of a SAS session or job.
A permanent SAS data library is one that resides on the external storage medium of your computer and is not deleted when the SAS session terminates. Permanent SAS data libraries are stored until you delete them. The library is available for processing in subsequent SAS sessions. When working with files in a permanent SAS data library, you generally specify a libref as the first part of a two-level SAS filename. The libref tells SAS where to find or store the file.
You can also skip using a libref and point directly to the file you want to use, using syntax that your operating system understands. An example of this in the Windows environment is
Operating Environment Information: Files are specified differently in various operating environments. See the SAS documentation for your operating environment for more information.
A temporary SAS data library is one that exists only for the current SAS session or job. SAS files that are created during the session or job are held in a special work space that may or may not be an external storage medium. This work space is generally assigned the default libref WORK. Files in the temporary WORK library can be used in any DATA step or SAS procedure during the SAS session, but they are typically not available for subsequent SAS sessions. Normally, you specify that data sets be stored in or retrieved from this library by specifying a one-level name . Files held in the WORK library are deleted at the end of the SAS session if it ends normally.
There are a number of SAS system options that enable you to customize the way you name and work with your permanent and temporary SAS data libraries. See the USER=, WORK=, WORKINIT, and WORKTERM system options in SAS Language Reference: Dictionary for more information.