Date: Wed, 7 Nov 2007 11:19:14 -0800
Reply-To: "Terjeson, Mark" <Mterjeson@RUSSELL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Terjeson, Mark" <Mterjeson@RUSSELL.COM>
Subject: Re: how to delete all previous results at the beginning of each
program?
In-Reply-To: A<4731B9E7.E137.00EA.3@chapinhall.org>
Content-Type: text/plain; charset="us-ascii"
Hi Duckhye,
The command for PC as you mention below would be
the PC drive and path wherever the sas.exe is
located such as:
C:\blah\blah\sas.exe
and for Unix it would be wherever the sas
executable file is located such as:
/blah/blah/sas
Hope this is helpful.
Mark Terjeson
Senior Programmer Analyst, IM&R
Russell Investments
Russell Investments
Global Leaders in Multi-Manager Investing
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
Duck-Hye Yang
Sent: Wednesday, November 07, 2007 11:13 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Re: how to delete all previous results at the beginning of each
program?
I guess that the command "...sas.exe -noterminal -sysin myProgram.sas"
is for PC. Am I right?
Could you please let me know its unix command?
Thanks,
Duckhye
>>> "Richard A. DeVenezia" <rdevenezia@WILDBLUE.NET> 11/7/2007 11:17 AM
>>>
Richard wrote:
> How to write the code in the program?
dm 'odsresults; clear';
Here is an example:
------------------------------------
%* clear windows;
dm 'clear log; clear listing;odsresults; clear';
%* delete work members;
proc datasets nolist lib=work kill;
%* delete compiled macros;
%sysfunc(ifc(%sysfunc(cexist(work.sasmacr)),proc catalog
cat=work.sasmacr
force kill;,))
quit;
%* delete all macro variables;
data _null_;
set sashelp.vmacro;
where scope = 'GLOBAL';
where also name ne 'SYSODSPATH';
call execute('%nrstr(%symdel '||name||');');
run;
%macro foo;
%mend;
%let year=2007;
ods listing;
ods html file="%sysfunc(pathname(WORK))\report.html";
proc print data=sashelp.class;
proc print data=sashelp.class;
proc print data=sashelp.class;
proc print data=sashelp.class;
proc print data=sashelp.class;
run;
ods _all_ close;
------------------------------------
Note: The BEST WAY to get a clean SAS session is to submit the program
in
batch mode:
...sas.exe -noterminal -sysin myProgram.sas
--
Richard A. DeVenezia
http://www.devenezia.com/