***** GET NUMBER OF LEVELS/SCHOOLS. *****; data _null_; set schools nobs=numobs; if _n_=1; call symput('numschools',compress(put(numobs,15.))); run;
***** GET DATE AS MACRO VARIABLE. *****; data _null_; call symput('rundate',trim(left(put(today(),worddate.)))); run;
***** PRINT FOR EACH SCHOOL. *****; %macro schrpts;
%do schoolcnt=1 %to &numschools;
***** GET NEXT SCHOOL. *****; data _null_; set schools; if _n_=&schoolcnt; call symput('school',trim(tranwrd(school,'- Charter',''))); run;
proc export data=final (where=(school="&school")) outfile="C:\Users\gb\Google Drive\&school.\Alt Assess\AltAssessRoster_&sysdate. - &school..xlsx" dbms=xlsx replace; run; ***** END SCHOOL LOOP. *****; %end;
%mend schrpts;
%schrpts;
... View more