Y or N value to the computed column. If you created a
format in the previous step, use it in this formula.
Y for every row of data whose date column corresponds to the definition
of the holiday.
holiday is a
single-character of ‘Y’ or ‘N’ that indicates
whether the date of the data is a holiday.
libname ADMIN BASE "c:\datamarts\smfasw\admin";
proc format library=admin;
value holiday (default=1 min=1 max=1)
'25Dec2010'd = 'Y'
'25Dec2011'd = 'Y'
other = 'N';
run;
if weekday(datepart(datetime)) in (1,7) then shift = '3';
else if timepart(datetime) < '08:00:00't or
timepart(datetime) >= '17:00:00't then shift = '2';
else shift = '1';
if put(DAYDATE,holiday.) eq ‘Y’ then shift = ‘0’;
else if weekday(datepart(datetime)) in (1,7) then shift = '3' ;
else if timepart(datetime) lt '08:00:00't or
timepart(datetime) ge '17:00:00't then shift = '2'; else shift = '1'; Holiday eq 'N'