Well, at a quick glance (as I am about to leave) see below to create intermediate dataset, then use that to merge. Also see if there are any other restrictions you could put in place, maybe summing data up, or transposing the data. proc sql; /* Create an intermediary dataset with only the relevant data, i.e. has a match and only contains columns we need */ create table inter as select vaxrecordnum, dosevalidity from livevaxviolations where vaxrecordnum in (select distinct vaxrecordnum from fullydedupeddate); create table livevirusvalidateddata as select f.*, l.dosevalidity from fullydedupeddata f left join inter l on f.vaxrecordnum = l.vaxrecordnum order by cdcid, vaxdate, vaxgroup; quit;
... View more