Hot Topics

Related Links



Maintaining Files from Different Releases

You might find these techniques helpful in maintaining files together that were created under different releases of SAS.

Concatenating SAS 9 Libraries with Libraries from Earlier Releases

After migrating a library to SAS 9, you might want to put SAS 9 files together with SAS 6, 7, or 8 files in one library. This can be done with library concatenation. When you concatenate SAS libraries, you reference multiple SAS data libraries with a single libref. This is called a multi-version library.

Here is an example. Suppose you have files in both a SAS 6 library and a SAS 9 library. The following LIBNAME statements enable you to process both SAS 6 and SAS 9 libraries using one libref.

You assign a libref to the SAS 6 library to use the V6 compatibility engine:

   libname old v6 'v6-SAS-data-library';
You assign a libref to the SAS 9 library to use the SAS 9 base SAS engine:
   libname new v9 'v9-SAS-data-library';
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.

In the example, engine names are specified in the first two LIBNAME statements for clarity; specifying the engine name is optional, because SAS can automatically assign the correct engine in this case.

For more information about library concatenation, see "Library Concatenation" in the chapter "SAS Data Libraries" in SAS Language Reference: Concepts.

Storing SAS 9 Files with Files from Earlier Releases

In some operating environments, you can store mmultiple releases of SAS files together in the same physical location on your computer (that is, in the same directory or file folder). This is called a multi-version directory. To process the files, you assign different librefs with different engines to the single directory.

For example, the following LIBNAME statements assign two librefs to the same directory: one for the V6 compatibility engine and the other for the V9 base SAS engine:

   libname v6files v6 'SAS-data-library';
   libname v9files v9 'SAS-data-library';
To process the files, reference the appropriate libref. For example, the following statements print a SAS 6 data set:
   proc print data=v6files.member1;
These statements print a SAS 9 data set:
   proc print data=v9files.member2;
Best practice

It is best not to maintain SAS 7 and 8 files together with SAS 9 files. If you do combine SAS 7 or 8 files in the same directory as SAS 9 files, keep in mind that the file extensions are the same. Therefore, a SAS 7 or 8 file will be overwritten by a SAS 9 file of the same name stored in the same directory.

Best practice

It is suggested that the SAS data library to contain 64-bit SAS 9 files should contain only the 64-bit SAS 9 files. While SAS is able to differentiate between a SAS 6 file and a SAS 9 file, SAS cannot differentiate among SAS 7, 8, and 9 files. That is, a SAS 9 library can contain files created in SAS 7, 8, and 9, which means that you could have a mixture of 32-bit and 64-bit files in the SAS 9 library. This could cause confusion, because the level of access supported between the 32-bit and 64-bit versions of files is different. Keeping your 64-bit SAS 9 files in a separate location will keep data access functionality consistent within the library.

Migrating Multiple Versions or a Selected Library Member

The special topic Migrating Files from a Multi-Version Directory provides instructions for migrating files from a multi-version directory and a workaround for migrating a selected file from a directory.