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 (January 2004, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Tue, 6 Jan 2004 13:30:45 -0500
Reply-To:   "DePuy, Venita" <depuy001@DCRI.DUKE.EDU>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   "DePuy, Venita" <depuy001@DCRI.DUKE.EDU>
Subject:   Re: Frequency of ranges
Comments:   To: David Nobles <dnobles@DNOBLES.COM>
Content-Type:   text/plain

It may not be the prettiest or most efficient, but you might do some proc summary statements . . . on 2nd thought, not sure how well that works with ODS output; how about proc means statements? ie proc means data=file1 noprint; where value LE 10; output out=out1 n=n; proc means data=file2 noprint; where value > 10 and value LE 20; output out=out2 n=n; et cetera

then data outfile set out1 out2 . . . ;

I'd do this in a macro loop actually; assume it's easy for you to write that, but feel free to write if you need that bit of code.

Disclaimer - not being a SQLhead, I'm often pleasantly suprised by how quickly some things can be done in SQL per the posts here. So there might be a better way to do it in sql, I just don't know it.

HTH, Venita

> ---------- > From: David Nobles[SMTP:dnobles@DNOBLES.COM] > Reply To: David Nobles > Sent: Tuesday, January 06, 2004 12:51 PM > To: SAS-L@LISTSERV.UGA.EDU > Subject: Frequency of ranges > > If I'm looking to get the frequency of values in a field but not for the > individual value such as PROC FREQ returns but based on a range can FREQ > do that? If not is their a SAS PROC or function that will? > > For example: say my values are 1 to 100 and I want the following list > > range count > 01 - 10 25 > 11 - 20 10 > 21 - 30 14 > 31 - 40 14 > 41 - 50 23 > 51 - 60 25 > 61 - 70 10 > 71 - 80 14 > 81 - 90 23 > 91 - 100 14 > > In addition, if possible I'd like to set the range values as variables. > Either value1 - value2 or value1 + 10 with the latter being preferred. > > Thanks, > > > David Nobles > Testing Manager (Sogeti) > VA DSS IMS - DB2 conversion >


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