1. The fa鏰de pattern is perhaps one of the most used ideas in the SAS macro language documentation. The idea is to
put complex code inside a macro, and simply present a macro variable interface which only contains certain unique
variables.
*/
/*dynamic reference of data by var name of a dataset */
libname sdata "E:\ChenyxFiles\2014.Study.TrainingCertificate\SAS.Victoria\SAS.DS2\SASUniversityEdition\myfolders\sData";
proc sql;
select memname from dictionary.tables where libname='SDATA'
;
quit;
proc sql;
select name from dictionary.columns where libname='WORK'
and memname=upcase('smBill');
quit;
proc sql;
select name from dictionary.columns where libname='SDATA'
and memname=upcase('sumDtHrPivot');
quit;
%macro batchBillProc(dataset);
proc freq data=&dataset.;
tables gapSec*dollarAmt/list missing;
run;
proc means data=&dataset.;
var gapSec dollarAmt;
run;
%mend batchBillProc;
%batchBillProc(dataset=sData.sumDtHrPivot);
No comments:
Post a Comment