I am hoping to get code that will loop through the past 49 months of data and import the SAS dataset saved there and then append all 49 together with a new column for the date from the file name. DATA _NULL_; DO i = 1 to 49; DATA _NULL_; MP1DB = INTNX('month',today(),-i,'B'); CALL SYMPUTX ('CURRENTMONTH',CATS(SUBSTR(PUT(MP1DB,yymmn6.),1,4), '-',SUBSTR(PUT(MP1DB,yymmn6.),5,2))); RUN; libname wm "\\SFLC-SAS-AP\pod-data3\MDR\&CURRENTMONTH.\ValueOfInventory\"; data work.oh_di_all_MPi; set wm.oh_di_all_:; month=&CURRENTMONTH.; run; END; RUN; %macro append; data work.oh_di_all; set %do i = 1 %to 49; oh_di_all_MP&i %end; ; run; %mend append; %append;
... View more