Date: Wed, 4 Feb 2004 11:26:35 -0500
Reply-To: "DePuy, Venita" <depuy001@DCRI.DUKE.EDU>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "DePuy, Venita" <depuy001@DCRI.DUKE.EDU>
Subject: Re: Macro function %symdel
Content-Type: text/plain
Yes.
Wonderful little macro.
I think I got it off a SUGI paper, but unfortunately I didn't put the source
in my code.
(My apologies to the author)
-Venita
%macro delvars; *clears out all global macros;
data vars; set sashelp.vmacro; run;
data _null_; set vars;
if scope='GLOBAL' then call execute('%symdel '||trim(left(name))||';');
run;
%mend;
%delvars
> ----------
> From: Erik013@AOL.COM[SMTP:Erik013@AOL.COM]
> Reply To: Erik013@AOL.COM
> Sent: Wednesday, February 04, 2004 11:12 AM
> To: SAS-L@LISTSERV.UGA.EDU
> Subject: Macro function %symdel
>
> Hello fellow SAS-Lers,
>
> I am sure a good number of you know that in SAS v. 8.2 a new macro
> function %symdel was introduced to delete a macro variable from a SAS
> session. For example,
>
> %symdel strata;
>
> Would remove the macro variable strata from the system completely (as if
> it never existed).
>
> THE QUESTION I HAVE IS: Is there a way to remove ALL macro variables
> (such as a %symdel _all_) easily??? Any help on this would be greatly
> appreciated. Thanks!!!!
>
> Erik
>
> --
> Erik S. Larsen
> Independent Consultant
> PO Box 505
> Charleston, SC 29401
>
> A SAS Alliance Consulting Partner Silver Member
> A SAS Certified Professional V8
>
> (843) 367-2862 (SC office)
> (703) 568-3083 (VA office)
> (801) 681-3281 (fax)
>
|