Chapter Contents




Associates a libref with a SAS data library and lists file attributes for a SAS data library

Valid: anywhere in a SAS program
OS/2 specifics: Valid values for engine; specifications for SAS-data-library

Associating Librefs
Listing Data Library Attributes
See Also


LIBNAME libref <engine> ('SAS-data-library-1' <,...'SAS-data-library-n'>) <LONGFILEEXT | SHORTFILEEXT> ;

Note:   This is a simplified version of the LIBNAME statement syntax. For the complete syntax and its explanation, see the LIBNAME statement in SAS Language Reference: Dictionary.  [cautionend]

is any valid libref, as documented in SAS Language Reference: Dictionary.

is one of the following library engines supported under OS/2:
V8 accesses Version 8 data sets. You can use the nickname BASE for this engine.
V7 accesses Version 7 data sets.
V6 accesses Release 6.08 through Release 6.12 data sets.
V612 accesses Release 6.12 data sets.
V611 accesses Release 6.11 data sets.
V610 accesses Release 6.10 data sets.
V609 accesses Release 6.09 data sets.
V608 accesses Release 6.08 data sets.
V604 accesses Release 6.04 and Release 6.03 data sets.
XPORT accesses transport format files.
BMDP accesses BMDP data files.
OSIRIS accesses OSIRIS data files.
SPSS accesses SPSS system files.

For more information about these engines, see Multiple Engine Architecture and the discussion of engines in SAS Language Reference: Dictionary.

is the physical name of a SAS data library under OS/2. It must be a valid OS/2 pathname. You can concatenate several OS/2 directories together to serve as a single SAS data library. For more information about concatenated SAS data libraries, see Understanding How Concatenated SAS Data Libraries Are Accessed.

specifies whether the library supports long file extensions or short file extensions (3 characters). LONGFILEEXT is the default.

If SAS is not able to create a file with a long file extension in a library, then the library supports only files with short file extensions.


The LIBNAME statement associates a libref with a permanent SAS data library. It also can be used to list the file attributes of a SAS data library. (The LIBNAME statement is also used to clear a libref. For more information, see Clearing Librefs.)

The SAS Explorer window provides an intuitive interface to assigning SAS data libraries. For information about managing SAS data libraries using this interactive interface, see the SAS introductory books.

Note:   The words CON, NUL, PRN, LPT0 - LPT9, and COM1 - COM9 are reserved words under OS/2. Do not use them as librefs.   [cautionend]

Associating Librefs

Use one of the following forms of the LIBNAME statement to associate a libref or an engine with a SAS data library:

LIBNAME libref engine 'SAS-data-library';

LIBNAME libref engine (`SAS-data-library-1' ,...`SAS-data-library-n')

You can use the same arguments with these forms of the LIBNAME statement as shown in Syntax.

Listing Data Library Attributes

With the LIST option, you can use the LIBNAME statement to list attributes of SAS data libraries. Data Library Attributes Listed by the LIBNAME Statement shows the results of the following LIBNAME statement:

libname sashelp list;

Data Library Attributes Listed by the LIBNAME Statement
5    libname sashelp list;
      Scope=    Kernel
      Levels=   23
        -Level 1-
      Engine=   V8
      Physical Name= E:\SASV8\SASCFG
      File Name=E:\SASV8\SASCFG 
        -Level 2-
      Engine=   V8
      Physical Name= E:\SASV8\core\sashelp
      File Name=E:\SASV8\core\sashelp 
        -Level 3-
      Engine=   V8
      Physical Name= E:\SASV8\base\sashelp
      File Name= E:\SASV8\base\sashelp

      . . .

         -Level 23-
      Engine=   V8
      Physical Name= E:\SASV8\whouse\sashelp
      File Name= E:\SASV8\whouse\sashelp
6    run;

See Also

Chapter Contents



Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.