Building models with SAS Enterprise Miner, SAS Factory Miner, SAS Visual Data Mining and Machine Learning or just with programming

how to delete a table in work

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 76
Accepted Solution

how to delete a table in work

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


Accepted Solutions
Solution
‎08-03-2012 08:09 AM
SAS Super FREQ
Posts: 683

Re: how to delete a table in work

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


All Replies
New Contributor
Posts: 4

how to delete a table in work


Ashwini,

Refer the following link . Page 8 , SectionSmiley Very Happyeleting

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

Hope that helps

Solution
‎08-03-2012 08:09 AM
SAS Super FREQ
Posts: 683

Re: how to delete a table in work

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

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

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