SAS sql into sas data step
proc sql noprint;
create table tableC as
slect A.a,A.b,A.c,B.d,B.e
from tableA A
inner join tableB B
on A.b=B.b;
delete from tableC
where not (substr(d,1,1)='1' and length(trim(d))=11)
or d is null;
delete from tableC
where d in
(select d from tableC group by d having count(1)>1);
quit;
thank you for your time!