Hello, I've got two tables like data pos; input date :mmddyy. positive; format date yymmdd10.; datalines; 1/12/2014 0 1/13/2014 1 1/14/2014 0 1/15/2014 0 1/16/2014 0 1/17/2014 1 ; data dat; input datee :mmddyy. cnt; format datee yymmdd10.; datalines; 1/12/2014 23 1/14/2014 32 1/16/2014 54 1/15/2014 21 1/15/2014 34 1/13/2014 42 ; and i would like to join them with hash to get table like date datee cnt 1/13/2014 1/12/2014 23 1/17/2014 1/14/2014 32 1/17/2014 1/16/2014 54 1/17/2014 1/15/2014 21 1/17/2014 1/15/2014 34 1/13/2014 1/13/2014 42 it means to each date from dat join next date from pos with 1 on column positive. By now I've got this code data def; format date yymmdd10. ; length positive 8; dcl hash nwd (dataset: 'pos'); nwd.definekey('date'); nwd.definedata('positive'); nwd.definedone(); do until (eof); set dat end=eof; rc=nwd.find(key: datee); if (positive=0) then do; date=date+1; end; output; end; run; but it adds only one day. Thanks for help
... View more