Here is one way: data want (drop=last); set table1; set table2; retain last; by player game; if first.player then call missing(last); if not missing(score2) then last=score2; if missing(score2) then score2=last; if score1 gt score2 then output; run;
... View more