I feel the solutions provided by @Jagadishkatam and also by @mohamed_zaki could give the wrong result in some situations.
If there are missing values in variable, then the variable &obs will count the missings, and then in the next line, (count(variable)/&obs) will have the wrong denominator.
... View more