BookmarkSubscribeRSS Feed
Dingdang
Fluorite | Level 6

Hello,

I have a dataset and sorted it by five variables. One of these variables is named "DIFF". Now I would like to delete all the groups of observations, as long as one of the DIFF equals 0. (Deleting the observations with DIFF equals 0 is simple, but i would to delete the whole group as long as one of the observations has DIFF=0).

I would be very grateful for any help!

BR  Dingdang

1 REPLY 1
DBailey
Lapis Lazuli | Level 10

proc sql;

delete from work.have

where group in (select group from work.have where diff=0);

quit;

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 746 views
  • 0 likes
  • 2 in conversation