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 (June 2011, 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 Jun 2011 16:50:48 -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: row-level vs column-level SUM in proc sql
Comments:   To: Bolotin Yevgeniy <YBolotin@schools.nyc.gov>
In-Reply-To:   <01384B2401936142AF5F65E3D12402780A5D0D36@EX3VS1.nyced.org>
Content-Type:   text/plain; charset=ISO-8859-1

sum(a,0)

On Fri, Jun 10, 2011 at 3:26 PM, Bolotin Yevgeniy <YBolotin@schools.nyc.gov> wrote: > The SUM function (and probably other aggregate functions) in PROC SQL > change from row-level to column-level based on context > > > Is it possible to force it to be one vs the other? > > (as a thought experiment: I want to get a row-level sum of non-missing > values, but the variable list is a dynamically generated macro parameter > and may only have one variable in it) > > > Sample data demonstrating this is below. > for a fun time, call sum(sum(a,b,c))! > > > > data _z; > input a b c; > datalines; > 1 2 3 > 4 . 6 > ; > run; > > proc sql; > select > sum(a,b,c) as sum_row, > sum(a) as sum_col > from _z > ; > quit; > > > /* > Output > sum_row sum_col > ------------------- > 6 5 > 10 5 > */ >


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