Date: Mon, 23 Oct 2006 05:30:32 -0400
Reply-To: Jim Groeneveld <jim2stat@YAHOO.CO.UK>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Jim Groeneveld <jim2stat@YAHOO.CO.UK>
Subject: Re: How to a value from a table into a global variable?
Hi Henry,
Just for purposes of efficiency: now you create the macro variable alphad0
for every record of your sataset minw, every time overwriting the previous
one. To improve efficiency do:
data _null_;
set minw END=LastRec;
IF (LastRec) THEN call symput("alphad0",x&tb1);
run;
or rather
data _null_;
set minw (FIRSTOBS=LastRec) NOBS=LastRec;
call symput("alphad0",x&tb1);
run;
If minw only has one record your code and the above code don't differ.
Regards - Jim.
--
Jim Groeneveld, Netherlands
Statistician, SAS consultant
home.hccnet.nl/jim.groeneveld
On Sat, 21 Oct 2006 19:27:27 -0700, henry <henry.huiliao@GMAIL.COM> wrote:
>thanks for everyone's help. finally, after keeping googling, I find an
>answer:
>
>data _null_;
> set minw;
> call symput("alphad0",x&tb1);
>run;
>
>So, this issue is solved:)
[.........]
|