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

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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