/****************************************************************************/ /* Copyright (c) 2008 by SAS Institute Inc., Cary, NC 27513, USA */ /* All Rights Reserved. */ /* */ /* Name: mo_migration_hf.sas */ /* */ /* Purpose: Add two new columns to the SCENARIOS table in the MO 5.1 */ /* datastore after applying the hot fix for MO 5.1. */ /* */ /* */ /* Usage: 1. BACK UP the existing SCENARIOS table in the datastore! */ /* 2. Start an interactive SAS session with the MO 5.1 autoexec */ /* and execute this program in the Program Editor. */ /* 3. Verify it completes successfully with no ERRORs or WARNINGs */ /* in the log. */ /* */ /****************************************************************************/ %macro mo_migration_hf; data _null_; length path $4096.; path=pathname('MOMETA'); call symput('metapath', strip(path)); run; %if (%bquote(&metapath) eq %str()) %then %do; %put ERROR: Could not locate the MO datastore.; %put ERROR: Make sure SAS is running with the MO autoexec.sas file.; %put ERROR: Also make sure the SAS/SHARE server is running.; %end; %else %do; %mo_create_tables(lib=work, table=scenarios) proc contents data=work.scenarios out=work.scenarios_table_contents noprint; run; proc contents data=mometa.scenarios out=work.mometa_scenarios_contents noprint; run; %let sp_applied = 0; %let migration_applied = 0; proc sql noprint; select count(*) into :sp_applied from work.scenarios_table_contents where upcase(name) = 'AUTO_PROMOTE_FLAG'; select count(*) into :migration_applied from work.mometa_scenarios_contents where upcase(name) = 'AUTO_PROMOTE_FLAG'; quit; %if &sp_applied = 1 %then %do; %if &migration_applied = 0 %then %do; data mometa.scenarios; set work.scenarios mometa.scenarios; auto_promote_flag = 0; promote_num_communications = 0; run; %end; %else %do; %put NOTE: The hot fix migration program has already been run. No further migration is necessary.; %end; %end; %else %do; %put ERROR: The hot fix has not been applied yet. You should not migrate the MO datastore until the hot fix has been applied.; %end; %end; %mend mo_migration_hf; %mo_migration_hf;