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 (February 2002, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Mon, 4 Feb 2002 15:17:00 -0800
Reply-To:   Dale McLerran <stringplayer_2@YAHOO.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Dale McLerran <stringplayer_2@YAHOO.COM>
Subject:   Re: pseudo-recursive SAS Macro
Comments:   To: "Fehd, Ronald J." <rjf2@CDC.GOV>
In-Reply-To:   <9D17D648E4EBD311AD45009027D0DF9302EAE7F4@MCDC-ATL-64>
Content-Type:   text/plain; charset=us-ascii

Ron,

Indeed, I had noticed the "pseudo" qualifier in the subject. I hadn't had time to look at the code previously, but I still had to rise to the bait. I knew whom you were trolling for! It was worth it just to get the LOL.

But after a cursory look at the article, I would have to state this: The authors are wrong that SAS does not have a stack and maintain local and global variable assignments. OK, the base language does not provide these services. But the macro language itself does indeed provide these services. Thus, for some of the work which I do in which I need to nest loop after loop after loop to depth specified at runtime, the macro language does a terrific job of recursion. But I am not manipulating data recursively. I am recursively manipulating the code which manipulates the data. This is important for anyone monitoring this thread to understand. I know that Ron knows all this. For anyone new to SAS programming who is familiar with recursion in other languages, recursion in SAS may not be as useful. But in its proper place, there is room for macro recursion in SAS. Unfortunately, the Observations article which Ron stumbled on does not actually effect recursion, so the utility of macro recursion is not really displayed.

But, maybe I'll convince you yet, Ron, that SAS does have true recursive programming capability! At least you were interested in looking at the Observations article. Still, it was probably the pseudo qualifier which convinced you to take a look. (Sigh.)

Dale

--- "Fehd, Ronald J." <rjf2@CDC.GOV> wrote: > > From: Dale McLerran [mailto:stringplayer_2@YAHOO.COM] > > OK, who is the imposter who has hacked Ron's account?! It couldn't > > be the macro-meister himself who posts something positive about > > recursion in the SAS language! ;) > > LOL I knew I'd flush you out, Dale. > as the subject says: PSEUDO-recursive > Fascinating article, as he says: > "... implement some of that [razzle-dazzle] stuff > they showed you in Pascal." > > I wonder if we could put in a loop for the labels > and make it work with any depth? > > > --- "Fehd, Ronald J." <rjf2@CDC.GOV> wrote: > > > Whilst cruising the SAS website recently I came across this gem. > > > Who was I taking to task a while back for writing a recursive > macro? > > > Observations > > > A Pseudo-Recursive SAS Macro > > > William E. Benjamin , Jr. > > > > > > http://www.sas.com/service/library/periodicals/obs/obswww18/index.html > > > > > > Ron Fehd the macro maven CDC Atlanta GA USA RJF2@cdc.gov > >

===== --------------------------------------- Dale McLerran Fred Hutchinson Cancer Research Center mailto: dmclerra@fhcrc.org Ph: (206) 667-2926 Fax: (206) 667-5977 ---------------------------------------

__________________________________________________ Do You Yahoo!? Great stuff seeking new owners in Yahoo! Auctions! http://auctions.yahoo.com


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