*----This setup (/pub/data/Tools/postmigrate_filetype.sas) is invoked in batch mode with a sysparm spec telling it which filetype (i.e. subdirectory of /pub/data) is to be processed. This is the postprocessing to complete the work begunb with migrate_filetype.sas in this same library. That setup creates the migrated sets in the temporary v9 subdir, while this setup moves those back over the orginal datasets in the filetype directory. We run this step separately as a safety measure. J. Blodgett, oseda, 12-04. ----*; %let filetype=&sysparm; %let pgm=postmigrate_&filetype; 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 POST-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" ; run; *=============================This is postmigrate_filetype.sas processing=================*; %let ok=0; data _null_; file stdout; rc = system(" cd /pub/data/&filetype ") ; if rc then stop; rc = system("rm -R migrate_ods"); if rc then stop; put "&filetype/migrate_ods directory deleted"; rc = system('mv v9/*.sas7b??? . '); if rc then stop; put "&filetype SAS datasets replaced with those from v9 subdirectory."; rc = system("rmdir v9"); if rc then stop; put "&filetype/v9 directory deleted"; rc= system('touch migrated_for_v9') ; if rc then stop; put "migrated_for_v9 file created in /pub/data/&filetype "; rc= system('contents -ur'); if rc then stop; put "&filetype Contents files updated"; call symput('ok','1'); stop; run; data _null_; file stdout; if &ok then put "PostProcessinbg (except for gendshtml step) completed for &filetype "; else do; put "PostProcessing for &filetype encountered an error and must be resubmitted ****"; abort abend; end; stop; run; libname &filetype "/pub/data/&filetype"; %macro dshtml; %if %sysfunc( exist(&filetype..datasets)) %then %do; %put We shall regegnerate the Datasets.html page ; %gendshtm(libname=&sysparm,runprocc=1); *--we use the sysparm ref because this macro has a parm named filetype and we do not want any confusion.--; data _null_; file stdout; put "Datasets.html page in /pub/data/&filetype has been updated."; run; %end; %else %do; %put ***No update to Datasets.html because no datasets dataset found***; data _null_; file stdout; put "***No update to Datasets.html because no &filetype..datasets dataset found***"; run; %end; %mend dshtml; %dshtml ;