I need to import multiple years' access tables into SAS. In each year's ACCESS DB, the table name has year as the suffix. For example: table2021.
I first define a macro variable year. Then I am trying to replace the suffix of the table name to be the name of the macro variable.
I have a list of tables that I need to import. The list has a column "tablename" storing the table name.
%let year=2021;
data tables;
set tables;
tablename = tranwrd(name, "&year", ""&year"");
run;
it doesn't work. I have searched and cannot find an answer.
Thank you so much! Lin