Date: Thu, 5 Dec 2002 13:27:39 -0500
Reply-To: Quentin McMullen <Quentin_McMullen@BROWN.EDU>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Quentin McMullen <Quentin_McMullen@BROWN.EDU>
Subject: Re: Macro Variables: Deleting
In-Reply-To: <F0161D3F7AC5D411A5BE009027E774D60409DD7A@gemmrd-scc013eu.gem.cibc.com>
Content-Type: text/plain; charset="iso-8859-1"
Harry Droogendyk wrote:
> Subject: Re: Macro Variables: Deleting
>
> %let var1 = 2345;
> %let a = abcd;
> %let z = qwer;
>
> %put _user_;
>
> proc sql noprint;
> select name
> into :mvars separated by ' '
> from sashelp.vmacro
> where scope ne 'AUTOMATIC'
> ;
> quit;
>
> %symdel &mvars mvars;
>
> /* All gone? Except for &sql* variables */
> proc sql;
> select *
> from sashelp.vmacro
> where scope ne 'AUTOMATIC'
> ;
> quit;
I think they really are All Gone after the %symdel statement (i.e. even the
&sql* variables get deleted). It's just that when you run the second proc
sql step to check, they get regenerated. If you change the last step to a
data step, it will show that there are no maco variables with scope other
than 'AUTOMATIC'.
126 %let var1 = 2345;
127 %let a = abcd;
128 %let z = qwer;
129
130 %put _user_;
GLOBAL Z qwer
GLOBAL VAR1 2345
GLOBAL A abcd
131
132 proc sql noprint;
133 select name
134 into :mvars separated by ' '
135 from sashelp.vmacro
136 where scope ne 'AUTOMATIC'
137 ;
138 quit;
NOTE: PROCEDURE SQL used:
real time 0.01 seconds
cpu time 0.01 seconds
139
140 %symdel &mvars mvars;
141
142 data _null_;
143 set sashelp.vmacro;
144 put _all_;
145 where scope ne 'AUTOMATIC';
146 run;
NOTE: There were 0 observations read from the data set SASHELP.VMACRO.
WHERE scope not = 'AUTOMATIC';
NOTE: DATA statement used:
real time 0.01 seconds
cpu time 0.01 seconds
Kind Regards,
--Quentin