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

Kindly explain me how to delete a table from the work through di studio  if it is generated from the di studio transformation.

Thanks,

Regards,

Ashwini

1 ACCEPTED SOLUTION

Accepted Solutions
BrunoMueller
SAS Super FREQ

Hi Ashwini

In general the intermediate result tables/views are automatically deleted at the end of a job, since they are in the WORK library.

If you want to delete them earlier you could add a User Written transformation and add your own code to delete the tables/views. You can simply connect the result tables/views from transformation to your User Written transformation. The code below will delete all the tables which are connected to the User Written transformation. Please be careful about when to run this transformation, as it might delete tables/views which are needed in subsequent transformations

%macro myDelete;
 
%local i;

  proc sql;
   
%do i = 1 %to &_INPUT_count;
      %if &&_input&i._memtype = DATA %then %do;
        drop table &&_input&i;
     
%end;

     
%if &&_input&i._memtype = VIEW %then %do;
        drop view &&_input&i;
     
%end;
   
%end;
  quit;

%mend;

%
myDelete

See also attached picture what it might look like

myDelete.PNG

Bruno

View solution in original post

2 REPLIES 2
Amruta
Calcite | Level 5


Ashwini,

Refer the following link . Page 8 , Section:Deleting

http://support.sas.com/publishing/pubcat/chaps/59353.pdf

Hope that helps

BrunoMueller
SAS Super FREQ

Hi Ashwini

In general the intermediate result tables/views are automatically deleted at the end of a job, since they are in the WORK library.

If you want to delete them earlier you could add a User Written transformation and add your own code to delete the tables/views. You can simply connect the result tables/views from transformation to your User Written transformation. The code below will delete all the tables which are connected to the User Written transformation. Please be careful about when to run this transformation, as it might delete tables/views which are needed in subsequent transformations

%macro myDelete;
 
%local i;

  proc sql;
   
%do i = 1 %to &_INPUT_count;
      %if &&_input&i._memtype = DATA %then %do;
        drop table &&_input&i;
     
%end;

     
%if &&_input&i._memtype = VIEW %then %do;
        drop view &&_input&i;
     
%end;
   
%end;
  quit;

%mend;

%
myDelete

See also attached picture what it might look like

myDelete.PNG

Bruno

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 choose a machine learning algorithm

Use this tutorial as a handy guide to weigh the pros and cons of these commonly used machine learning algorithms.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 3382 views
  • 0 likes
  • 3 in conversation