Incorrect class variable values in PROC UNIVARIATE output data set


If you specify an OUT= data set with the OUTPUT statement in PROC UNIVARIATE, and you also specify two CLASS variables where the second one is character with varying lengths, then there will be incorrect values in the output data set for the second class variable. Shorter values for the second class variable will include appended characters from the ends of the longer values. The printed output and ODS output data sets are not affected by this problem.

To circumvent this problem, reverse the order of the variables on the CLASS statement. If both class variables are character with varying lengths, then the problem can be circumvented by sorting on the class variables and specifying them on a BY statement instead of the CLASS statement.