Well this didn't work. /*Macro for determining holidays*/ %macro Holiday_MCR; /*holiday counter*/ %let holiday_count=0; %do i=%sysfunc(year(&start_date.)) %to %sysfunc(year(&end_date.)); %if &start_date.<=%sysfunc(holiday(NEWYEAR,&i.)) and %sysfunc(holiday(NEWYEAR,&i.))<= &end_date. %then %let Holiday_count=%eval(&Holiday_count.+1); %if &start_date.<=%sysfunc(holiday(USINDEPENDENCE,&i.))and %sysfunc(holiday(USINDEPENDENCE,&i.))<= &end_date. %then %let Holiday_count=%eval(&Holiday_count.+1); %if &start_date.<=%sysfunc(holiday(MLK,&i.)) and %sysfunc(holiday(MLK,&i.))<= &end_date. %then %let Holiday_count=%eval(&Holiday_count.+1); %if &start_date.<=%sysfunc(holiday(USPRESIDENTS,&i.)) and %sysfunc(holiday(USPRESIDENTS,&i.))<= &end_date. %then %let Holiday_count=%eval(&Holiday_count.+1); %if &start_date.<=%sysfunc(holiday(COLUMBUS,&i.)) and %sysfunc(holiday(COLUMBUS,&i.))<= &end_date. %then %let Holiday_count=%eval(&Holiday_count.+1); %if &start_date.<=%sysfunc(holiday(VETERANS,&i.)) and %sysfunc(holiday(VETERANS,&i.))<= &end_date. %then %let Holiday_count=%eval(&Holiday_count.+1); %if &start_date.<=%sysfunc(holiday(THANKSGIVING,&i.)) and %sysfunc(holiday(THANKSGIVING,&i.))<= &end_date. %then %let Holiday_count=%eval(&Holiday_count.+1); %if &start_date.<=%sysfunc(holiday(CHRISTMAS,&i.)) and %sysfunc(holiday(CHRISTMAS,&i.))<= &end_date. %then %let Holiday_count=%eval(&Holiday_count.+1); %if &start_date.<=%sysfunc(holiday(MEMORIAL,&i.)) and %sysfunc(holiday(MEMORIAL,&i.))<= &end_date. %then %let Holiday_count=%eval(&Holiday_count.+1); %if &start_date.<=%sysfunc(holiday(LABOR,&i.)) and %sysfunc(holiday(LABOR,&i.))<= &end_date. %then %let Holiday_count=%eval(&Holiday_count.+1); %end; %put Holiday count is &holiday_count.; &holiday_count. %mend; data test; begin_date=today()-365; finish_date=today(); call symputx('start_date',begin_date); call symputx('end_date',finish_date); days_diff = intck('WEEKDAY', begin_date, finish_date)-%holiday_mcr.; run; I'm trying to calculate the number of holidays between two date ranges and subtract that from the calculation to get actual working days. However the twist is this must be done with a macro as I am going to be applying it to a lot of different variables.
... View more