@jeremy4 wrote:
Thanks for your reply, it's just that there are about 100,000 observations in my dataset and I want to use a proc freq to see the number of observations belonging to each band that I have created in my code. Is there another method, just so that the proc freq table lists the bands in the order that I have written in the code, rather than the numerical sorting of the bands from the proc freq results table that I have explained in my post? Thanks!
One of the other very strong advantages to the Proc Format approach is that the formats are applied at the time the Procedure such as Freq is run. So you can have multiple formats and use the one you want at a specific time without having to add multiple additional variables.
For example I work with age data and depending on the analysis or report requirement we group people by: 5 year age groups: like 20-24, 25-29, 30-34 etc.; 10 year age groups: 20-29, 30-39 etc.; specific age groups under/over age 50, or 45, or 65. With formats I only need one numeric age value and can use the specific format for the specific analysis. Note that the formats will group values for almost every analysis, reporting or graphing procedure SAS uses. And with a numeric value at heart the sort order never gets "Kafluey" because of the sort behavior of character values.
Plus for some specific procedures you can use a multilabel format that will show something like the 10000 to 20000 as well as the 10000-15000 and 15000-20000.
... View more