Previous Page | Next Page

SAS/CONNECT Cross-Version Issues

RLS: Accessing SAS Files in a Mixed Cross-Version Library


Separating Older SAS Files from Newer SAS Files

Whenever possible, keep older SAS files (SAS 6) and newer SAS files (created using SAS releases after SAS 6) in separate physical locations. Segregation of release-specific files avoids confusion about what files can be accessed when using RLS.


Specifying an Engine to Locate Release-Specific Files in a Mixed Library

Your ability to access a specific SAS file in a library depends on the engine that is associated with that library. You can explicitly specify the engine in the LIBNAME statement, or you can allow SAS to select the appropriate engine according to the version of SAS being used and the format of the SAS files in the directory. If the library is homogenous (for example, all data files are SAS 9 files), the V9 engine is used, by default.

Note:   The V9 and V8 engines provide identical functionality.  [cautionend]

However, if a physical library contains a mixture of SAS 6 files and SAS 8 files, a SAS session that runs a newer release of SAS can use the V6 engine to access only the SAS 6 files in that library.

CAUTION:
A SAS 9 session cannot access SAS 6 files in a mixed library.   [cautionend]

If a library contains newer and older SAS files and the V9 or V8 engine is specified, only the SAS 9 or SAS 8 files can be accessed. The SAS 6 files are not recognized in the SAS 9 or SAS 8 session.

However, if the V6 engine is specified, the SAS 6 files can be accessed. The SAS 9 or SAS 8 files are not recognized.

In the following example, the libref V8LIB accesses only SAS 9 or SAS 8 files.

libname v8lib v8 'SAS-library';

In the following example, the libref V9LIB accesses only SAS 9 or SAS 8 files.

libname v9lib v9 'SAS-library'; 

In the following example, the libref V6LIB accesses only SAS 6 files.

libname v6lib v6 'SAS-library';


Determining the Version of SAS Used to Create a SAS File

To determine the version of the SAS engine that was used to create a SAS file, examine the filename extension.

Here are the filename extensions for files that are created under the Windows operating environment:

Filename Extensions Supported Under the Windows Operating Environment
File Type SAS 6 Filename Extension SAS 9 or SAS 8 Filename Extension
Data Set sd2 sas7bdat
Catalog sc2 sas7bcat
View sv2 sas7bvew


Concatenating Libraries

In order to expand the scope of SAS file access from a single library to multiple libraries, use library concatenation. With an expanded scope, you can perform operations on either SAS 6 data files or SAS 9 data files that span multiple libraries.

Here is an example of library concatenation:

libname v6lib v6 'SAS-library';
libname v9lib v9 'SAS-library';
libname catlib (v9lib v6lib);

Note:   SAS-library must be the physical name that is recognized by the operating environment.  [cautionend]

The first LIBNAME statement assigns the libref V6LIB to a SAS library that is accessed using the V6 engine. The V6 engine recognizes only files that are appended with a SAS 6 filename extension.

The second LIBNAME statement assigns the libref V9LIB to a SAS library that is accessed using the V9 engine. The V9 engine recognizes only files that are appended with a SAS 9 filename extension.

The third LIBNAME statement assigns the libref CATLIB to concatenated SAS libraries that are referenced by the librefs V9LIB and V6LIB. The order of the librefs identifies the sequence in which the libraries are searched. The SAS operation uses the first occurrence of a specified file.

For example, if the same SAS file exists in both SAS libraries and you delete that SAS file, the SAS file in the first library (for example, STOCK.SAS7BDAT in V9LIB) is deleted. If V6LIB precedes V9LIB in the library concatenation statement (for example, STOCK.SD2 in V6LIB), that SAS file is deleted. If the specified SAS file exists in only one SAS library, that SAS file is deleted.

Previous Page | Next Page | Top of Page