BookmarkSubscribeRSS Feed
ger15xxhcker
Quartz | Level 8

Hi!

 

 

data test;
input id date$ var1$ var2$;
datalines;
1 20900101 abc abc2
2 20070102 cdf cdf2
2 20900101 jdk lao2
1 20110101 cds sxa
1 20150202 jui wsa
3 20900101 wer wes2 
1 21000101 rte www
4 20190101 www rrr ; run;

This is my test data set. I'm looking for a solution for keeping the specified rows. If there is a 20900101  date from a particular id, then keep it. The other rows which have the same ID just drop it or delete .

 

so my final table I want it to look like that:

data test;
input id date$ var1$ var2$;
datalines;
1 20900101 abc abc2
2 20900101 jdk lao2
3 20900101 wer wes2
4 20190101 www rrr
;
run;

Thanks for your help!

 

1 REPLY 1
novinosrin
Tourmaline | Level 20

Are you asking for

data want;
set test;
if date='20900101';
run; 

or 

 

where date= '20900101';

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 1 reply
  • 344 views
  • 0 likes
  • 2 in conversation