Sure . That is possible . data Table1;
input Subject ( pd_1 pd_2 pd_3 pd_4 ) (:date9.);
format pd_: date9.;
cards;
100 21NOV2013 19DEC2013 16JAN2014 3FEB2014
;
run;
data Table2;
input Subject Response_Date : yymmdd10.;
format Response_Date date9.;
cards;
100 2013-11-29
100 2013-12-19
100 2014-01-16
100 2014-02-14
100 2014-03-13
;
run;
data want(drop=i Response_Date date);
if _n_ eq 1 then do;
if 0 then set table2;
declare hash ha(dataset:'table2',hashexp:16);
ha.definekey('Subject','Response_Date');
ha.definedone();
end;
set table1;
array x{*} pd_:;
do i=1 to dim(x);
do date=x{i}-7 to x{i}+7 ;
Response_Date=date;
if ha.check()=0 then call missing(x{i});
end;
end;
run;
Xia Keshan
... View more