user14141770
user14141770

Reputation: 11

SAS macro to append datasets based on dataset name in work library

I want to write a macro that will automatically identify datasets in my work library with names as PCT_202007, PCT_202008 and append them to final work table. How can I do this?

Upvotes: 1

Views: 139

Answers (1)

PeterClemmensen
PeterClemmensen

Reputation: 4937

No need for a macro. Use the colon operator like this:

data pct_202007; set sashelp.class; run;
data pct_202008; set sashelp.class; run;
data pct_202009; set sashelp.class; run;

data want;
   set work.pct_:;
run;

Upvotes: 3

Related Questions