How can I change this macro to create all the variables in one data set? I want First_ADD and Second_ADD in the out flag data set. I want to do this for multiple varibles using the macro but it keeps overwriting itself and keeping the last flag that was created by the macro. Thank you!
%MACRO FLAG(VAR1,VAR2,FLAGNAME); DATA FLAG; SET RULE1; &FLAGNAME=0; DO _N_=1 to countw(&VAR1,',') while(&FLAGNAME=0); word=scan(&VAR1,_N_,','); if word=' ' then continue; if indexw(trim(&VAR2),trim(word),',') then &FLAGNAME=1; end; drop word; run; %MEND FLAG;
%FLAG(Addresses1,Addresses2,First_ADD); %FLAG(Addresses1,Addresses3,Second_ADD);
... View more