| Date: | Wed, 21 Aug 2002 17:39:00 -0400 |
| Reply-To: | Mike Fay <rmf4@CDC.GOV> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | Mike Fay <rmf4@CDC.GOV> |
| Subject: | Proc Freq with a 'filter'? |
|---|
Hi folks,
Fairly often, I want counts and an output set of data, but only for records
where a particular variable equals a particular value(s). But AFAIK, there
isn't any way to put a 'filter' in Proc Freq; instead I have to do a
separate Data step prior to this (making some junk table to then do the
Freq on). Is there a way to do filtering directly in the Proc Freq without
having to always do an additional Data step?
Example: You want to know which stores in New York contributed sales into
the sales database of the whole country:
proc freq data=work.usa_sales;
tables StoreIDs / list out=work.Ny_stores_and_sales_record_counts;
run;
... is there a way to stick in e.g.
If Store_state='NY';
like a Data filter? (this phrase itself generates an error)
TIA!
Mike
|