Example 2.8: Scheduling around Holidays
This example shows how you can schedule around holidays with
PROC CPM. First, save a list of holidays in a SAS data set
as SAS date variables. The length of the holidays is assumed to be
measured in units specified by the INTERVAL= option. By default,
all holidays are assumed to
be one unit long. You can control the length of each holiday by
specifying either the finish time for each holiday or the length of each
holiday in the same observation as the holiday specification.
Output 2.8.1: Scheduling around Holidays: HOLIDAYS data set
Scheduling Around Holidays 
Data Set HOLIDAYS 
Obs 
holiday 
holifin 
holidur 
1 
25DEC91 
27DEC91 
4 
2 
01JAN92 
. 
. 

For example, the data set HOLIDAYS, displayed in Output 2.8.1
specifies
two holidays, one for Christmas and the other for New Year's Day. The
variable holiday specifies the start of each holiday. The
variable holifin
specifies the end of the Christmas holiday as 27Dec91. Alternately, the
variable holidur can be used to interpret the Christmas holiday as
lasting four interval units starting from the 25th of December. If the
variable holidur is used, the actual days when work is not done depends on
the INTERVAL= option and on the underlying calendar used. This form
of specifying holidays or breaks is useful for indicating vacations for
specific employees. The second observation in the data set defines
the New Year's holiday as just one day long because both the variables
holifin and holidur variables have missing values.
To invoke PROC CPM to schedule around holidays, use the HOLIDATA= option
in the PROC CPM statement (see the following program) to identify the data set,
and list the names of the variables in the data set in a HOLIDAY
statement. The holiday start and finish are identified
by specifying the HOLIDAY and HOLIFIN variables. Output 2.8.2 displays
the schedule obtained.
proc cpm data=widget holidata=holidays
out=saveh date='2dec91'd ;
activity task;
succ succ1 succ2 succ3;
duration days;
holiday holiday / holifin=(holifin);
run;
proc sort data=saveh;
by e_start;
run;
TITLE 'Scheduling Around Holidays';
title2 'Project Schedule';
goptions vpos=50 hpos=80 border;
goptions ftext=swiss;
proc gantt graphics data=saveh holidata=holidays;
chart / compress
font=swiss height=1.5 nojobnum skip=2
dur=days increment=7
holiday=(holiday) holifin=(holifin)
cframe=ligr;
id task;
run;
Output 2.8.2: Scheduling around Holidays: Project Schedule
The next two invocations illustrate the use of the HOLIDUR= option and
the effect of the INTERVAL= option on the duration of the holidays.
Recall that the holiday duration is also
assumed to be in interval units where interval
is the
value specified for the INTERVAL= option. Suppose that a holiday
period for the entire project starts on December 25, 1991, with duration
specified as 4. First the project is scheduled with INTERVAL=DAY so
that the holidays are on December 25, 26, 27, and 28, 1991.
Output 2.8.3 displays the resulting schedule. The project completion
is delayed by one day due to the extra holiday on December 28, 1991.
proc cpm data=widget holidata=holidays
out=saveh1 date='2dec91'd
interval=day;
activity task;
succ succ1 succ2 succ3;
duration days;
holiday holiday / holidur=(holidur);
run;
TITLE2 'Variable Length Holidays : INTERVAL=DAY';
proc sort data=saveh1;
by e_start;
run;
proc gantt graphics data=saveh1 holidata=holidays;
chart / compress
font=swiss
height=1.5 skip=2
nojobnum
dur=days increment=7
holiday=(holiday) holidur=(holidur) interval=day
cframe=ligr;
id task;
run;
Output 2.8.3: Scheduling around Holidays: INTERVAL=DAY
Next, suppose that work on the project is to be scheduled only on
weekdays. The INTERVAL= option is set to WEEKDAY. Then, the
value `4' specified for the variable holidur is interpreted as 4
weekdays. Thus, the holidays are on December 25, 26, 27, and 30, 1991,
because December 28 and 29 (Saturday and Sunday) are nonworking days
anyway. (Note that if holifin had been used, the holiday would have
ended on December 27, 1991.)
The following statements schedule the project to start on
December 2, 1991
with INTERVAL=WEEKDAY. Output 2.8.4 displays the resulting schedule.
Note the further delay in project completion time.
proc cpm data=widget holidata=holidays
out=saveh2 date='2dec91'd
interval=weekday;
activity task;
succ succ1 succ2 succ3;
duration days;
holiday holiday / holidur=(holidur);
run;
proc sort data=saveh2;
by e_start;
run;
TITLE2 'Variable Length Holidays : INTERVAL=WEEKDAY';
proc gantt graphics data=saveh2 holidata=holidays;
chart / compress
font=swiss
height=1.5 skip=2
nojobnum
dur=days increment=7
holiday=(holiday)
holidur=(holidur)
interval=weekday
cframe=ligr;
id task;
run;
Output 2.8.4: Scheduling around Holidays: INTERVAL=WEEKDAY
Finally, the same project is scheduled to start on December 2, 1991 with
INTERVAL=WORKDAY. Output 2.8.5 displays the resulting
Schedule data set.
Note that this time the holiday period
starts at 5:00 p.m. on December 24, 1991,
and ends at 9:00 a.m. on December 31, 1991.
proc cpm data=widget holidata=holidays
out=saveh3 date='2dec91'd
interval=workday;
activity task;
succ succ1 succ2 succ3;
duration days;
holiday holiday / holidur=(holidur);
run;
proc sort data=saveh3;
by e_start;
run;
TITLE2 'Variable Length Holidays : INTERVAL=WORKDAY';
proc gantt graphics data=saveh3 holidata=holidays;
chart / compress
font=swiss height=1.5 nojobnum skip=2
dur=days increment=7
holiday=(holiday) holidur=(holidur) interval=workday
cframe=ligr;
id task;
run;
Output 2.8.5: Scheduling around Holidays: INTERVAL=WORKDAY
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.