Maybe somemthin like this data have;
input name $ start: ddmmyy10. end: mmddyy10.;
format start end date9.;
datalines;
Linda 11/02/2020 01/01/2022
Jimmie 10/01/2019 01/10/2021
Sean 11/01/2018 01/11/2020
Maya 12/01/2020 01/12/2023
;
run;
data temp;
set have;
temp_month = intck('MONTH',start,end);
%*Kopierer unikke records til de manglende måneder;
do i= 0 to temp_month;
periode = intnx('MONTH', start, i, 'B' );
output;
end;
run;
proc sql;
select year(periode) as year, month(periode) as month, count(1)
from temp
group by year, calculated month
;
quit;
... View more