Hi All, I am writing a macro, which would remove records from my base dataset based on another table values(status), meaning status table: id emp_no status 1 23333 expired 2 44444 active 3 66666 expired Base table id emp_no DOB address 1 23333 26-Oct-1990 Street 1 2 44444 23-jan-1990 Street 2 3 66666 14-feb-1987 Street 3 Output table(required) id emp_no DOB address 2 44444 23-jan-1990 Street 2 I have done it using merge, is there any more efficient way to achieve the same. ? proc sql; create table status as (select empno,status from status where status = 'expired');run; data outputds; merge base(in=a) status(in=b) by emp_no; if b then output expired; else output outputds; run;
... View more