Im pretty decent with SAS coding but have one thing that is getting the better of me. I have various datasets that is dated for each month. Say X_201501, X_201502 ... X201601; Now I would like a use to input the current month and 12months prior; So %let currentmonth= 201601; and %let previousyearmonth=201501; I would then like to append all the tables from 201501 to 201601. I used the following code: Data Combined; set X_¤tmonth.- X_&previousyearmonth.;run; The problem is that it is now looking for tables such as 201579 and 201580 all the way until it gets to 201601. But we all know there are only 12months in a year. So essentially it should only look for the following tables: X_201501, X_201502, X_201503, X_201504, X_201505, X_201506, X_201507, X_201508, X_201509,X_201510,X_201511, X_01512, X_201601 So how does one code this so SAS only adds the above tables. The ideal would be that I dont have to request users to input all the above 12months in the data. Regards Riaan
... View more