/************************************************************************************* The five SAS macros below enable you to sort the SAR SAS data set for platform mapping of aggregation metrics according to your specifications. The required input SAS data is available on the same site where this code is available. The following macros are provided: EColumns: columns by platform environment PMetrics: metric columns by performance area TColumns: columns by table FColumns: columns by funtion AColumns: columns that are common across all platforms Perform the following steps to customize this code. 1. Copy the SAR SAS data set to a folder on your SAS server. 2. Modify the libname statement path to point to the folder where you copied the SAR data set on your SAS server. 3. Modify the dataset name used when copying the SAR data set to your SAS server. 4. Comment and uncomment the desired macro invocations to execute the desired macros. *************************************************************************************/ /* Modify the libname statement path. */ libname SarData 'c:\Users\YourUserId\YourCode'; /* Modify the dataset name used to save your data set. */ %let SarDatasetName = Sar_Cross_Reference_Data; /* This macro lists columns that are present in individual platform environments. */ %macro EColumns(Env=); proc sql; create table Work.EColumns as select StagedTable, ColumnName, ColumnType, ColumnLabel, PerformanceArea, Notes from SarData.&SarDatasetName where &Env = 'X' order by StagedTable, ColumnType, ColumnLabel; quit; %mend; /* Comment and uncomment the desired macro calls by adding or removing an asterisk. */ %EColumns(env=aix); *%EColumns(Env=hpux); *%EColumns(Env=sun); *%EColumns(Env=linux); *%EColumns(Env=sco); /* This macro lists columns that are present by performance area. */ %macro PMetrics(PerfArea=); proc sql; create table Work.PMetrics as select StagedTable, ColumnName, ColumnLabel, aix, hpux, sun, linux, sco, Notes from SarData.&SarDatasetName where PerformanceArea = "&PerfArea" and ColumnType='Metric' order by StagedTable, ColumnLabel; quit; %mend; /* Comment and uncomment the desired macro calls by adding or removing an asterisk. */ %PMetrics(PerfArea=System); *%PMetrics(PerfArea=Cpu); *%PMetrics(PerfArea=Memory); *%PMetrics(PerfArea=Paging); *%PMetrics(PerfArea=Swap); *%PMetrics(PerfArea=Disk); *%PMetrics(PerfArea=Cache); *%PMetrics(PerfArea=Queueing); *%PMetrics(PerfArea=NetWork); /* This macro lists all columns for an ITRM defined table. */ %macro TColumns(Table=); proc sql; create table Work.TColumns as select ColumnName, ColumnLabel, ColumnType, PerformanceArea, aix, hpux, sun, linux, sco, Notes from SarData.&SarDatasetName where StagedTable = "&table" order by ColumnType, PerformanceArea, ColumnLabel; quit; %mend; /* Comment and uncomment the desired macro calls by adding or removing an asterisk. */ %TColumns(Table=SAR); *%TColumns(Table=SARCPUB); *%TColumns(Table=SARDEV); *%TColumns(Table=SARIFAC); /* This macro contains an sql procedures that lists ranked columns and computed columns across platform environments. */ %macro FColumns; proc sql; create table Work.ranked as select StagedTable, ColumnName, ColumnLabel, PerformanceArea, aix, hpux, sun, linux, sco, Notes from SarData.&SarDatasetName where substr(Notes,1,6) = 'Ranked' order by StagedTable, PerformanceArea, ColumnLabel; create table Work.computed as select StagedTable, ColumnName, ColumnLabel, PerformanceArea, aix, hpux, sun, linux, sco, Notes from SarData.&SarDatasetName where index(Notes,'Computed') > 0 order by StagedTable, PerformanceArea, ColumnLabel; quit; %mend; /* Comment or uncomment the macro call by adding or removing an asterisk. */ %FColumns; /* This macro contains an sql procedure that lists columns that are present in all Unix platform environments */ %macro AColumns; proc sql; create table Work.allenv as select StagedTable, ColumnName, ColumnLabel, PerformanceArea, Notes from SarData.&SarDatasetName where aix = 'X' and hpux = 'X' and sun = 'X' and linux = 'X' and sco = 'X' order by StagedTable, ColumnLabel; quit; %mend; /* Comment or uncomment the macro call by adding or removing an asterisk. */ %AColumns;