Online File
Rick Aster: Professional SAS Programming Shortcuts: Contents
data corp.calendar (keep=date openday index=(date)); set work.month; array days{6, 7} $ 2; array flag{6, 7} $ 1; week = 1; do day = 1 to 31; date = mdy(month, 1, year) + day - 1; if month(date) > month then delete; weekday = weekday(date); if day > 1 and weekday = 1 then week + 1; openday = flag{week, weekday}; output; end; run;