data mydata;
infile datalines;
input list $ NDC discount;
datalines;
Nov 11 50
Dec 12 20
Nov 11 50
May 12 .
Mar 11 30
;
run;
data mydata2;
infile datalines;
input list $ NDC discount;
datalines;
Jan 11 40
Dec 12 20
Mar 10 50
May 12 .
Mar 11 30
;
run;
proc sql;
create table x1 as
select *
from mydata t1 left join mydata2 t2 on(t1.list=t2.list);
quit;
proc sort data=mydata;
by list;
run;
proc sort data=mydata2;
by list;
run;
data x2;
merge mydata(in=t1) mydata2;
by list;
if t1;
run; Results X1: Results X2: There is a topic on the forum like this one, but I would like to know how to correct the proc sql to get the same result from the SAS. can anybody help me?
... View more