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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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