Hi, folks. I am trying to run this code. The purpose is to use the variables of var list which are changing over time in another macro. %let DEAScorelist=x501 x502 x503;
%macro Do_Forme:
data _null_;
%do i=1 to %sysfunc(coutw(&DEAscorelist));
%let DEA_score= %scan(&DEAscorelist,&i);
length line $300;
%do DTS = 2007 to 2014;
UTS=DTS+&PT.-1;
DHS=DTS+&PT.;
UHS=DTS+&PT.+&PH.-1;
SDTS=put(DTS,4.);
SUTS=put(UTS,4.);
SDHS=put(DHS,4.);
SUHS=put(UHS,4.);
DT=substr(SDTS,3,2);
UT=substr(SUTS,3,2);
DH=substr(SDHS,3,2);
UH=substr(SUHS,3,2);
line = cats('%nrstr(%merge_scores_results(DTS=', DTS, ',UTS=', UTS, ',DHS=', DHS, ',UHS=', UHS, ',DT=', DT, ',UT=',UT, ',DH=' ,DH, ',UH=' ,UH, ',DEA_score=' ,DEA_score, '));');
call execute(line);
%end;
%end;
run;
%mend Do_Forme;
%Do_Forme; Would you please help. Thanks
... View more