/*The decorator pattern provides a way to add code either
before or after this sumGapSec.*/
/*dynamic reference of data by var name of a dataset */
libname sdata "E:\ChenyxFiles\2014.Study.TrainingCertificate\SAS.Victoria\SAS.DS2\SASUniversityEdition\myfolders\sData";
%macro sumGapSec(mGapSec);
proc sql;
select sum(&mGapSec) as sumGapSec from sData.smBill;
quit;
%mend sumGapSec;
%macro decoratorBefore(parameters);
%put Before;
%sumGapSec¶meters.;
%mend decoratorBefore;
%macro decoratorBeforeAndAfter(parameters);
%put Before;
%sumGapSec¶meters.;
%put After;
%mend decoratorBeforeAndAfter;
%macro decoratorAfter(parameters);
%sumGapSec¶meters.;
%put After;
%mend decoratorAfter;
%decoratorBeforeAndAfter(parameters=(gapSec));
%decoratorBefore(parameters=(gapSec));
%decoratorAfter(parameters=(gapSec));
No comments:
Post a Comment