LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (September 2010, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 10 Sep 2010 08:04:41 -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?
Comments: To: Joe Matise <snoopy369@gmail.com>
In-Reply-To:  <AANLkTikHmtD5KwmJMp7_M2UB+bq0KaD-VrXo3HfzDHbW@mail.gmail.com>
Content-Type: text/plain; charset=us-ascii

I just thought of the rename option. I was hoping to do it all in the proc. I don't really need to keep var6amt. I guess what I was looking for was something like you can do in SQL -- like a case statement in the middle of a select/sum/group by to rename the variable you're summing.

________________________________ From: Joe Matise <snoopy369@gmail.com> To: dave crimkey <d_crimkey@yahoo.com> Cc: SAS-L@listserv.uga.edu Sent: Fri, September 10, 2010 10:49:10 AM Subject: Re: Can I rename only one variable in a long proc summary var list?

Not sure I completely follow what you mean by 'also keep var6amt', but you should be able to either use data set options in the out= statement, or do a rename in PROC DATASETS or somewhere else, if you want to just rename one of them.

-Joe

On Fri, Sep 10, 2010 at 9:45 AM, 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 >


Back to: Top of message | Previous page | Main SAS-L page