/*-------------------------------------------------------------- * * SAS TEST LIBRARY * * NAME: migrate_RLStemplate9.sas * TITLE: Template for MIGRATE validation programs in * a v9 32-bit to SAS 9 64-bit scenario * SUPPORT: Rose Howell Rose.Howell@sas.com * SYSTEMS: 9.1 or later * OUTPUT: migrate_RLStemplate9.log * migrate_RLStemplate9.lst * SPEC.REQ: 1. 32-bit v9 SAS/Connect server * 2. Direct access to source library from both * remote v9 and local SAS 9 sessions * (e.g., NLS mounting) * CREATED: 17 June 2011 modified migrate_RLStemplate.sas for v9 - v9 migration *--------------------------------------------------------------*/ /*-------------------------------------------------------------------------* * 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 an %include statement. For example: */ /* %let macros='/users/migrate/migrate_macros.sas'; */ %let macros='your-pathname'; /* Assign 2 physical locations on v9 server, to be used in */ /* libname statements. For example: */ /* %let source='/data/v9'; */ /* %let source_ods='/data/ods1'; */ /* 1. path to source library (NOTE: This path must be usable */ /* by both the remote v9 and local SAS 9 sessions) */ %let source='your-pathname'; /* 2. path to empty ods library on v9 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 SAS 9 server (native to the source library). * * The %BEFORE macro (which you submit in a later step) * must run in a session that's native to the source library. * * * 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 "v9serv" * 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 v9 session. */ %let v9serv=your-server; /*turn off remote session tracing */ %let rtrace=*; /* signon command does not require ampersand */ signon v9serv; /*-------------------------------------------------------------------------* * Step 3. Prepare the SAS 9 server session for validation. *-------------------------------------------------------------------------*/ /* pass path to migrate_macros.sas to the v9 server */ %syslput macros=%bquote(¯os); /* pass path to source library to the v9 server */ %syslput source=&source; %syslput source_ods=&source_ods; /* upload the validation macro program to the v9 server */ rsubmit v9serv; options notes; filename migfile temp; proc upload infile="¯os" outfile=migfile; run; endrsubmit; /*-------------------------------------------------------------------------* * Step 4. Prepare the SAS 9 server session for migration, and collect * validation information. *-------------------------------------------------------------------------*/ rsubmit v9serv; options notes; /* create a new ODS library */ libname ods &source_ods; /* assign LIB1 to source library */ libname lib1 &source; /* compile the validation macro program on the v9 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 v9 server */ /* This is done only to allow downloading the validation */ /* data sets from the v9 server session to the SAS 9 client */ /* session. */ libname ods server=v9serv; /* create a temporary library for the source library */ /* validation data sets. */ libname odstemp &target_temp; /* copy the data sets from the v9 server ODS library to the */ /* odstemp library in the current session. */ options nonotes; proc copy in=ods out=odstemp;run; options notes; /* clear the v9 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 server=v9serv; libname lib2 ⌖ /*-------------------------------------------------------------------------* * Step 7. Migrate * since v9 server the lib1 connected to the server will be able to * migrate all--including catalogs *-------------------------------------------------------------------------*/ options notes; proc migrate in=lib1 out=lib2 ;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; rsubmit v9serv; libname lib1 clear; libname ods clear; endrsubmit; signoff v9serv; libname odstemp clear; libname ods clear; libname lib2 clear;