Desktop productivity for business analysts and programmers

Multiple conditions

Reply
Contributor
Posts: 30

Multiple conditions

[ Edited ]

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; Smiley Happy

 

StatusflagCodeProg
10B1P1
10B2P2
10B2P2
10A1Q1
12A2Q2
12A3Q3
20D1P3
20D1P3
21C1Q4
21C1Q4
Esteemed Advisor
Posts: 7,290

Re: Multiple conditions

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

 

Contributor
Posts: 30

Re: Multiple conditions

Thank you very much. Have a good day.

Ask a Question
Discussion stats
  • 2 replies
  • 104 views
  • 1 like
  • 2 in conversation