data jan; informat rundate mmddyy10.; format rundate mmddyy10.; input rundate product $ premthbal curmthbal; cards; 01/05/2012 aaa . 1 01/05/2012 abc . 2 01/05/2012 bbb . 3 01/05/2012 ccc . 4 01/05/2012 ddd . 5 01/05/2012 eee . 6 01/05/2012 fff . 7 01/05/2012 ggg . 8 ; run; data feb; informat rundate mmddyy10.; format rundate mmddyy10.; input rundate product $ premthbal curmthbal; cards; 02/05/2012 aaa . 9 02/05/2012 abc . 8 02/05/2012 bbb . 7 02/05/2012 ccc . 6 02/05/2012 ddd . 5 02/05/2012 eee . 4 02/05/2012 fff . 3 02/05/2012 ggg . 2 ; run; data mar; informat rundate mmddyy10.; format rundate mmddyy10.; input rundate product $ premthbal curmthbal; cards; 03/05/2012 aaa . 1 03/05/2012 abc . 2 03/05/2012 bbb . 3 03/05/2012 ccc . 4 03/05/2012 ddd . 5 03/05/2012 eee . 6 03/05/2012 fff . 7 03/05/2012 ggg . 8 ; run; data apr; informat rundate mmddyy10.; format rundate mmddyy10.; input rundate product $ premthbal curmthbal; cards; 04/05/2012 aaa . 3 04/05/2012 abc . 2 04/05/2012 bbb . 1 04/05/2012 ccc . 3 04/05/2012 ddd . 2 04/05/2012 eee . 1 04/05/2012 fff . 3 04/05/2012 ggg . 2 ; run; data test(keep=product premthbal); set jan; premthbal=curmthbal; run; proc sort data=test; by product; run; proc sort data=feb; by product; run; data final; merge feb test; by product; run; data final1; set jan final; run; data final2; set final1 mar; run; data final3; set final2 apr; run; Pls find the above datasets which has information about the current date as janunary and coming month as Febuary. The situation now is i have to import the data from flat files and each month flatfile is generated with timestamp. Every time i run the code it should have the latest month data and prior month should be appended to latest month data below. My final1 in the above code is working fine. In the same way i want to create final2 & final3. I want final2 output: rundate product premthbal curmthbal 01/05/2012 aaa . 1 01/05/2012 abc . 2 01/05/2012 bbb . 3 01/05/2012 ccc . 4 01/05/2012 ddd . 5 01/05/2012 eee . 6 01/05/2012 fff . 7 01/05/2012 ggg . 8 02/05/2012 aaa 1 9 02/05/2012 abc 2 8 02/05/2012 bbb 3 7 02/05/2012 ccc 4 6 02/05/2012 ddd 5 5 02/05/2012 eee 6 4 02/05/2012 fff 7 2 02/05/2012 ggg 8 1 03/05/2012 aaa 9 1 03/05/2012 abc 8 2 03/05/2012 bbb 7 3 03/05/2012 ccc 6 4 03/05/2012 ddd 5 5 03/05/2012 eee 4 6 03/05/2012 fff 3 7 03/05/2012 ggg 2 8 final3 output: rundate product premthbal curmthbal 01/05/2012 aaa . 1 01/05/2012 abc . 2 01/05/2012 bbb . 3 01/05/2012 ccc . 4 01/05/2012 ddd . 5 01/05/2012 eee . 6 01/05/2012 fff . 7 01/05/2012 ggg . 8 02/05/2012 aaa 1 9 02/05/2012 abc 2 8 02/05/2012 bbb 3 7 02/05/2012 ccc 4 6 02/05/2012 ddd 5 5 02/05/2012 eee 6 4 02/05/2012 fff 7 2 02/05/2012 ggg 8 1 03/05/2012 aaa 9 1 03/05/2012 abc 8 2 03/05/2012 bbb 7 3 03/05/2012 ccc 6 4 03/05/2012 ddd 5 5 03/05/2012 eee 4 6 03/05/2012 fff 3 7 03/05/2012 ggg 2 8 04/05/2012 aaa 1 3 04/05/2012 abc 2 2 04/05/2012 bbb 3 1 04/05/2012 ccc 4 3 04/05/2012 ddd 5 2 04/05/2012 eee 6 1 04/05/2012 fff 7 3 04/05/2012 ggg 8 2 Any help appreciated.
... View more