The CPM Procedure |
This example illustrates the use of multiple calendars within a project. Different scenarios are presented to show the use of different calendars and how project schedules are affected. Output 2.10.1 shows the data set WORKDATA, which defines several shift patterns. These shift patterns are appropriately associated with three different calendars in the data set CALEDATA, also shown in the same output. The three calendars are defined as follows:
The same set of holidays is used as in Example 2.9, except that in this case the holiday for New Year's is defined by specifying both the start and finish time for the holiday instead of defaulting to a one-day long holiday. When multiple calendars are involved, it is often less confusing to define holidays by specifying both a start and a finish time for the holiday instead of the start time and duration. Output 2.10.2 displays the Holiday data set.
Output 2.10.2: Holiday Data SetThe data set HOLIDAYS does not include any variable identifying the calendars with which to associate the holidays. By default, the procedure associates the two holiday periods with all the calendars.
An easy way to visualize all the breaks and holidays for each calendar is to use a Gantt chart, plotting a bar for each calendar from the start of the project to January 4, 2004, with all the holiday and work shift specifications. The following program produces Output 2.10.3. Holidays and breaks are marked with a solid fill pattern.
goptions hpos=160 vpos=25 ftext=swiss; title h=1.5 'Multiple Calendars'; title2 'Breaks and Holidays for the Different Calendars'; proc gantt data=cals graphics calendar=calendar holidata=holidays workday=workdata; chart / interval=dtday mininterval=dthour skip=2 holiday=(holiday) holifin=(holifin) markbreak daylength='08:00't calid=cal ref='1dec03:00:00'dt to '4jan04:08:00'dt by dtday nolegend nojobnum increment=16 hpages=6; id cal; run;Output 2.10.3: Gantt Chart Showing Breaks and Holidays for Multiple Calendars
The Activity data set used in Example 2.9 is modified by adding a variable called cal, which sets the calendar to be 'PROD_CAL' for the activity 'Production', and 'OVT_CAL' for the activity 'Prototype', and the DEFAULT calendar for the other activities. Thus, in both the Activity data set and the Calendar data set, the calendar information is conveyed through a CALID variable, cal.
PROC CPM is first invoked without reference to the CALID variable. Thus, the procedure recognizes only the first observation in the Calendar data set (a warning is printed to the log to this effect), and only the default calendar is used for all activities in the project. The daylength parameter is interpreted as the length of a standard work day; all the durations are assumed to be in units of this standard work day. Output 2.10.4 displays the schedule obtained. The project is scheduled to finish on March 12, 2004, at 12 noon.
data widgcal; set widget9; if task = 'Production' then cal = 'PROD_CAL'; else if task = 'Prototype' then cal = 'OVT_CAL'; else cal = 'DEFAULT'; run; proc cpm date='01dec03'd data=widgcal out=scheddef holidata=holidays daylength='08:00't workday=workdata calendar=calendar; holiday holiday / holifin = holifin; activity task; duration days; successor succ1 succ2 succ3; run; title2 'Project Schedule: Default calendar'; proc print; var task days e_start e_finish l_start l_finish t_float f_float; run;Output 2.10.4: Schedule Using Default Calendar
Next PROC CPM is invoked with the CALID statement identifying the variable CAL in the Activity and Calendar data sets. Recall that the two activities, 'Production' and 'Prototype', do not follow the default calendar. The schedule displayed in Output 2.10.5 shows that, due to longer working hours for these two activities in the project, the scheduled finish date is now March 8, at 10:00 a.m.
proc cpm date='01dec03'd data=widgcal out=schedmc holidata=holidays daylength='08:00't workday=workdata calendar=calendar; holiday holiday / holifin = holifin; activity task; duration days; successor succ1 succ2 succ3; calid cal; run;
title2 'Project Schedule: Three Calendars'; proc print; var task days cal e_: l_: t_float f_float; run;Output 2.10.5: Schedule Using Three Calendars
|
Now suppose that the engineer in charge of writing specifications requests a seven-day vacation from December 8, 2003. How is the project completion time going to be affected? A new calendar, Eng_cal, is defined that has the same work pattern as the default calendar, but it also contains an extra vacation period. Output 2.10.6 displays the data sets HOLIDATA and CALEDATA, which contain information about the new calendar. The fourth observation in the data set CALEDATA has missing values for the variables _sun_, ..., _sat_, indicating that the calendar, Eng_cal, follows the same work pattern as the default calendar.
Output 2.10.6: HOLIDATA and CALEDATA Data SetsOnce again, in the following code, PROC GANTT is used to compare the new calendar with the default calendar, as shown in Output 2.10.7. Note that the breaks and holidays are marked with a solid fill pattern.
/* Create a data set to illustrate holidays with PROC GANTT */ data cals2; e_start='1dec03:00:00'dt; e_finish='18dec03:00:00'dt; label cal ='Schedule Breaks / Holidays'; format e_start e_finish datetime16.; length cal $8.; cal='DEFAULT' ; output; cal='Eng_cal' ; output; run; title2 'Breaks and Holidays for Eng_cal and the DEFAULT Calendar'; proc gantt data=cals2 graphics calendar=caledata holidata=holidata workday=workdata; chart / interval=dtday mininterval=dthour skip=2 holiday=(holiday) holifin=(holifin) holidur=(holidur) markbreak daylength='08:00't calid=cal ref='1dec03:00:00'dt to '18dec03:00:00'dt by dtday nojobnum nolegend increment=16 hpages=3; id cal; run;Output 2.10.7: Difference between Eng_cal and DEFAULT Calendar
The Activity data set is modified to redefine the calendar for the task 'Write Specs'. PROC CPM is invoked, and Output 2.10.8 shows the new schedule obtained. Note the effect of the Engineer's vacation on the project completion time. The project is now scheduled to finish at 10 a.m. on March 9, 2004; in effect, the delay is only one day, even though the planned vacation period is seven days. This is due to the fact that the activity 'Write Specs', which follows the new calendar, had some slack time present in its original schedule; however, this activity has now become critical.
data widgvac; set widgcal; if task = 'Write Specs' then cal = 'Eng_cal'; run; proc cpm date='01dec03'd data=widgvac out=schedvac holidata=holidata daylength='08:00't workday=workdata calendar=caledata; holiday holiday / holifin = holifin holidur=holidur; activity task; duration days; successor succ1 succ2 succ3; calid cal; run; title2 'Project Schedule: Four Calendars'; proc print; var task days cal e_: l_: t_float f_float; run;Output 2.10.8: Schedule Using Four Calendars
|
Copyright © 2008 by SAS Institute Inc., Cary, NC, USA. All rights reserved.