Date: Mon, 9 Apr 2007 13:22:43 -0700
Reply-To: sdlenter <sdlentert@AOL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: sdlenter <sdlentert@AOL.COM>
Organization: http://groups.google.com
Subject: Re: Calculate percentage
In-Reply-To: <200704091930.l39JEDbe029304@mailgw.cc.uga.edu>
Content-Type: text/plain; charset="iso-8859-1"
On Apr 9, 12:30 pm, art...@NETSCAPE.NET (Arthur Tabachneck) wrote:
> Wouldn't something like the following provide what you want?
>
> proc sort data=have;
> by aca;
> run;
>
> proc freq data=have;
> tables reason/out=want;
> by aca;
> weight records;
> run;
>
> HTH,
> Art
> ------
>
>
>
> On Mon, 9 Apr 2007 11:46:56 -0700, sdlenter <sdlent...@AOL.COM> wrote:
> >I have this table
> >ACA Reason Records
> >1212 300 12
> >1212 301 8
> >1212 302 50
> >4545 300 122
> >4545 401 5
> >4580 500 45
> >4580 501 34
>
> >I need to create a report that will show the % of each reason in each
> >ACA and then export it into Excel:
> >result:
> >ACA Reason Records %
> >1212 300 12 17.14
> >1212 301 8 11.42
> >1212 302 50 ..
> >4545 300 122
> >4545 401 5
> >4580 500 45
> >4580 501 34
> >Here is what I have but doesn't work.
>
> >proc means data=have noprint nway;
> > var Records;
> > by ACA Reason;
> > output out=ACAtot(keep=ACAtotal ACA Reason ) sum=ACAtotal;
> >run;
>
> >data percent1;
> > merge have ACAtot;
> > by ACA Reason;
> > ACApct = (Records / ACAtotal ) * 100;
> > format ACApct 6.2 Records ACAtotal dollar10.;
> >run;
>
> >How canI transport all the info into excel?
> >preferably in this format:
>
> >ACA
> > Reason
> > 300 301 302 400 401
> > 11% xx% x%
>
> >Thank you- Hide quoted text -
>
> - Show quoted text -
Perfect, thank you....
"spasibo"
|