The -levelsof- command is very fast for numeric variables. In testing times were linear in the number of observations (as expected) and converged to a low constant in the number of levels, which is a surprise.

For numeric (floats were tested) levels It ran at about 5 million records per second, except for very small numbers of levels. At 10 levels, it ran at 15 million records per second. This was much faster than the -table- or -collapse- routines, when given a simlar computational burden.

For even short strings, the results were not as good - 160 thousand records per second. The -table- and -collapse- routines were much faster but it wouldn't be easy to capture the output of those routines and insert them into a macro.

Last change 28 October 2019 by drf