As the first step in the decommissioning of sasCommunity.org the site has been converted to read-only mode.


Here are some tips for How to share your SAS knowledge with your professional network.


Assign library in a relative path in Windows

From sasCommunity
Jump to: navigation, search

How to assign a library in a relative path in Windows

In the SAS Windowing Environment, it is possible to assign libraries to a path relative to the current folder that is displayed in the status bar.

To display the status bar with the current folder location, do the following:

       1. Select Tools>Options>Preferences.
       2. Make sure that the following options are selected
          (Tools>Options>Preferences):

            * Status line
            * Display Current Folder

If the current folder displays the following

  C:\Documents and Settings\Sasuser\V8

The following LIBNAME statement

     LIBNAME DATA '.';

generates in the the Log window the following with library assigned:

     NOTE: Libref DATA was successfully assigned as follows:
           Engine:        V8
           Physical Name: C:\Documents and Settings\Sasuser\V8

and the following LIBNAME statement

     LIBNAME MOREDATA '..';

generates in the the Log window the following with library assigned:

     NOTE: Libref MOREDATA was successfully assigned as follows:
           Engine:        V8
           Physical Name: C:\Documents and Settings\Sasuser

The examples show that when using the '.' as the path that the current folder for SAS is used as the relative path and when the '..'is used as the path then the path is one higher from the current folder.

These relative paths can be mixed with further folder designations.

For example: The following LIBNAME statement

     LIBNAME DATA '.\ACCESS';

generates in the the Log window the following with library assigned:

     NOTE: Libref DATA was successfully assigned as follows:
           Engine:        V8
           Physical Name: C:\Documents and Settings\Sasuser\V8\ACCESS

The following LIBNAME statement

     LIBNAME MOREDATA '..\ACCESS';

generates in the the Log window the following with library assigned:

     NOTE: Libref MOREDATA was successfully assigned as follows:
           Engine:        V8
           Physical Name: C:\Documents and Settings\Sasuser\ACCESS


Submitted by Liang Xie. Contact me at my Discussion Page.

See Also