Date: Mon, 2 Nov 2009 14:44:19 -0500
Reply-To: Joe Matise <snoopy369@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Joe Matise <snoopy369@GMAIL.COM>
Subject: Re: WHERE Statement - Variable
In-Reply-To: <200911021926.nA2IlYTg027706@malibu.cc.uga.edu>
Content-Type: text/plain; charset=ISO-8859-1
Seems like PROC FREQ to me. Or PROC MEANS. Or PROC SQL with sql-code, if
that's what you're used to.
PROC PRINT does not 'calculate' things, it just prints them.
-Joe
On Mon, Nov 2, 2009 at 2:26 PM, SAS Swamy <sasswamy@gmail.com> wrote:
> Hello,
>
> I understand about the WHERE statement.
> Can someone please help with the code , how to store the value to a
> variable based on a WHERE condition
>
> proc print data=TEST_DATA1;
> where vaccode = 'test';
> run;
>
> proc print data=TEST_DATA2;
> where ELIG_TYPE = 'P';
> run;
>
> I am able to get the results with the above condition , I need to store
> the value to a variable and calculate the percentage from the overall
> count
>
> for e-g
>
> Total = 600 ( overall total )
> test = 22 ( only code = 'test' )
> percentage 3.66
>
> Thanks,
> - swamy.
>
|