-
IS MISSING Operator: Selecting Missing Values
Task 1: Suppose you want to select only those observations in which students did not fill their section information.
data readin;
input
name
$
Section
$ Score;
cards;
Raj A 80
Atul . 77
Priya B 45
Sandeep A 95
Rahul . 84
Shreya . 44
;
run;
data readin1;
set
readin;
where
Section
is
missing;
run;
chevron_rightfilter_noneWhere Section is missing => This would tell SAS to select missing values for variable SECTION.
-
IS NOT MISSING Operator: Selecting Non-Missing Values
Task 2: Suppose you want to select only those observations in which students filled their section information.
data readin;
input
name
$
Section
$ Score;
cards;
Raj A 80
Atul . 77
Priya B 45
Sandeep A 95
Rahul . 84
Shreya C 44
;
run;
data readin1;
set
readin;
where
Section
is
not
missing;
run;
chevron_rightfilter_noneWhere Section is not missing => This would tell SAS to select non-missing values.
The NOT operator can be used with WHERE statement in many other ways:
-
where the section is not missing and the score is missing;
-
where not (score in (34, 44, 84));
-
where not (Score between 50 and 90);
-
where NOT(Section EQ “A”);
-
Data Structures and Algorithms – Self Paced Course
View Details