*----This setup (/pub/data/Tools/migrate_filetype.sas) is invoked in batch mode with a sysparm spec telling it which filetype (i.e. subdirectory of /pub/data) is to be migrated. See also postmigrate_filetype.sas in this same library for setup to be run to complete the migration process. We run that separately as a safety measure. J. Blodgett, oseda, 12-04. ----*; %let filetype=&sysparm; data _null_; file stdout; if "&sysparm"=" " then do; put 'Progam aborting - no value specified for sysparm (filetype)'; abort abend; end; else if fileexist("/pub/data/&filetype")=0 then do; put "Program aborting - /pub/data/&filetype does not exist"; abort abend; end; else put "Begin migration run for &filetype filetype"; stop; run; proc printto log="/pub/data/&filetype/Tools/migrate_&filetype..log" print="/pub/data/&filetype/Tools/migrate_&filetype..lst" new; run; x cd /pub/data/&filetype/Tools; %let pgm=migrate_&filetype; filename pgm "&pgm..sas"; *--Migrate SAS datasets to v9, 64-bit format---; data _null_; file pgm; put 'Program not saved but run using a filetype parm from migrate_filetype.sas in /pub/data/Tools'; run; %macro init; x cd /pub/data/&filetype; *<---go up to the data library from the Tools library--; data _null_; rc= system('mkdir v9'); *<---where we store the converted datasets temporarily before moving them back--; maxrc=max(maxrc,rc); rc= system('mkdir migrate_ods'); *<---where we stored the temporary ods files---; maxrc=max(maxrc,rc); file stdout; if maxrc ne 0 then do; put '****Initialization failed...program aborting ********' ; abort abend; end; else put "init macro run successfully for filetype &filetype"; stop; run; %mend init; %init ; %include '/pub/sasmacro/migrate_macros.sas'; *--downloaded from SAS web site, same as the template; options nocenter formdlim='-'; libname lib1 "/pub/data/&filetype"; libname &filetype (lib1); *<---alias required in order for the sql view to work--; libname lib2 "/pub/data/&filetype/v9"; libname ods "/pub/data/&filetype/migrate_ods"; title1 "Migrate &filetype Datasets to V9 64-bit Data Representation"; options nomprint; options nonotes; %before; options notes; proc migrate in=lib1 out=lib2; run; options nonotes nomprint; %after; *------------------------------------------------------* * produce validation output for all the data sets which * only prints a listing of those attributes which * differ between the source and target libraries *------------------------------------------------------*; %checkdata;