Date: Thu, 20 Feb 1997 08:28:13 -0600
Reply-To: Tom Kalfas <kalfast@PPRD.ABBOTT.COM>
Sender: "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From: Tom Kalfas <kalfast@PPRD.ABBOTT.COM>
Subject: Re: SAS calculations
In-Reply-To: Sheridan Young <youngs@WELLSFARGO.COM> "SAS calculations" (Feb
14, 11:28am)
Content-Type: text/plain; charset=us-ascii
Sheridan,
You can do this rather easily in an SQL step:
proc sql;
create table <whatever> as
select x, x/sum(x) as pct from <whatever>;
quit;
HTH,
Tom
--------------------------------------------------------------------------
On Feb 14, 11:28am, Sheridan Young wrote:
> Subject: SAS calculations
> I have a numeric variable column and I want to sum the column and then
> add another variable which calculates the percentage of the total (sum)
> from the first variable column.
> Example:
>
> var 1 Percnt
> 3 18.7%
> 3 18.7%
> 3 18.7%
> 3 18.7%
> 4 25.0%
> -
> 16
>
> Thank you
>
> Sheridan Young
>-- End of excerpt from Sheridan Young
--
Thomas Kalfas
System Developer
Abbott Laboratories
E-mail: kalfast@pprd.abbott.com
Phone: (847) 938-8101
Fax: (847) 935-1320
|