Date: Wed, 21 Oct 2009 10:06:41 -0500
Reply-To: "Data _null_;" <iebupdte@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Data _null_;" <iebupdte@GMAIL.COM>
Subject: Re: Usage of sum function
In-Reply-To: <476575b2-dbfe-4124-8306-14f0efec583d@o36g2000vbl.googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1
On 10/21/09, Chris Jones <chrisj75@gmail.com> wrote:
> Using the colon operator would use ANY variable beginning with X,
> resulting in errors if you had, for example, a character variable
> called "x_something".
>
> Alternatives:
>
> xsum = sum(of x1-x50);
>
> or
>
> array xx{*} x1-x50;
> xsum = sum(of xx{*});
I believe the whole point of the question was "how to refer to the
enumerated variable list" without knowing the dimension. If you had
concern about name "collision" you could use the PROC TRANSPOSE option
PREFIX to give the enumerated variable list a name prefix that would
likely be more unique.
|