I have dataset that looks like this Client Lowes 01Sept2020 Home Dept 01Sept2020 Lowes 01Sep2020 Lowes 02Sep2020 looking for Lowes 01Sep2020 count is 2 Home Depot 01Sep2020 count is 1 I want to calculate daily occurrence for Lowes and Home Dept and find median or Average for month of Sep I was able to get all dates for September but cannot figure out how to do the count? I have dataset query but need help with looping through each date to get daily records here is loop for getting dates 01Sep2020 02Sep2020..... proc sql; %macro date_loop(start,end); %let start=%sysfunc(inputn(&start,anydtdte9.)); %let end=%sysfunc(inputn(&end,anydtdte9.)); %let dif=%sysfunc(intck(day,&start,&end)); %do i=0 %to &dif; %let date=%sysfunc(intnx(day,&start,&i,b),date9.); %put &date; %end; %mend date_loop; %date_loop(01sep2020,30sep2020) quit; Thanks you in advance Mona
... View more