Here's a minor tweak on @FreelanceReinh 's suggestion. This code avoids reading through the matching observations before accepting the "extras". Instead, it uses "firstobs=" to jump directly to the extra obs in the longer dataset:
data _null_;
if 0 then set BAU_0000_1_CASH_COLLECTED nobs=n1;
if 0 then set BAU_0000_2_CASH_COLLECTED nobs=n2;
if n1^=n2;
fobs=min(n1,n2)+1;
call execute ('data want;');
call execute (catx(' ','set',ifc(n1>n2,'BAU_0000_1_CASH_COLLECTED','BAU_0000_2_CASH_COLLECTED'),'(firstobs=',fobs,');'));
call execute ('run;');
run;
... View more