BookmarkSubscribeRSS Feed
sebster24
Quartz | Level 8

inHey People,

I hope all is well. I am not expert in SAS; but strive to definitely learn more of this program.

MY SITUATION:

I am currently undertaking a project with deals with a lot a datasets placed under different libraries. I have created multiple %macro definitions which in turn has generated many output tables and utilised many input tables. These tables are saved under different libraries.

MY ISSUE:

My computer slows down when these datafiles are created. Clearing unwanted tables in every macro program session speedens up computational response.

My QUERY:

Is there a way to generate a list of input and output tables created either using PROC SQL or DATA steps by EACH MACRO PROGRAM? Each MACRO PROGRAM has multiple %macros, once again from code readability purposes. Prefixing/suffixing the datafiles with 'IN' or 'OUT' statements does not help. This would help me in data management. All help is appreciated. thanks. seb

4 REPLIES 4
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Have a look at SASHELP.VCOLUMNS/VTABLES.  You can create lists from there.

RW9
Diamond | Level 26 RW9
Diamond | Level 26

Just to quantify myself, sorry for the brief post, am in meetings.  What I would suggest is that you have some kind of logical assignment, so either have a set of libraries which hold you datasets, or have a fixed pre-fix you could search for.  Then its just a matter of querying the SAS metadata tables - SASHELP, or as Kurt has mentioned DICTIONARY in SQL.  Pull these out as a list of datasets to evaluate.  To remove them something like:

data _null_;

     set sashelp.vtable (where=(libaname="STORE")) end=last;

     if _n_=1 then call execute('proc datasets library=store; delete ');

     call execute(strip(NAME));

     if last then call execute(';quit;');

run;

Ksharp
Super User

DICTIONARY.MEMBERS would be faster .

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 620 views
  • 0 likes
  • 4 in conversation