Hey Sid,
use the dataset options on the imcoming datasets @ merge step or from clause in sql. Based on data that you have got, you can yourself find out which technique would be better/efficient
data d1;
input id name $10.;
datalines;
10 sushil
20 sas
;;;
run;
data d2;
input id lname $10.;
datalines;
10 nayak
20 base
;;;
run;
data final;
merge d1(in=a firstobs=1 obs=1)
d2(in=b where=(id<20));
by id;
if a and b;
run;
proc print;run;
Things to learn and understand:
WHERE= dataset option usage and working in SQL and datastep
Hope this helps 🙂
Thanks!