Librefs Assigned by SAS in UNIX Environments


Automatically Defined Librefs

SAS automatically defines three librefs:

Sashelp

  • contains a group of catalogs that contain information that is used to control various aspects of your SAS session. The Sashelp library is in the !SASROOT directory. See Appendix 1, "The !SASROOT Directory," on page 397.

Sasuser

  • contains SAS catalogs that enable you to tailor features of SAS (such as window size , font settings, and printer entries) for your needs. If the defaults in the Sashelp library are not suitable for your applications, you can modify them and store your personalized defaults in your Sasuser library.

Work

  • is the temporary, or scratch, library automatically defined by SAS at the beginning of each SAS session or job. The Work library stores two types of temporary files: those you create and those created internally by SAS as part of normal processing.

These librefs and the LIBRARY libref are reserved librefs. If your site also has SAS/ GRAPH software or SAS/GIS software, the MAPS or GISMAPS librefs might also be automatically defined. All these libraries are described in SAS Language Reference: Dictionary . Sasuser and Work have operating system dependencies.

Sasuser Data Library

What is the Sasuser Library?

The Sasuser library contains the customizations (such as window size and positioning, colors, fonts, and printer entries) that you specified for your SAS session. When you invoke SAS, it looks for the Sasuser directory to find these customizations. If this directory does not exist, SAS uses the SASUSER system option to create it. The default directory is set in the system configuration file (sasv9.cfg) and is usually similar to the following:

 -sasuser ~/sasuser.v91 

This specification tells SAS to create a directory for the Sasuser libref in your home directory. To determine the value of this directory for your system, use PROC OPTIONS or libname sasuser LIST .

You can permit read-only access to the Sasuser library by using the RSASUSER system option. See Chapter 17, "System Options under UNIX," on page 311 for details on the SASUSER and RSASUSER system options.

After the Sasuser library has been created, SAS automatically assigns the same Sasuser libref to it each time you start a SAS session. It cannot be cleared or reassigned during a SAS session. If you delete the library, SAS re-creates it the next time you start a session. Because SAS assigns the libref for you, you do not need to use a LIBNAME statement before referencing this library.

Contents of the Sasuser Library

Your customizations are stored in one of the following locations in the Sasuser library:

Sasuser.Profile catalog

  • The Sasuser.Profile catalog is the profile.sas7bcat file in your Sasuser library. If you change any function key definitions, window attributes (such as size, color , and position), or PMENU settings during your SAS session, SAS saves the changes in the Sasuser.Profile catalog.

    If Sasuser.Profile does not exist, then at invocation SAS checks for the Sashelp.Profile catalog. (This catalog will only exist if you have copied your Sasuser.Profile catalog to the Sashelp library.) If the Sashelp.Profile catalog exists, then SAS will copy it to the Sasuser library, and this will become your new Sasuser.Profile catalog. If the Sashelp.Profile catalog does not exist, then SAS will create a Sasuser.Profile using the default settings for a SAS session.

    If you invoke SAS and discover that your customizations have been lost, then your Sasuser.Profile is either corrupted or locked by another SAS session started with the same user ID. If either of these conditions are true, then the following messages will appear in the SAS log:

     NOTE:  Unable to open SASUSER.PROFILE. WORK.PROFILE will be opened instead.   NOTE:  All profile changes will be lost at the end of the session. 

    When this occurs, SAS creates a Work.Profile catalog (in the Work library) using the default settings for a SAS session. This Work.Profile catalog is used for the duration of the SAS session. Since the contents of the Work directory are temporary, any customizations that you save to the Work.Profile catalog will be lost at the end of the SAS session.

    To resolve these problems with your Sasuser.Profile catalog, you can try one of the following options:

    • If your Sasuser.Profile has been corrupted, then you can remove this catalog, and let SAS create a new one at the next invocation.

    • If your Sasuser.Profile is being used by multiple SAS sessions, then you can specify the RSASUSER system option to permit read-only access to the Sasuser library. Since this permission is read-only, you will not be able to save any customizations to your Sasuser.Profile during that SAS session.

Sasuser.Registry catalog

  • The Sasuser.Registry catalog is the registry.sas7bitm file in your Sasuser library. If you change any Universal Printing entries or libref assignments during a SAS session, then SAS saves the changes in the Sasuser.Registry catalog.

    At invocation, SAS looks in the Sasuser directory to see if it can write to the Sasuser.Registry catalog. If SAS cannot write to this catalog, then the following warning appears in the SAS log:

     WARNING:  Unable to open SASUSER.REGISTRY. WORK.REGISTRY will be used instead.   NOTE:  All registry changes will be lost at the end of the session. 

    If SAS can read the Sasuser.Registry, then SAS copies the Sasuser.Registry to create a Work.Registry catalog (in the Work library). This Work.Registry catalog will be used for the duration of the SAS session. Since the contents of the Work library are temporary, then any customizations that you save to the Work.Registry catalog will be lost at the end of the SAS session. However, the customizations saved in Sasuser.Registry will still exist.

    If SAS cannot read the Sasuser.Registry, then SAS creates the Work.Registry catalog using the default settings for a SAS session. In this case, SAS issues an additional warning to the SAS log:

     WARNING:  Unable to copy SASUSER.REGISTRY to WORK.REGISTRY. 

Sasuser.Prefs file

  • The settings that you specify in the Preferences dialog box (with the exception of those resources on the General tab) are saved in the SasuserPrefs file. For more information about these resources, see "Modifying X Resources through the Preferences Dialog Box" on page 57.

These are three of the files that you can have in your Sasuser library. However, you can store other data sets and catalogs in the Sasuser library as well.

Work Data Library

The Work data library is the temporary library that is automatically defined by SAS at the beginning of each SAS session or job. The Work data library stores temporary SAS files that you create as well as files created internally by SAS.

To access files in the Work data library, simply specify a one-level name for the file. The libref Work is automatically assigned to these files unless you have assigned the User libref.

When you invoke SAS, it assigns the Work libref to a subdirectory of the directory specified in the WORK system option described in Chapter 17, "System Options under UNIX," on page 311. This subdirectory is usually named SAS_workcode_nodename where

code

  • is a 12-character code. The first four characters are randomly generated numbers . The next eight characters are based on the hexadecimal process ID of the SAS session

nodename

  • is the name of the UNIX box where the SAS process is running

This libref cannot be cleared or reassigned during a SAS session.

The WORKINIT and WORKTERM system options control the creation and deletion of the Work data library. See SAS Language Reference: Dictionary for details.

Note  

If a SAS session is terminated improperly (for example, using the kill -9 command), SAS will not delete the SAS_workcode_nodename directory. You might want to use the cleanwork command to delete these straggling directories (see Appendix 2, "Tools for the System Administrator," on page 399).




SAS 9.1 Companion for UNIX Environments
SAS 9.1 Companion For Unix Enivronments
ISBN: 1590472101
EAN: 2147483647
Year: 2004
Pages: 185
Authors: SAS Institute

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net