```Date: Fri, 20 Apr 2007 18:32:28 -0700 Reply-To: David L Cassell Sender: "SAS(r) Discussion" From: David L Cassell Subject: Re: A SIMPLE MACRO QUESTION FOR A BIGENNER In-Reply-To: <200704171948.l3HHoGE9029297@mailgw.cc.uga.edu> Content-Type: text/plain; format=flowed mehedisas@YAHOO.COM wrote: > >Wrote a Macro as below: >------------------------- > >%MACRO SELECT (varib, varibx, variby, pmm, three); >Data pmm (drop = &varibx ongoing_&varib); >set three; > if (on_&varib + &varibx) > '1' then &variby = 'Yes'; > else &variby = 'No'; >run; > >%MEND SELECT; > >%SELECT(all, alle, allf) >%SELECT(card, med, dio) >%SELECT(derm, med, tro) >run; > >Can you please tell me why this MACRO is only giving the the results with >- (derm, med, tro)? It is not picking up (all, alle, allf) and >(card, med, dio). > >How can I fix it? What would bet he right code? >Thanks a lot. It can be complicated to learn SAS macro programming. It can be *really* complicated to learn it if you don't know enough SAS yet. Since *you* are describing yourself as a beginner, may I suggest that you just not write this as a macro? Learn how to do this in a data step or three. Then learn how to use arrays to do the same sorts of tasks. Because your life will be a lot simpler if you don't try to dive headfirst into a macro pool of unknown depth.. at least not until you learn how to check that the pool is deep enough first. HTH, David -- David L. Cassell mathematical statistician Design Pathways 3115 NW Norwood Pl. Corvallis OR 97330 _________________________________________________________________ Interest Rates NEAR 39yr LOWS! \$430,000 Mortgage for \$1,299/mo - Calculate new payment http://www.lowermybills.com/lre/index.jsp?sourceid=lmb-9632-19132&moid=14888 ```

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