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 (April 2007, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Sun, 1 Apr 2007 22:14:51 -0700
Reply-To:   David L Cassell <davidlcassell@MSN.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   David L Cassell <davidlcassell@MSN.COM>
Subject:   Re: Is there a way to pass a macro to another macro?
In-Reply-To:   <1934F70034988F4FB907B7D364F8D412049C1873@exchg-sea5-04.ant.amazon.com>
Content-Type:   text/plain; format=flowed

scottwh@AMAZON.COM wrote: > >Hi folks, > >I was wondering if there was a way to pass a macro into another macro. >For example, say I have the following macro: > >%macro select1(); > select count(apples) from sometable; >%mend; > >%macro select2(); > select count(oranges) from sometable; >%mend; > > >%macro run_query(query) > > <Do stuff...> > > proc sql .... > <Run the query macro here> > > <Do other stuff...> > >&mend; > >Then I could the same run_query macro with either of the select macros >passed into it. Is this possible? > >Thanks, >Scott

Umm, what are you trying to do here?

Are you trying to *pass* a macro into another macro, or are you trying to pass a *parameter* to another macro, or are you trying to add a parameter to a macro call to improve an old macro?

Try not to make things too complicated. That's not good for the most important kind of efficiency: programmer efficiency. :-)

HTH, David -- David L. Cassell mathematical statistician Design Pathways 3115 NW Norwood Pl. Corvallis OR 97330

_________________________________________________________________ It’s tax season, make sure to follow these few simple tips http://articles.moneycentral.msn.com/Taxes/PreparationTips/PreparationTips.aspx?icid=HMMartagline


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