🔒 This topic is locked.
We are no longer accepting replies to this topic. Need further help? Please
sign in and ask a new question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Posted 07-03-2018 10:17 AM
(83330 views)
The IS MISSING and IS NULL operators, which are used with a WHERE statement, can handle character or numeric variables. They also work with the NOT operator:
*** create a sample dataset with some missing values;
data makemissing;
set sashelp.class;
if substr(name,1,1) eq 'J' then initial='J';
if 11 le age le 13 then newage=age;
run;
*** use missing;
proc print data=makemissing;
where initial is missing and newage is not missing;
run;
*** or equivalently, use IS NULL;
proc print data=makemissing;
where initial is null and newage is not null;
run;
This may be especially useful in a macro that takes mixed-type variables as parameters in a where clause.
Thanks to Mary Rosenbloom for submitting this tip on sasCommunity.org!
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
There is also the missing() function which does either data type.