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:
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.