I'm trying to get a subset dataset which contains variables uns_n and sns_n ne '.' and uns_n and sns_n ne 0 and drug = 'abc'.
Here's the code I had:
data ABgn;
set ABgn_Miss (where=(drug='abc') and uns_n ne . & uns_n ne 0 & sns_n ne . & sns_n ne 0 );
run;
I also tried different ways but I'm not getting the right data set needed.
I'm wondering what is the best way to do it.
Thank you
A useful shortcut:
set ABgn_Miss (where=(drug='abc' and uns_n and sns_n));
Numeric values of missing and zero are considered to be false while all other values are considered to be true.
Try this - it looks like your brackets aren't quite right.
data ABgn;
set ABgn_Miss (where=(drug='abc' and uns_n not in (.,0) and sns_n not in (.,0));
run;
A useful shortcut:
set ABgn_Miss (where=(drug='abc' and uns_n and sns_n));
Numeric values of missing and zero are considered to be false while all other values are considered to be true.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.