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 (October 2009, week 5)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Sat, 31 Oct 2009 09:09:01 -0700
Reply-To:   Arthur Tabachneck <art297@NETSCAPE.NET>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Arthur Tabachneck <art297@NETSCAPE.NET>
Subject:   Re: Can this be done in data step
Comments:   To: Bunti <urbunti@yahoo.com>
In-Reply-To:   <183942.23379.qm@web94914.mail.in2.yahoo.com>
Content-Type:   text/plain; charset=ISO-8859-1

It could be done in a single data step with a DOW loop. E.g.,

data want; do until (last1); set table end=last1; sumsal=sum(sumsal,sal); end; do until (last2); set table end=last2; want=sal*100/sumsal; output; end; run;

HTH, Art ------------- On Oct 31, 2:19 am, urbu...@yahoo.com (Bunti) wrote: > All, > > I was wondering if below code can be done in data step > > proc sql; > select *, (sal*100)/sum(sal) from table; > quit; > > table is something like this > > name sal > a 100 > b 200 > c 300 > > Regards,=20 > Urvir=0A=0A=0A Keep up with people you care about with Yahoo! India Ma= > il. Learn how.http://in.overview.mail.yahoo.com/connectmore


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