Date: Fri, 10 Sep 2010 08:56:44 -0700
Reply-To: dave crimkey <d_crimkey@YAHOO.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: dave crimkey <d_crimkey@YAHOO.COM>
Subject: Re: Can I rename only one variable in a long proc summary var
list?
In-Reply-To: <AANLkTi=DQMjrSo4J49RktZHLuHWQM4mq277UYHDoe+5n@mail.gmail.com>
Content-Type: text/plain; charset=us-ascii
I like this solution but it only sums up var6amt, it doesn't sum any of the
others. So I'm going with the rename in the proc. Thanks everyone!
----- Original Message ----
From: "Data _null_;" <iebupdte@gmail.com>
To: dave crimkey <d_crimkey@yahoo.com>
Cc: SAS-L@listserv.uga.edu
Sent: Fri, September 10, 2010 11:08:00 AM
Subject: Re: Can I rename only one variable in a long proc summary var list?
Does this do it?
proc summary nway data=pulldata;
class id1 id2 id3 id4 id4 id6 id7 id8 id9;
var var1amt var2amt var3amt var4amt
var5amt var6amt var7amt var8amt
var9amt;
output out = pullsum (drop=_:)
sum=
sum(var6amt) = der_var6amt
/ noinherit;
run;
On 9/10/10, dave crimkey <d_crimkey@yahoo.com> wrote:
> I have a proc summary that looks like this (variable names renamed to protect
> the innocent):
>
> proc summary nway data=pulldata;
> class id1 id2 id3 id4 id4 id6 id7 id8 id9;
> var var1amt var2amt var3amt var4amt
> var5amt var6amt var7amt var8amt
> var9amt
> output out = pullsum (drop=_:) sum=/noinherit;
> run;
>
> I want all the varamt field names to remain the same except var6amt. I want
to
> rename that amt field to der_var6amt but keep var6amt also. Is there a way to
> do this in the sum= statement without listing all the var names? So my
pullsum
> dataset will contain:
>
> id1 id2 id3 id4 id4 id6 id7 id8 id9 var1amt var2amt var3amt var4amt
> var5amt var6amt der_var6amt var7amt var8amt
> var9amt
>
> Thanks for your help,
> Dave
>