Using SAS Library Engines


In order to access a SAS data library, SAS needs a libref and a library engine name. For example, you assign a libref to the SAS data library with the LIBNAME statement or the New Library window, but usually you do not have to specify an engine name because SAS automatically selects the appropriate engine.

If you do not specify an engine, SAS automatically assigns one based on the contents of the SAS data library. For example, SAS is able to differentiate between a SAS 6 library and a SAS 9 library. Note that in SAS 9, a SAS library containing SAS 7 and 8 files is the same as a SAS 9 library, because the engine that creates a SAS file determines its format, and the file format for SAS 7, 8, and 9 is the same.

For example, in a SAS 9 session, if you issue the following LIBNAME statement to assign a libref to a data library containing SAS 8 SAS files, SAS automatically uses the SAS 9 engine:

 libname mylib '  v8-SAS-data-library  '; 

In a SAS 9 session, if you issue the following LIBNAME statement to assign a libref to a data library that contains only SAS 6 files, SAS automatically uses the Version 6 compatibility engine:

 libname mylib '  v6-SAS-data-library  '; 

SAS automatically assigns an engine based on the contents of the data library as shown in the following table:

Table 35.2: Default Library Engine Assignment in SAS 9

Engine Assignment

Data Library Contents

V9

No SAS files; the library is empty

V9

Only SAS 9 SAS files

V9

Only SAS 8 SAS files

V9

Only SAS 7 SAS files

V6

Only SAS 6 SAS files

V9

Both SAS 9 SAS files and SAS files from earlier releases

Note  

Even though SAS will automatically assign an engine based on the library contents, it is more efficient for you to specify the engine. For example, specifying the engine name in the following LIBNAME statement saves SAS from determining which engine to use:

 libname mylib v6 '  v6-SAS-data-library  ';   

For more information about SAS engines, see Chapter 37, "SAS Engines," on page 601.




SAS 9.1.3 Language Reference. Concepts
SAS 9.1.3 Language Reference: Concepts, Third Edition, Volumes 1 and 2
ISBN: 1590478401
EAN: 2147483647
Year: 2004
Pages: 258

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