LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (August 2002, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
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


Back to: Top of message | Previous page | Main SAS-L page