If you're interested in DATA step solutions, you could use a double-DoW loop. It requires two passes of the data, and the data must be sorted. You process the data in groups, by Security_ID, first to identify whether Ticker changes within the group, and then a second time to output the records for Security_ID groups where Ticker is constant.
data want;
do until(last.Security_ID);
set have;
by Security_ID Ticker;
*If ticker changes within security_ID, flag the security_ID;
if first.Ticker=1 and first.Security_ID=0 then _deleteme=1;
end;
do until(last.Security_ID);
set have;
by Security_ID;
if NOT (_deleteme) then output;
end;
drop _: ;
run;
w
... View more