- %macro Vtime(data,start,end,out);
- proc contents data=&data. out=tmp noprint;run;
- %macro next_mth(time);
- %let year=%eval(&time./100);
- %let mth=%eval(&time.-&year.*100);
- %let mth=%eval(&mth.+1);
- %if &mth>12 %then %do;
- %let mth=%eval(&mth.-12);
- %let year=%eval(&year.+1);
- %end;
- %if &mth.<10 %then %let mth=0&mth.;
- %if &year.<10 %then %let year=0&year.;
- &year.&mth.
- %mend;
- %let tmp_out=;
- %let mon=&start.;
- %do %while(&mon.<=&end.);
- proc sql noprint;
- select name into: tmp separated by ' '
- from tmp
- where name like "%_&mon.";
- quit;
- %let tmp_out=&tmp_out &tmp;
- %let mon=%next_mth(&mon.);
- %end;
- %let &out=&tmp_out;
- %mend;
- %Vtime(input,0701,0712,out);
- %put &out;