New SAS User

Completely new to SAS or trying something new with SAS? Post here for help getting started.
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-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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
  • 920 views
  • 2 likes
  • 3 in conversation