Hi Mirisage The macro generates the appropriate string for the data set name you are looking for. The %SYSEVALF() is used to transform a SAS date constant into a number (internal representation of a date). The %SYSFUNC() is used to call DATA step functions INTNX() to caluclate the dates needed, which are then formatted using the PUTN(), find below the complete example. %macro name_1(mon); proc sort data=&mon._; by bank_number account_number; run; %mend; %macro someDate( start=, end=); %let start_d = %sysevalf("&start"d); %let end_d = %sysevalf("&end"d); %let nMonths = %sysfunc( intck(MONTH, &start_d, &end_d) ); %do i = 0 %to &nMonths; %let dsnDate_d = %sysfunc(intnx(MONTH, &start_d, &i)); %let dsn = %sysfunc(putn(&dsnDate_d, MONNAME3.))_%sysfunc(putn(&dsnDate_d, YEAR4.)); %put NOTE: &sysmacroname Processing dsn=&dsn; %name_1(&dsn) %end; %mend; %someDate(start=01feb2010, end=01dec2012)
... View more