Not sure if this is the right forum for this, but here goes:
I want to be able to build one data set with multiple data sets without having to write multiple set statements. The datasets are in a specific library and in the format example: hist9.aae200601
With the last 2 characters representing the month (01=January, 02=February, etc, etc).
Here is the code I have started with:
%macro names(lib,year,maxnum);
%do dt=1 %to &maxnum;
&lib&year&i;
%end;
;
%mend names;
/* Call the macro on the SET statement */
data all;
set %names(hist9.Aae,2000,5);
keep asc;
run;
So if the code runs correctly, it will build data all with data sets hist9.aae200001 - hist9.200005.
The problem is when it processes it is looking for a one digit month, so 1,2,3...instead of 01, 02, 03...so it stops without working.
Any thoughts?