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 (February 1998, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 3 Feb 1998 14:59:51 -0800
Reply-To:     Steve <Steve@ADDER.DEMON.COSPAMSPAMSPAM.UK>
Sender:       "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From:         Steve <Steve@ADDER.DEMON.COSPAMSPAMSPAM.UK>
Organization: <none>
Subject:      Re: How to sum a column? (Please look at my code, thanks)
Content-Type: text/plain; charset=us-ascii

Louise Lawson wrote: > > Hi Tang. > > If you want a new dataset that has one observation with the sum of > the column in it, use this code: > > proc summary data=one; > var x; > output out=sumofone sum=sumofx; > RUN; >

Also look into PROC SQL. It's a wonderful data manipulation tool.

In your case you could use something like: proc sql; create table sumofone as select sum(x) as sumofx from one;

With this you can easily merge it back with the original data (eg to then take differences etc) and/or easily create macro variables.

With more complex SQL though it's easy to not notice if it's not quite doing what you want and this may be a problem for a beginner.

Steve


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