Hi @Tom, @ballardw, and @PaigeMiller, Thank you all for your help with this issue. I devised an alternate approach that I believe may work, where I reference a macro program within a macro program. The code I wrote is below, and it appears to work. I think I will go this route for now. Thank you again for your help. I would appreciate your thoughts on this code as well because, if it proves to have created the desired results, I plan to replicate this method throughout. Thanks, Ted %macro rename(pref);
&pref.AgeUnd_15=AgeUnd_15; &pref.Age15_17=Age15_17; &pref.Age18_19=Age18_19;
&pref.Age20_24=Age20_24; &pref.Age25_29=Age25_29; &pref.Age30_34=Age30_34;
&pref.Age35_39=Age35_39; &pref.Age40_44=Age40_44; &pref.AgeOver_44=AgeOver_44;
&pref.Total=Total;
%mend;
%macro age_gender(year,n);
data age_gender&year;
infile "&path\Table 1 - Unduplicated Users by Age and Gender &year..csv" firstobs=6 obs=&n dsd;
input Site :$35. Gender $ AgeUnd_15 Age15_17 Age18_19 Age20_24 Age25_29 Age30_34 Age35_39 Age40_44 AgeOver_44 Total;
year=&year;
if propcase(gender)='Female' then %rename(Fem);
if propcase(gender)='Male' then %rename(Male);
if propcase(gender)='Unknown' then %rename(Unk);
if propcase(gender)='Total' then %rename(Tot);
if gender='--- Null' then %rename(Null);
drop AgeUnd_15 Age15_17 Age18_19 Age20_24 Age25_29 Age30_34 Age35_39 Age40_44 AgeOver_44 Total;
run;
%mend;
%age_gender(2015,210);
%age_gender(2016,207);
%age_gender(2017,205);
... View more