I have some macro variables that I want to concatenate together to rename a column in a table.
%let input_group = state;
%let input_id = zip;
data output;
set output;
rename var1= catx(_, &input_id, &input_group, '1');
run;
In my output table I want to rename the var1 column as zip_state_1. Is it possible to do this in a SAS datastep? It would be even better if I could do this in a proc sql step like below.
%let input_group = state;
%let input_id = zip;
proc sql;
create table output_2 as
select var1 as catx(_, &input_id, &input_group, '1')
from output_1;
Thanks!