Chapter Contents

Previous

Next

Accessing SAS Data Libraries


Concatenating Version 8 Libraries with Libraries from Earlier Releases

A technique that can help you migrate to Version 8 is to reference multiple SAS libraries with a single libref, referred to as library concatenation. For example, by concatenating Version 6 and Version 8 data libraries, you can migrate your files one at a time. That is, you can convert some files to Version 8 format (for example, using the COPY procedure), while other files remain in Version 6 format.

For example, suppose you have files in both a Version 6 library and a Version 8 library for which an application needs to process. The following LIBNAME statements allow you to access both Version 6 and Version 8 libraries using one libref. Note that the engine names are specified in the first two LIBNAME statements for clarity; specifying the engine name is optional.

  1. You assign a libref to the Version 6 library to use the V6 compatibility engine.
    libname old v6 "v6-SAS-data-library";

  2. You assign a libref to the Version 8 library to use the Version 8 default engine.
    libname new v8 "v8-SAS-data-library";

  3. You concatenate the two into one libref.
    libname mylib (new old);

Now you can invoke the application using the MYLIB libref, which accesses both data libraries.

For more information on library concatenation, see Library Concatenation.


Combining Version 8 Files with Files from Earlier Releases

In some operating environments, you can combine Version 6 and Version 8 files in one directory, which is referred to as a mixed-mode directory. To access the files, you assign different librefs with different engines to the single directory. For example, the following statements assign two librefs to the same directory: one for the V6 compatibility engine and the other for the V8 engine:

libname v6files v6 "path-to-SAS-data-library";
libname v8files v8 "path-to-SAS-data-library";
To access the files, you reference the appropriate libref. For example, to print a Version 6 data set, you would issue:
proc print data=v6files.member1;
run;
To print a Version 8 data set, you would issue:
proc print data=v8files.member2;
run;

Note:   If you combine Version 7 and Version 8 files in the same directory, note that the file extensions (and the file formats) are the same in both releases. Therefore, a Version 7 file will be overwritten by a Version 8 file of the same name stored in the same directory.  [cautionend]


Chapter Contents

Previous

Next

Top of Page

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