data table1; input custid name $ salary pan $ aprv ; informat aprv anydtdte.; format aprv ddmmyy10.; cards; 001 john 200000 AAAAAA 02/02/2014 002 raju 300000 BBBBBB 01/01/2013 002 raju 400002 BBBBBB 01/01/2014 003 david 600000 CCCCCC 04/04/2013 004 krishna 203030 DDDDDD 05/02/2015 005 mukesh 240000 EEEEEE 04/03/2014 003 david 782226 CCCCCC 08/05/2014 ; run; data table2; input custid name$ salary pan$ aprv :anydtdte.; format aprv ddmmyy10.; cards; 002 raju 400000 BBBBBB 12/05/2015 005 mukesh 240000 EEEEEE 12/05/2015 003 david 782226 CCCCCC 01/7/2015 ; run; data want; if _n_ eq 1 then do; if 0 then set table2; declare hash h(dataset:'table2'); h.definekey('custid'); h.definedone(); end; set table1; if h.check()=0; run; proc append base=want data=table2 force;run; proc sort data=want;by custid;run;
... View more