DATA Step, Macro, Functions and more

delete observations of a by group with certain property

Reply
Contributor
Posts: 57

delete observations of a by group with certain property

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

Super Contributor
Posts: 578

Re: delete observations of a by group with certain property

proc sql;

delete from work.have

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

quit;

Ask a Question
Discussion stats
  • 1 reply
  • 151 views
  • 0 likes
  • 2 in conversation