Created
August 8, 2020 02:55
-
-
Save SolClover/a408afdb79c9743eb989b3ac205eb0e8 to your computer and use it in GitHub Desktop.
SAS filtering using where statement
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Filter on one condition */ | |
data my_new_ds; | |
set my_ds; | |
where Col_A>=6; | |
run; | |
/* Filter on multiple conditions using AND */ | |
data my_ds; | |
set my_ds; | |
where Col_A>=6 and Col_B=5; | |
run; | |
/* Filter on multiple conditions using OR */ | |
data my_ds; | |
set my_ds; | |
where Col_A>=6 or Col_B=1; | |
run; | |
/* Filter on multiple conditions */ | |
data my_ds; | |
set my_ds; | |
where fruit in ('1.apple', '3.pear'); | |
run; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment