Hi everyone,
I've the following dataset which i would like to subset. I want to only keep observations with Status 1 and Flag 0 & Status 2 and Flag 1.
The questions sounds quite easy but i'm quite new in sas programming. Any kind of help will be welcomed; 🙂
Status | flag | Code | Prog |
1 | 0 | B1 | P1 |
1 | 0 | B2 | P2 |
1 | 0 | B2 | P2 |
1 | 0 | A1 | Q1 |
1 | 2 | A2 | Q2 |
1 | 2 | A3 | Q3 |
2 | 0 | D1 | P3 |
2 | 0 | D1 | P3 |
2 | 1 | C1 | Q4 |
2 | 1 | C1 | Q4 |
data want; set have; if (status eq 1 and flag eq 0) or (status eq 2 and flag eq 1); run;
Art, CEO, AnalystFinder.com
Thank you very much. Have a good day.
Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.
Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.