IS MISSING and IS NOT MISSING Operators in SAS Programming - GeeksforGeeks

23 Jul, 2019
IS MISSING Operator: Selecting Missing ValuesTask 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 80Atul . 77Priya B 45Sandeep A 95Rahul . 84Shreya . 44;run;  data readin1;set readin;where Section is missing;run;Output:Where Section is missing => This would tell SAS to select missing values for variable SECTION.IS NOT MISSING Operator: Selecting Non-Missing ValuesTask 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 80Atul . 77Priya B 45Sandeep A 95Rahul . 84Shreya C 44;run;  data readin1;set readin;where Section is not missing;run;Output:Where 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”);
IS MISSING Operator: Selecting Missing ValuesTask 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 80Atul . 77Priya B 45Sandeep A 95Rahul . 84Shreya . 44;run;  data readin1;set readin;where Section is missing;run;Output:Where Section is missing => This would tell SAS to select missing values for variable SECTION.
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 80Atul . 77Priya B 45Sandeep A 95Rahul . 84Shreya . 44;run;  data readin1;set readin;where Section is missing;run;
Output:
Where Section is missing => This would tell SAS to select missing values for variable SECTION.
IS NOT MISSING Operator: Selecting Non-Missing ValuesTask 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 80Atul . 77Priya B 45Sandeep A 95Rahul . 84Shreya C 44;run;  data readin1;set readin;where Section is not missing;run;Output:Where 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”);
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 80Atul . 77Priya B 45Sandeep A 95Rahul . 84Shreya C 44;run;  data readin1;set readin;where Section is not missing;run;
Output:
Where 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 the section is not missing and the score is missing;
where not (score in (34, 44, 84));
where not (score in (34, 44, 84));
where not (Score between 50 and 90);
where not (Score between 50 and 90);
where NOT(Section EQ “A”);
where NOT(Section EQ “A”);
SAS Programming
Programming Language
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Comments
Old Comments
Top 10 Programming Languages to Learn in 2022
Shallow Copy and Deep Copy in C++
C# | Data Types
Difference between Shallow and Deep copy of a class
Advantages and Disadvantages of OOP
Kotlin Array
Java Swing | JComboBox with examples
Prolog | An Introduction
Program to calculate Electricity Bill
Difference between while and do-while loop in C, C++, Java