Online File
Rick Aster: Professional SAS Programming Shortcuts: Contents
data corp.calendar (keep=date openday index=(date) compress=no); length date 4 openday $ 1; format date date9.; do date = '01jan2003'd to '31dec2014'd; month = month(date); day = day(date); weekday = weekday(date); open = weekday notin (1, 7); * U.S. holidays. ; * New Year's Day ; if month = day = 1 then open = 0; * Memorial Day ; if month = 5 and 25 <= day <= 31 and weekday = 2 then open = 0; * Independence Day ; if month = 7 and day = 4 then open = 0; * Labor Day ; if month = 9 and 1 <= day <= 7 and weekday = 2 then open = 0; * Thanksgiving ; if month = 11 and 22 <= day <= 28 and weekday = 5 then open = 0; * Christmas ; if month = 12 and day = 25 then open = 0; openday = put(open, f1.); output; end; run;