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

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

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
  • 8649 views
  • 0 likes
  • 7 in conversation