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 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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