Date: Fri, 4 Mar 2011 13:31:26 +0000
Reply-To: toby dunn <tobydunn@HOTMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: toby dunn <tobydunn@HOTMAIL.COM>
Subject: Re: eval the expression in variable
In-Reply-To: <201103040829.p243ZrCa007590@willow.cc.uga.edu>
Content-Type: text/plain; charset="iso-8859-1"
Clark,
If you have that many iterations its gonna be some what slow no matter what. But if you have too try this:
FileName XXX Temp ;
Data _Null_ ;
File XXX ;
a1 = "5" ;
a2 = "*exp(1.7-2)" ;
a3 = "/log(45)" ;
X = CatS( 'B =' , A1 , A2 , A3 , ';' ) ;
Put X ;
Run ;
Data _Null_ ;
%Include XXX ;
Put B= ;
Run ;
Toby Dunn
"I'm a hell bent 100% Texan til I die"
"Don't touch my Willie, I don't know you that well"
> Date: Fri, 4 Mar 2011 03:29:26 -0500
> From: kuhasu@126.COM
> Subject: Re: eval the expression in variable
> To: SAS-L@LISTSERV.UGA.EDU
>
> data mem.a;
> array a[3]$12. ;
> a[1]="5";
> a[2]="*exp(1.7-2)";
> a[3]="/log(45)";
> array b[3];
> b[1]=1;
> b[2]=2;
> b[3]=3;
> do i=1 to 10000000;
> call symput('d',cat(a[b[1]],a[b[2]],a[b[3]]));
> y=Resolve(&d);
> /*y=%SysEvalF(&d);*/
> end;
> run;
>
> /*resolve is much slower than %sysevalf,but %sysevalf seems can not
> support complex expression i.e. log,exp*/
>
> So is there a way just use macro variables but not %do loop?
> Thx!
|