FOCUS AREAS

Step 2

Migration

Best Practices Migration with PROC MIGRATE: Migrate Files

Special Topic: Migrating from a Multi-Version Directory

In some operating environments, you can store SAS 6 files in the same physical directory as SAS 7, 8, or 9 files, which is called a multi-version directory. See Maintaining Files from Different Releases for more information.

You can migrate SAS library members from a multi-version directory by performing a separate migration for each version. In other words, although the library members are stored together in one physical directory, you must think of each version as a separate library of data. For each SAS version that is represented in the directory, submit a LIBNAME statement and a MIGRATE procedure that are specific to the version.

For example, the following code migrates SAS 6 and SAS 8 members from one physical location to the format of the target SAS release in another physical location:

   /* step 1:  Migrate V6 members to the target library */
   libname source6 v6 'source-library-pathname';
   libname target base 'target-library-pathname';
   proc migrate in=source6 out=target; run;

   /* step 2:  Migrate V8 members to the target library */
   libname source8 v8 'source-library-pathname';
   libname target base 'target-library-pathname';
   proc migrate in=source8 out=target; run;

Notice that you must specify the appropriate engine name in each LIBNAME statement. Otherwise, SAS assigns the engine. For example, if a library contains only SAS 8 members, SAS assigns the V8 engine. If a library contains only SAS 6 members, SAS assigns the V6 engine. But if a library contains both SAS 6 and SAS 8 members, SAS assigns the default V8 engine, and only the SAS 8 members are migrated. You can avoid this error by specifying the appropriate engine name in each LIBNAME statement.

See the PROC MIGRATE Calculator for the remainder of your migration instructions.

Best practice

Take care not to overwrite library members with the same name. When you migrate SAS library members from a multi-version directory, take care with member names. The external file extension of SAS 6 members is different from that of SAS 7 or 8 members, so you can store a SAS 6 member in a directory with a SAS 7 or 8 member that has the same name. For example:

      mydata.sd2           /* SAS 6 data set */
      mydata.sas7bdat      /* SAS 7 or 8 data set */

However, in the target SAS library, all members have the same extension, SAS7BDAT. If you migrate the SAS 6 member to the target library and then attempt to migrate the SAS 8 member, the SAS 8 member will fail to migrate. This is because a member with the same name, the same type, and the same file extension already exists in the target library.

Migrating a Selected Member from a SAS Library

The MIGRATE procedure migrates an entire SAS data library to the newer release of SAS within one engine family. However, you might not want to migrate all the members of a library. In order to migrate one member of a library, you must first move the file to its own physical directory. Then assign a new libref to the new directory, and use PROC MIGRATE against the new library. See your SAS Companion for information about assigning a SAS libref to a physical directory.

Return to Step 2.