LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (March 2010, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Mon, 8 Mar 2010 17:47:09 -0800
Reply-To:   xlr82sas <xlr82sas@AOL.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   xlr82sas <xlr82sas@AOL.COM>
Organization:   http://groups.google.com
Subject:   Re: Running SAS on PC, need to delete old compiled macro
Comments:   To: sas-l@uga.edu
Content-Type:   text/plain; charset=ISO-8859-1

On Mar 8, 3:02 pm, ya.hu...@AMYLIN.COM (Ya Huang) wrote: > Check out this old thread: > > http://listserv.uga.edu/cgi-bin/wa?A1=ind0607c&L=sas-l#164 > > I think the conclusion is not to permanently compile the macro, > instead, %include the source and it will be compiled on the fly. > > On Mon, 8 Mar 2010 15:15:11 -0500, SUBSCRIBE SAS-L Dan > > > > > > <deniseyu...@GMAIL.COM> wrote: > >Hi. SASLers: > > >I have been running SAS using VMS and batch submit for some time. I am > >switching to SAS windows interactively. At present when I run the program, > >I have logs accumulate from last time run. That is not a big deal as long > >as I clear log window every time. However, when come to Sasmacr "catalog" > >in work directory, I am having the real problem. I stored the macros at my > >hard disk and I use the following options: > >options sasautos=('C:\Mymacrolocation'); > >After first time the macros compiled, it will not recompile even if I > >modify the macro code at its physical location. What I have to do is to > >physically get into the Sasmacr at work directory and delete them manully. > > >Is there a program way to delete compiled macro when I run the program? I > >tried the following: > > > proc datasets library=work kill; > > >and I got these messages: > > >NOTE: Deleting WORK.SASMACR (memtype=CATALOG). > >NOTE: File WORK.SASMACR (memtype=CATALOG) cannot be deleted because it is > >in use. > > >I also interested in deleting the macro vaiables compiled from previous > run. > > >To be short, I want to mimic the running process as close as possible to > >batch submit. In other words, I want to run program "fresh" every time. > > >Thanks. > > >Dan- Hide quoted text - > > - Show quoted text -

Hi,

This is an important issue for interactive users, I have a macro I will add to my tips that basically resets everthing back to were it was when you invoked SAS. You do have to put an optsave in your autoexec though. You do not need to go to my site for the answer to your question, I pasted the code below.

Here is my current tip for deleting all macros except the one that is resetting the environment

for a cleaner version and eventual utl_resetenv macro see

/* T002150 CLEAR ALL COMPILED MACROS AND ALL GLOBAL MACRO VARIABLES */ note local macro variables disapear after the macro compiles.

in

http://homepage.mac.com/magdelina/.Public/utl.html utl_tipweb.sas

/* T002150 CLEAR ALL COMPILED MACROS AND ALL GLOBAL MACRO VARIABLES */ *clear compiled macros; proc catalog catalog=work.sasmacr; %* CLEAR compiled macros *; contents out=_tempcompmacs; quit; proc sql noprint; select distinct(name) into :work_compiled_macros separated by ' ' from _tempcompmacs where upcase(name) ne 'UTL_REINVOKE'; quit; proc catalog catalog=work.sasmacr; delete &work_compiled_macros / ET = macro; quit;

*clear all global macro vars; data _delgvars; %* CLEAR ALL GLOBAL VARS *; set sashelp.vmacro (where=( scope='GLOBAL' & name not in ('AFTLAST' 'SYSROOT' 'SYSLEVEL') )); run; proc sort data=_delgvars nodupkey; by name; run; data _null_; set _delgvars; call execute('%symdel ' !! trim(left(name)) !! ';'); run;


Back to: Top of message | Previous page | Main SAS-L page