Using PROC MEANS and PROC FREQ to Count Missing Values

There are several procedures that will count missing values for you. It may be normal to have missing values for certain variables in your data set. There may also be variables for which no missing values are permitted (such as a patient ID). An easy way to count missing values is by using PROC MEANS; for character variables, PROC FREQ will provide this information. Program 3-1 is a simple program that can be used to check the number of numeric and character missing values in the PATIENTS data set.

Program 3-1. Counting Missing and Nonmissing Values for Numeric and Character Variables
LIBNAME CLEAN "C:\CLEANING"; TITLE "Missing Value Check for the PATIENTS Data Set"; PROC MEANS DATA=CLEAN.PATIENTS ...

Get Cody’s Data Cleaning Techniques Using SAS® Software now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.