I'm aware that INTCK counts the number of intervals between two periods, but I'd like to get a truncated version of the actual count (i.e. 12 rather than 12.3 or 12.7). I think this code does it but I'm wonder if there is function that would do the same rather than multiple lines of code data _null_; format s_dt l_dt alt_end date9.; s_dt = mdy(12,31,2008); l_dt = mdy(1,1,2010); months = intck('month',s_dt,l_dt); alt_end = intnx('month',s_dt,months,'same'); if l_dt lt alt_end then trunc_month=months-1; else trunc_month=months; putlog _all_; run;
... View more