Date: Wed, 29 Aug 2007 09:02:10 -0400
Reply-To: "Howard Schreier <hs AT dc-sug DOT org>" <nospam@HOWLES.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Howard Schreier <hs AT dc-sug DOT org>" <nospam@HOWLES.COM>
Subject: Re: Conditional PROC FREQ
On Wed, 29 Aug 2007 05:52:45 -0400, Lene Blenstrup <lenetb@SOCSCI.AAU.DK> wrote:
>Hi.
>
>I would like to make a simpel frequency on the year my population enters my
>dataset but only if a condition is meet.
>I have tried this - but it doesn't work:
>
>proc freq data=dataset;
>tables year;
>if condition=.;
>run;
>
>I normally extract the records that meet the condition into another dataset
>and then make my count... Isn't there a simpler way that saves my the trouble?!
>
>Lene
You can't have an IF statement in a PROC step. You can however have a WHERE
statement.
Is "condition" the name of a variable, or a placeholder for an expression
which is evaluated as true/false? If the latter, the result of evaluating
the expression will be either zero or one, never a missing value.
|