You could use 1.)the retain function in the data step and count the values using a series of if conditions or 2.)In proc sql ,probably use the Union option between three individual queries to obtain the counts with the help of group by statments
... View more