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 (September 2002, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 26 Sep 2002 16:01:01 -0400
Reply-To:     Quentin McMullen <QuentinMcMullen@WESTAT.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Quentin McMullen <QuentinMcMullen@WESTAT.COM>
Subject:      Re: Deleting a macro variable? SYMDEL FLUFF
Comments: To: "Fehd, Ronald J. (PHPPO)" <rjf2@CDC.GOV>
Content-Type: text/plain; charset="iso-8859-1"

> From: Fehd, Ronald J. (PHPPO) [mailto:rjf2@CDC.GOV] > > From: Ian Whitlock [mailto:WHITLOI1@WESTAT.com] > > What is your system smoking? > > Mine is SAS 8.2 under Windows 98. > > Maybe you need an anti-smoking patch for your 8.2. > > by golly, you're right, Ian! > Little Birdies must have read my whining note to TechSupport > in v8.(<2) > and took pity on me for trying to set %global macro variables > in one macro > and then try to erase them in another macro. > > Note to Self: go find and fix that > call execute('%symdel ' !! "&MVAR."); > inside my second macro. >

Indeed,

Even if you *tried* to use symdel to delete a local macro variable, it won't work. Below shows that with a global and local macro variable of the same name, %symdel inside a macro will delete the global var. Which is in line with the help info: "%symdel Deletes the specified variable(s) from the MACRO global table"

I guess if someone wanted to delete a local macro variable, they're out of luck. But that seems fair, since local macro vars are kind enough to go away by themselves...

4281 %let junk=1; /*global macro var &junk*/ 4282 %macro me; 4283 %local junk; /*local &junk*/ 4284 %let junk=2; /*local &junk*/ 4285 %symdel junk; /*deletes global &junk*/ 4286 %put junk=&junk; /*puts local &junk*/ 4287 %mend me; 4288 %me junk=2 4289 %put junk=&junk; WARNING: Apparent symbolic reference JUNK not resolved. junk=&junk

Kind Regards, --Quentin


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