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-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 1047 views
  • 0 likes
  • 2 in conversation