0
votes

Exploring a new & large SAS dataset. Many years ago I had a solution that did proc freq on all numeric or all character vars within a dataset.

But it kept just the most frequent categories (user-specified) and munged the rest of the categories (or values of response) into one large one for the sake of simplicity.

1
Do you want to create the output of a proc freq into another dataset with a condition to generate only user-specified responses?Rhythm
An example would be if I had ten categories of response to a var I will call var1. Now I am dealing with millions of records and I also do not know, yet, that there are ten categories for var1. Would be good to somehow have proc freq work but include a parameter specifying the maximum size of my groups. So the output could be var1: A 20 B 15 C 10 All other 40 In this example I came up with I said to do proc freq on all of the categories than are 10 or more, and everything else gets "munged" into that last category for All other. The trick to doing this is to basically do for all.Zach

1 Answers

0
votes

There's no default that does that I'm aware of, but it wouldn't be difficult to code one.

In general, you can do this using _numeric_ or _character_ to reference the list of variables.

   proc freq data=have;
   table _numeric_ ; *all numeric variables;
   table _character_; *all character variables;
   table _all_; *all variables;
   run;

   *all variables;
   proc freq data=have;
   run;