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 (January 2006, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Wed, 4 Jan 2006 10:30:57 -0800
Reply-To:   monal kohli <k_monal_99@YAHOO.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   monal kohli <k_monal_99@YAHOO.COM>
Subject:   Re: How do I call a specific macro based on the value of a host variable
Comments:   To: bitstream <scott.berta@GMAIL.COM>
In-Reply-To:   <1136398805.014110.252760@g49g2000cwa.googlegroups.com>
Content-Type:   text/plain; charset=iso-8859-1

Hi, Use call Execute.there are a lot of examples in archives.

HTH Mona

--- bitstream <scott.berta@GMAIL.COM> wrote:

> I am relatively new to macros and stumped on how to > approach this one > (not even sure what to search for). > 1. I read a value from a table in a host variable > &test ( value is > either a, b or c). > 2. I have 3 macros, %getfile_a, %getfile_b and > %getfile_c. > > Question: How do I write the code to call the macro > based on the value > of &test?? I have tried a data step that uses an > if-then-else loop > > data _null_; > if &test = 'a' then; > %getfile_a else; > if &test='b' then; > %getfile_b else; > if &test='c' then; > %getfile_c; > run; > > but this doesn't work (it runs all 3 macros). > > Thanks. >

__________________________________________ Yahoo! DSL – Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com


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