Date: Mon, 27 Oct 2008 22:26:34 +1100
Reply-To: Scott Bass <sas_l_739.at.yahoo.dot.com.dot.au@PESTO.CC.UGA.EDU>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Scott Bass <sas_l_739.at.yahoo.dot.com.dot.au@PESTO.CC.UGA.EDU>
Subject: Re: Array Frustration!!!!
Hi Lewis,
Just because it works doesn't mean it's best practice. Macro is orders of
magnitude slower than data step programming.
As others have posted, what exactly are you trying to do? I suspect you
don't need macro for your scenario. Of course, I could be totally mistaken
in this assumption.
Cheers,
Scott
"Lewis Jordan" <lewjord@UGA.EDU> wrote in message
news:20081025174608.OHO02067@punts3.cc.uga.edu...
> My mistake. In the original posting, I had
> "data two;set one;..." I did not intend to refernce the "one" data set.
> Below is the code the Howard sent, and works like a charm.
>
> Thanks for the help.
>
> data one;
> array knots{5};
> do i=1 to 5;
> knots{i}=ranuni(38211);
> call symput (compress('fyknot'||i),trim(left(knot{i})));
> end;
> drop i;
> run;
>
> data two;
> array x{5};
> do i=1 to 5;
> x{i}= symget( cats( 'fyknot' , i ) ) ;
> end;
> output;
> run;quit;
|