Desktop productivity for business analysts and programmers

How can I avoid showing result tables from data step or proc SQL in the Process Flow

Reply
Frequent Contributor
Posts: 87

How can I avoid showing result tables from data step or proc SQL in the Process Flow

[ Edited ]

 

When I run the following code...

 

 

 

Data Have01;
  Input MyVar $ Date Date9.;
  Format Date Date9.;
  Datalines;
z101    04JAN16
z102    08JAN16
z103    12JAN16
;
Run;

Data Dates01 (Keep=Date);
  Format Date Date9.;
  Do i=0 To 365;
    Date=IntNX('day','01JAN2016'd,i);
	Output;
  End;
Run;

Proc SQL;
  Create Table Var As Select Distinct MyVar From Have01 Order By MyVar;
Quit;

Proc SQL;
  Create Table Want01 As Select * From Var, Dates;
Quit;

 

I get the following results...

 

res01.png

 

 

Is there any method that the result on workspace should be only HAVE01 and all other tables should not appear? I just want end result table to be there and not other three. Something like this..

 

res02.png

 

Thanks.

 

Super User
Posts: 10,592

Re: How can I avoid printing result tables in data step or proc SQL

Posted in reply to imanojkumar1

Use proc delete to remove datasets that are no longer needed. EG usually detects this from the log.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Frequent Contributor
Posts: 87

Re: How can I avoid printing result tables in data step or proc SQL

[ Edited ]
Posted in reply to KurtBremser

Ohh I got it... first I tried..

 

proc datasets lib=work;
    delete HAVE01 DATE01 VAR;
quit;

 

 

Then I tried... and It worked.....

 


Proc Delete Data = work.Date01 work.Have01 work.VAR;    *This will delete these datasets in work;
 run;

 

 

Thanks for helping.

Super User
Posts: 10,592

Re: How can I avoid printing result tables in data step or proc SQL

Posted in reply to imanojkumar1

Just do

proc delete data=
  have01
  date01
  var
;
run;

The syntax is described here: DELETE Procedure

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Super User
Super User
Posts: 9,855

Re: How can I avoid printing result tables in data step or proc SQL

Posted in reply to imanojkumar1

Well, I don't know EG that well, but I suppose after your code you could add:

proc datasets lib=work;
  delete dates01 var;
quit;
run;

However that being said, looking at your code I don't see the reasoning in all those datasets simply:

data have;
  input myvar $ date date9.;
  format date date9.;
  datalines;
z101    04JAN16
z102    08JAN16
z103    12JAN16
;
run;

data want;
  set have;
  format mydate date9.;
  do mydate="01JAN2016"d to "31DEC2016"d;
    output;
  end;
run;

Achieves the same result?  What is the point of the variable "date" in the have?  Also, not a good idea to call things VAR and DATE as these are keywords, use something descriptive of your data.

Ask a Question
Discussion stats
  • 4 replies
  • 324 views
  • 1 like
  • 3 in conversation