Date: Thu, 27 Nov 2008 13:18:59 -0500
Reply-To: Gerhard Hellriegel <gerhard.hellriegel@T-ONLINE.DE>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Gerhard Hellriegel <gerhard.hellriegel@T-ONLINE.DE>
Subject: Re: macro for proc means
do you need something like that?
%macro me;
%let str=%str(flag_b=0 flag_c=0 flag_d=0 flag_e=0);
%let strr2=flag_a=0;
%do i=1 %to 4;
%let strr=%scan(&str.,&i.);
%let strr2=&strr2 &strr;
%put &strr &strr2.;
%end;
%mend me;
%me;
Gerhard
On Wed, 26 Nov 2008 09:11:47 -0600, yingtao <yingtaoliu@GMAIL.COM> wrote:
>Thanks Wei and Tanwan!
>Any idea why the following code not working? The error happens at the
>concatenation function (it does not capture the string of &strr. How
>to fix it?
>
>
>
>%macro me;
> %let str=%str(flag_b=0 flag_c=0 flag_d=0 flag_e=0);
> %let strr2=flag_a=0;
> %do i=1 %to 4;
> %let strr=%scan(&str.,&i.);
> %let strr2=%sysfunc(catt(&strr2., &strr.));
> %put &strr &strr2.;
> %end;
>%mend me;
>%me;
|