When posting data make sure that
you post the data as working data step code
and that all cases that exist in your real data are present at least once.
Idea to solve the problem:
create a dataset containing all obs with "Adverse event"
use that dataset to create another one having only those obs with aedis = "Yes"
finally something like this:
proc sql noprint;
create table work.want as
select * from work.adverse_events
where subject not in (select subject from work.aedis)
;
quit;
Code is, of course, untested. Using a single step with two dow-loops seems to be the better approach, as less iteration are required.
... View more