The CPM Procedure |
This example illustrates the use of the INTERVAL=, DAYSTART=, and DAYLENGTH= options to control the project calendar. In Example 2.1 through Example 2.5, none of these three options is specified; hence the durations are assumed to be days (INTERVAL=DAY), and work is scheduled on all seven days of the week. In Example 2.6, the specification of INTERVAL=WEEKDAY causes the schedule to skip weekends. The present example shows further ways of controlling the project calendar. For example, you may want to control the work pattern during a standard week or the start and length of the workday.
Suppose you want to schedule the project specified in Example 2.1 but you want to schedule only on weekdays from 9 a.m. to 5 p.m. To schedule the project, use the INTERVAL=WORKDAY option rather than the default INTERVAL=DAY. Then, one unit of duration is interpreted as eight hours of work. To schedule the manufacturing project to start on December 1, with an eight-hour workday and a five-day work week, you can invoke PROC CPM with the following statements. Output 2.7.1 displays the resulting schedule; the start and finish times are expressed in SAS datetime values.
title 'Controlling the Project Calendar'; title2 'Scheduling on Workdays'; proc cpm data=widget date='1dec03'd interval=workday; activity task; succ succ1 succ2 succ3; duration days; run; title3 'Day Starts at 9 a.m.'; proc print; id task; var e_: l_: t_float f_float; run;Output 2.7.1: Controlling the Project Calendar: INTERVAL=WORKDAY
If you want to change the length of the workday, use the DAYLENGTH= option in the PROC CPM statement. For example, if you want an eight-and-a-half hour workday instead of the default eight-hour workday, you should include DAYLENGTH='08:30'T in the PROC CPM statement. In addition, you might also want to change the start of the workday. The workday starts at 9 a.m., by default. To change the default, use the DAYSTART= option. The following program schedules the project to start at 7 a.m. on December 1. The project is scheduled on eight-and-a-half hour workdays each starting at 7 a.m. Output 2.7.2 displays the resulting schedule produced by PROC CPM.
proc cpm data=widget date='1dec03'd interval=workday daylength='08:30't daystart='07:00't; activity task; succ succ1 succ2 succ3; duration days; run;
title3 'Day Starts at 7 a.m. and is 8.5 Hours Long'; proc print; id task; var e_: l_: t_float f_float; run;Output 2.7.2: Controlling the Project Calendar: DAYSTART and DAYLENGTH
|
An alternate way of specifying the start of each working day is to set the INTERVAL= option to DTWRKDAY and specify a SAS datetime value for the project start date. Using INTERVAL=DTWRKDAY tells CPM that the DATE= option is a SAS datetime value and that the time given is the start of the workday. For the present example, you could have used DATE='1dec03:07:00'dt in conjunction with the specification INTERVAL=DTWRKDAY and DAYLENGTH='08:30't.
Copyright © 2008 by SAS Institute Inc., Cary, NC, USA. All rights reserved.