The WHERE statement is a substitute to IF statement when it comes to subsetting a data set.
WHERE (condition is true) => It refers to subsetting a dataset.
Task1 : Suppose you want to select only section A students. You need to filter Section variable equals to A using where clause.
where section EQ “A” => This would tell SAS to select only section which is equals to values “A”.
You can also write where section = “A”. This statement serves the same purpose.
|&||AND||Both conditions true|
||||OR||Either condition true|
|~ or ^||NOT||Reverse the statement|
Task2: Suppose you want to select section A and B students. You need to filter Section variable
equals to A or B using where clause.
where section IN (“A” “B”) => This would tell SAS to select those record where section is equals to either A or B values.
- If-Then-Else statement in SAS Programming
- Difference between Functional Programming and Object Oriented Programming
- Switch case statement in Octave GNU
- Use of FLAG in programming
- Introduction to SAS programming
- Functions in R Programming
- Contains and Between-And operators in SAS Programming
- Like Operator in SAS Programming
- I Can't Use Logic In Programming. What Should I Do?
- Features of C Programming Language
- Looping over Objects in R Programming
- C Programming For Beginners - A 20 Day Curriculum!
- Which Programming Language to Choose?
- Swift Programming Language
- Introduction to Programming Languages
- Introduction to Swift Programming
- Role of SemiColon in various Programming Languages
- The Factor Issue in a DataFrame in R Programming
- Which Programming Language Should I Choose as a Beginner?
- Object Oriented Programming in Ruby | Set-2
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.