BookmarkSubscribeRSS Feed
jrleighty
Fluorite | Level 6

I ran a dataset through proc freq and noticed I had missing values when I didn't expect any. Is there a way to output those values or print them so that I can determine what the issue might be?

2 REPLIES 2
Tom
Super User Tom
Super User

The TABLES statement has two options.  MISSING and MISSPRINT.

The first treats missing values as valid values, same as any other value.

The later just displays the missing values but they do not count in the total used for calculating percentages.

 

ballardw
Super User

If you mean that you want to look at other values, such as identifiers or variables used to create the "missing values" then perhaps you are looking for something like:

data help;
   set yourdatasetname;
   where missing( targevariablename);
run;

Of perhaps provide a couple of other variables in proc freq:

 

proc freq data=yourdataset;
   tables thisvar*thatvar*targetvar / list missing;
run;

The above approach is helpful when targetvar in some way depends on the other two variables (or one  or three or ...). The List option puts all the values on one line in the output table for easier following and the missing gets the missing values in context.

 

"Printing missing" values by themselves is not much interest as it would look like:

.

.

.

.

.

by default.

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 697 views
  • 2 likes
  • 3 in conversation