BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
data_null__
Jade | Level 19

Since PROC APPEND is a statement in PROC DATASET I think you should at least nest the repeated APPENDs in PROC DATASETS.  If SAVE statement is not be appropiate you can just gen a DELETE for the list of APPEND data sets.

data D0912 D0913 D0914 D0915;

   set sashelp.class;

   run;

%let base=D0912;

proc sql noprint;

   select catx(' ','APPEND BASE=',"&base",'DATA=',memname,';') into :append

      from dictionary.members

      where libname eq 'WORK' and upcase(memname) ne %upcase("&base");

   quit;

   run;

proc datasets;

   &append;

   run;

   save &base;

   run;

   quit;

Ksharp
Super User

I think Art's code is good enough except for typing some more words. It is very fast way for large tabls.

Keep in mind that SAVE statement will only keep the &base , other tables will be deleted include other  needed tables, so you should be careful to use it.

Ksharp

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 16 replies
  • 8383 views
  • 0 likes
  • 7 in conversation