i saw your post. as per my knowledge if you exactly want the count od void and smoke for each id. then in sas, as of my knowledge several procedures are there.
the one way came to my mind is you can run
proc tabulate procedure .
proc tabulate data=;
class id void smoke;
table id, (void smoke) n;
Proc FREQ will give you a frequency and cum frequency (as well as percent and cum percent) and if you don't like the format of the default FREQ output, you can always create an output dataset from PROC FREQ and use a different procedure to print the output dataset.
In addition to Proc TABULATE, Proc REPORT would do a count such as you want.
Sorry I could not respond to you immediately. Since all the variable values were present in the data you provided, I used the sum statement. We face this (propogation of null values) problem with sum statement, and thus it is safe to use sum function in case of missing values.
Thanks for your help.
It did helped me. But later noticed that dataset has null values, which gives the sum as null values too. So how to handle adding up values along with null values.
This shld give a compleet solution.