Date: Fri, 2 Sep 2005 14:58:03 -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: Macro Variable
Content-Type: text/plain; format=flowed
miguel_hoz@YAHOO.ES wrote back:
>The only way I get this loop to work is writing &&&ptype&i..amtemo, but in
>some cases the loop is working and in some cases no... I send you the log
>%do i=1 %to 6;
>proc means data = cli_pro(where =(ptype="&&ptype&i")) noprint;
>VAR status BALANCE_1 BALANCE_2 BALANCE_3;
>output out=cli_&&ptype&i(drop=_freq_ _type_)
It looks to me as if you are making things more and more complex, while not
solving the underlying problems.
Perhaps you could write back to the list and explain why you need this
macro manipulation at all. If all you need is to have the PROC SUMMARY
information split by the values of PTYPE, then you ought to be doing this
using BY-variable processing and keeping the results in one data set for
easier manipulation further on. By forcing this into a macro structure,
making this really complicated, and you're making the code harder to read
and fix, and you're probably making the program run a lot slower. Not to
mention that you're using up way more of your own time!
David L. Cassell
3115 NW Norwood Pl.
Corvallis OR 97330
Express yourself instantly with MSN Messenger! Download today - it's FREE!