Date: Fri, 10 Sep 2010 11:01:57 -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: Can I rename only one variable in a long proc summary var
list?
In-Reply-To: <998178.4049.qm@web112503.mail.gq1.yahoo.com>
Content-Type: text/plain; charset=ISO-8859-1
I don't think you used the code I posted. See the example below.
However from what you have said using RENAME data set option seems to
do exactly what you want.
proc summary data=sashelp.class;
var age height weight;
output out=test
sum= sum(height)=h2;
run;
proc print;
run;
On 9/10/10, dave crimkey <d_crimkey@yahoo.com> wrote:
> 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
> >
>
>
>
>
>
>
|