/*-------------------------------------------------------------- * * SAS TEST LIBRARY * * NAME: migrate_RLStemplate.sas * TITLE: Template for MIGRATE validation programs in * a V8 32-bit to SAS 9 64-bit scenario * SUPPORT: David Wiehle david.wiehle@sas.com * SYSTEMS: 9.1 or later * OUTPUT: migrate_RLStemplate.log * migrate_RLStemplate.lst * SPEC.REQ: 1. 32-bit V8 SAS/Connect server * 2. Direct access to source library from both * remote V8 and local SAS 9 sessions * (e.g., NLS mounting) * CREATED: 15 September 2006 * UPDATE: *--------------------------------------------------------------*/ /*-------------------------------------------------------------------------* * Step 1. Assign a report title, report options, and some pathnames. *-------------------------------------------------------------------------*/ title1 "results of migrating source library to SAS 9 target library"; options nodate nonumber nocenter formdlim='-' ls=100; /* Assign path to local copy of migrate_macros.sas, to be used */ /* in a %include statement. For example: */ /* %let macros='/users/migrate/migrate_macros.sas'; */ %let macros='your-pathname'; /* Assign 2 physical locations on V8 server, to be used in */ /* libname statements. For example: */ /* %let source='/data/v8'; */ /* %let source_oda='/data/ods1'; */ /* 1. path to source library (NOTE: This path must be usable */ /* by both the remote V8 and local SAS 9 sessions) */ %let source='your-pathname'; /* 2. path to empty ods library on V8 server */ %let source_ods='your-pathname'; /* Assign 3 physical locations in local SAS 9 session, to be */ /* used in libname statements. */ /* 1. path to empty target library */ %let target='your-pathname'; /* 2. path to empty ods temp library in SAS 9 session */ %let target_temp='your-pathname'; /* 3. path to empty ods library in SAS 9 session */ %let target_ods='your-pathname'; /*-------------------------------------------------------------------------* * Step 2. Connect to a server that is running SAS 8. * * The %BEFORE macro (which you submit in a later step) * must run in a session that's native to the source library. * If your source library was created under 32-bit SAS, * the SAS/CONNECT server must be running 32-bit SAS 8. * * The commands to start a SAS/CONNECT server vary * from site to site. The code below is provided * as an example. Whatever commands are used, it is * important that the server be referenced as "v8serv" * in the signon command at the end of this section for * the rsubmit code in later sections to work. * * You supply two values in this step: a logon script * (if you have one) and the server pathname. *-------------------------------------------------------------------------*/ /* logon script file for UNIX via TCP. For example: */ /* filename rlink '/sas/connect/script/unix.sas' */ filename rlink 'your-pathname'; /* set global macro variables to allow the signon command */ /* below to start a remote V8 session. */ %let unxlvl=r; %let unxrel=800; %let unxtloc=/800test/master; %let v8serv=your-server; /*turn off remote session tracing */ %let rtrace=*; /* signon command does not require ampersand */ signon v8serv; /*-------------------------------------------------------------------------* * Step 3. Prepare the SAS 8 session for validation. *-------------------------------------------------------------------------*/ /* pass path to migrate_macros.sas to the V8 server */ %syslput macros=%bquote(¯os); /* pass path to source library to the V8 server */ %syslput source=&source; %syslput source_ods=&source_ods; /* upload the validation macro program to the V8 server */ rsubmit v8serv; options notes; filename migfile temp; proc upload infile="¯os" outfile=migfile; run; endrsubmit; /*-------------------------------------------------------------------------* * Step 4. Prepare the SAS 8 session for migration, and collect * validation information. *-------------------------------------------------------------------------*/ rsubmit v8serv; options notes; /* create a new ODS library */ libname ods &source_ods; /* assign LIB1 to source library */ libname lib1 &source; /* assign CATLIB to source library */ libname catlib &source; /* compile the validation macro program on the V8 server */ %inc migfile; /* collect validation information from the source library */ options nonotes; %before; endrsubmit; /*-------------------------------------------------------------------------* * Step 5. Copy the source library validation information * to the target session. *-------------------------------------------------------------------------*/ /* temporarily assign the ODS library through the V8 server */ /* This is done only to allow downloading the validation */ /* data sets from the V8 server session to the SAS 9 client */ /* session. */ libname ods server=v8serv; /* create a temporary library for the source library */ /* validation data sets. */ libname odstemp &target_temp; /* copy the data sets from the V8 server ODS library to the */ /* odstemp library in the current session. */ options nonotes; proc copy in=ods out=odstemp;run; options notes; /* clear the V8 ODS library */ libname ods clear; /* create a new ODS library in the SAS 9 client session */ libname ods &target_ods; /* copy the validation data sets from the ODSTEMP library */ /* to the ODS library created in the current session. */ options nonotes; proc copy in=odstemp out=ods;run; /* clean up the odstemp library */ proc datasets lib=odstemp nolist kill;run;quit; options notes; /*-------------------------------------------------------------------------* * Step 6. Assign the libraries that are necessary for the migration. *-------------------------------------------------------------------------*/ libname lib1 &source; libname catlib server=v8serv; libname lib2 ⌖ /*-------------------------------------------------------------------------* * Step 7. Migrate. * If you have no catalogs in the source library, the SLIBREF= * option and the CATLIB libref are not necessary and produce * a warning that the SLIBREF= is empty. *-------------------------------------------------------------------------*/ options notes; proc migrate in=lib1 out=lib2 slibref=catlib;run; options nonotes; /*-------------------------------------------------------------------------* * Step 8. Collect validation information from the target library. *-------------------------------------------------------------------------*/ %include "¯os"; %after; /*-------------------------------------------------------------------------* * Step 9. Compare the source and target library validation * information, and write validation reports to output. *-------------------------------------------------------------------------*/ %checkem; /*-------------------------------------------------------------------------* * Step 10. Clean up. *-------------------------------------------------------------------------*/ libname lib1 clear; libname catlib clear; rsubmit v8serv; libname lib1 clear; libname ods clear; libname catlib clear; endrsubmit; signoff v8serv; libname odstemp clear; libname ods clear; libname lib2 clear;