Tip of the Day

From sasCommunity
Jump to: navigation, search

sasCommunity Tip of the Day

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;


Submitted By Otterm1

Feel free to comment on this tip.


Prior tip - Next tip -- Random Tip

Submit a Tip


 

Tips Index by Status

Currently in Use | Yet to be Scheduled | Still Under Review | Tip Awaiting Refinement

Search Tips:


The Tip of the Day Project

A new technical Tip of the Day related to SAS software will be shown on this page and the sasCommunity.org main page every day. Before getting started, you can Browse and Search the current list of tips contributed by users.

Anyone can participate. We hope you do! Here's how:

  1. Submit a Tip by posting a SAS tip that you think others might find useful
  2. Review a Tip prior to publishing
This effort is similar to, and was motivated by, the WikiPedia Tip of the Day Project. Please tell us what you think