This week's SAS tip is from Gerhard Svolba and his latest book Data Quality for Analytics Using SAS. For additional bonus book content and to learn more about Gerhard and his work, visit his author page.
The following excerpt is from SAS Press author Gerhard Svolba's book "Data Quality for Analytics Using SAS" Copyright © 2012, SAS Institute Inc., Cary, North Carolina, USA. ALL RIGHTS RESERVED. (please note that results may vary depending on your version of SAS software).
Counting missing values with PROC MEANS
A simple and quick method to check the number of missing values in a table is to use PROC MEANS with the NMISS option:
proc means data = hmeq nmiss; run;
Note that only variables with a numeric format can be analyzed with this method. If no variables are specified in the VAR statement, all numeric variables in the data set are used for the analysis. An alternative would be to use the VAR statement in the MEANS procedure:
Var mortdue value yoj;
The output that is generated from this procedure is shown in Output 10.1.