** Julian date 1995043 is 43rd day of 1995, i.e. Feb. 12, 1995 ** ** Floor(1995.043) is 1995 and 1000*floor(1995.043) is 1995000 ** ** so 1995043-1995000 = 43, the day of the year. **; %macro doy(date, y); &y = juldate7(&date)-1000*floor(juldate7(&date)/1000); %mend doy; data claims; infile cards; input claim date7. @10 accident mmddyy6. @17 time time.; format time time.; format claim mmddyy.; format accident mmddyy.; Delay=claim-accident; dayofyear= juldate(accident)-1000*floor(juldate(accident)/1000); %doy('21dec95'd, cut4); %doy('22sep95'd, cut3); %doy('20jun95'd, cut2); %doy('19mar95'd, cut1); drop cut1-cut4; season = "winter"; if dayofyear>cut1 then season = "spring"; if dayofyear>cut2 then season = "summer"; if dayofyear>cut3 then season = " fall"; if dayofyear>cut4 then season = "winter"; *23456789 123456789 123456; cards; 11nov96 102396/12:38 22dec95 012395/01:42 26apr95 042395/03:05 02jul94 070294/06:25 08mar96 123095/18:33 15dec96 061296/18:12 09nov94 110594/22:14 ; proc print; run;