Date: Sat, 25 Oct 2008 17:27:04 -0400
Reply-To: "Howard Schreier <hs AT dc-sug DOT org>"
<schreier.junk.mail@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Howard Schreier <hs AT dc-sug DOT org>"
<schreier.junk.mail@GMAIL.COM>
Subject: Re: Array Frustration!!!!
On Sat, 25 Oct 2008 14:31:10 -0400, Lewis Jordan <lewjord@UGA.EDU> wrote:
>I am trying to pass an array of variables into another array. In the "data
two" step, if I specify x{1}=&fyknot1, it works fine. However, this is
inefficient and I don't want to have to write out each variable. What am I
doing wrong in the "data two" do loop?
>
>Thanks in advance. -Lewis
>
>data one;
>array knots{5};
> do i=1 to 5;
> knots{i}=ranuni(38211);
> call symput (compress('fyknot'||i),trim(left(knots{i})));
> end;
>drop i;
>run;
>
>data two;set one;
>array x{5};
> do i=1 to 5;
> x{i}=&fyknot{i}; /*HELP ME HERE?????*/
There is likely a simpler way to do whatever really needs doing, but here's
your help:
x{i}= symget( cats( 'fyknot' , i ) ) ;
> end;
>output;
>run;quit;
|