Date: Thu, 17 Nov 2011 16:19:04 -0500
Reply-To: Quentin McMullen <qmcmullen.sas@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Quentin McMullen <qmcmullen.sas@GMAIL.COM>
Subject: Re: clear SASMACR before submitting code
In-Reply-To: <01384B2401936142AF5F65E3D12402780B775187@EX3VS1.nyced.org>
Content-Type: text/plain; charset=ISO-8859-1
Hi,
I'd be interested to hear if you have any problems with manually
deleting macros this way.
I was playing with a similar approach earlier this year. I had a
macro %ResetSession() that tried to set the environment to the
"default" (so deleted work datasets, librefs, etc.)
I found that when I deleted the macros using PROC CATALOG, I would
intermittently have problems where a macro that existed in the
autocall library would not be (re)compiled after the compiled macro
was deleted from SASMACR. So I ended up turning on mrecall, and that
fixed the problem. But I don't think mrecall should have been
necessary, and I was nevery happy with the "solution".
I see that 9.3 has a new macro statement: %SYSMACDELETE . Haven't
played with it, but that might be a "safer" way to delete macro
definitions....
--Q.
On Thu, Nov 17, 2011 at 2:13 PM, Bolotin Yevgeniy
<YBolotin@schools.nyc.gov> wrote:
> That only works if the macro definition could not be found (it will keep
> looking for it)
>
> If the macro has already been loaded into SASMACR, mrecall has no effect
> :(
>
>
> -----Original Message-----
> From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
> Fehd, Ronald J. (CDC/OCOO/ITSO)
> Sent: Thursday, November 17, 2011 1:09 PM
> To: SAS-L@LISTSERV.UGA.EDU
> Subject: Re: clear SASMACR before submitting code
>
> proc options define value option= mrecall;
>
> may be simpler for your needs than deleting the catalog.
>
> Ron Fehd macro maven
>
>> -----Original Message-----
>> From: owner-sas-l@listserv.uga.edu
> [mailto:owner-sas-l@listserv.uga.edu]
>> On Behalf Of Bolotin Yevgeniy
>> Sent: Thursday, November 17, 2011 11:30 AM
>> To: SAS-L@listserv.uga.edu
>> Subject: clear SASMACR before submitting code
>>
>> My google-fu is weak this morning...
>>
>>
>> I want to execute the following statement whenever I run any code
> (using
>> F3, or the run button, or whatever - figuring out at least one will
> allow me to
>> do all):
>>
>> proc catalog CATALOG=sasmacr et=MACRO force kill; quit;
>>
>> (that is, delete all macros in the SASMACR library, to ensure all
> autocalls get
>> properly reloaded before the run)
>>
>>
>> however, mapping it to the RUN button doesn't work*, and I can't
> figure out
>> how to make it run (rather than insert) using the keyboard macro
>> functionality
>>
>> *i.e. if the button has "proc catalog CATALOG=sasmacr et=MACRO force
> kill;
>> quit; SUBMIT;" then only the submit will work. Oddly enough, "%put
>> a;SUBMIT;" will print the "a" before executing code, but I thought I'd
> toss
>> the question out there before digging into it myself :P
>>
>>
>>
>> So, really, two questions:
>> 1) how can I do this?
>> 2) will this break partial submits? (e.g. if I forget to select the
> "%mend;"
>> when running a macro declaration and then do that as a separate run,
> will
>> the proc catalog become part of the macro definition?) (it doesn't
> with the
>> "%put a;", but who knows)
>
|