BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
trashYug
Calcite | Level 5
On lesson 3 filtering rows practice (2nd) level 1. Using SAS Studio.

The problem is asking to check for rows with missing data on multiple (3) variables/columns.

I've had trouble finding a clear answer in the documentation and in various places online (read: Google searches pulling up topics here and on stack overflow).

I know I can say
where <column> is missing or <column2> is missing ...;

And get everything back that I should.

But that feels a bit unwieldy, and it seems like a good spot to try and combine operators if possible, yeah? I would like to check all three columns for missing values and return them within proc print, using a single where statement that isn't bogged down with repeated or's and "is missing"s.

But I've tried a few different combinations of in and is missing and it's not really working. Wonder if I've just been doing this incorrectly...? Or if I just haven't gotten the ordering of operators/other syntax correct? Or maybe I'd just have to go about this in a completely different way?

Thanks for any insight.
1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User
NMISS() or CMISS() function instead.

If numeric use NMISS, if character use CMISS, if mixed types use CMISS.

It will return the number of missing values in the columns and you can use that for filtering.

View solution in original post

1 REPLY 1
Reeza
Super User
NMISS() or CMISS() function instead.

If numeric use NMISS, if character use CMISS, if mixed types use CMISS.

It will return the number of missing values in the columns and you can use that for filtering.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

LIBNAME 101

Follow along as SAS technical trainer Dominique Weatherspoon expertly answers all your questions about SAS Libraries.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 625 views
  • 5 likes
  • 2 in conversation