BookmarkSubscribeRSS Feed
adil256
Quartz | Level 8

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; 🙂

 

StatusflagCodeProg
10B1P1
10B2P2
10B2P2
10A1Q1
12A2Q2
12A3Q3
20D1P3
20D1P3
21C1Q4
21C1Q4
2 REPLIES 2
art297
Opal | Level 21
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

 

adil256
Quartz | Level 8

Thank you very much. Have a good day.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 682 views
  • 1 like
  • 2 in conversation