As with data files,
migrated data views take on the data representation and encoding attributes
of the target library. When you migrate a library that contains DATA
step views to a different operating environment, and the views were
created before SAS 9.2, setting the proper encoding might be necessary.
In releases before SAS 9.2, DATA step views did not save encoding
information. Therefore, if the view has a different encoding than
the target session, you must specify the INENCODING= option for the
source library's LIBNAME statement. Here is an example:
libname srclib 'c:\mysource' inencoding="OPEN_ED-1047";
libname lib1 'c:\mytarget';
proc migrate in=srclib out=lib1;
run;
In addition, embedded
librefs associated with a view are not updated during migration. The
following example illustrates the issue. In this example, LIB1.MYVIEW
contains a view of the data file LIB1.MYDATA:
data LIB1.MYDATA;x=1;
run;
proc sql;
create view LIB1.MYVIEW as select * from LIB1.MYDATA;
quit;
After you migrate LIB1
to LIB2, you have LIB2.MYVIEW and LIB2.MYDATA. However, because LIB2.MYVIEW
was originally created with an embedded libref of LIB1, it still references
the data file LIB1.MYDATA, not LIB2.MYDATA. The following example
fails with an error message that LIB1 cannot be found:
proc print data=LIB2.MYVIEW;
run;
PROC MIGRATE supports
three types of views: DATA step views, SQL views, and
SAS/ACCESS views:
Beginning with SAS
8, when you create a DATA step view, you can specify the SOURCE= option
to store the DATA step code along with the view. PROC MIGRATE supports
DATA step views with stored code. The stored code is recompiled the
first time the DATA step view is accessed by SAS in the target environment.
PROC MIGRATE does not support DATA step views that were created before
SAS 8 or DATA step views without stored code. For DATA step views
without stored code, use the DESCRIBE statement in the source session
to recover the DATA step code. Then submit the DATA step code in the
target session and recompile it.
PROC MIGRATE supports
PROC SQL views with no known issues.
PROC MIGRATE supports
SAS/ACCESS views that were written with the Oracle, Sybase, or DB2
engine. PROC MIGRATE automatically uses the CV2VIEW procedure, which
converts SAS/ACCESS views into SQL views. Migrating SAS/ACCESS views
to a different operating environment is not supported. For more information
about the conversion, see the overview of the CV2VIEW procedure in SAS/ACCESS for Relational Databases: Reference.