Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
The CPM Procedure

Example 2.7: Controlling the Project Calendar

This example illustrates the use of the INTERVAL=,   DAYSTART=, and DAYLENGTH= options to control the project calendar. In Examples 2.1 through 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 2, 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.

   title 'Controlling the Project Calendar';
   title2 'Scheduling on Workdays';
   proc cpm data=widget date='2dec91'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

Controlling the Project Calendar
Scheduling on Workdays
Day Starts at 9 a.m.

task E_START E_FINISH L_START L_FINISH T_FLOAT F_FLOAT
Approve Plan 02DEC91:09:00:00 06DEC91:16:59:59 02DEC91:09:00:00 06DEC91:16:59:59 0 0
Drawings 09DEC91:09:00:00 20DEC91:16:59:59 09DEC91:09:00:00 20DEC91:16:59:59 0 0
Anal. Market 09DEC91:09:00:00 13DEC91:16:59:59 20JAN92:09:00:00 24JAN92:16:59:59 30 0
Write Specs 09DEC91:09:00:00 13DEC91:16:59:59 16DEC91:09:00:00 20DEC91:16:59:59 5 5
Prototype 23DEC91:09:00:00 10JAN92:16:59:59 23DEC91:09:00:00 10JAN92:16:59:59 0 0
Mkt. Strat. 16DEC91:09:00:00 27DEC91:16:59:59 27JAN92:09:00:00 07FEB92:16:59:59 30 30
Materials 13JAN92:09:00:00 24JAN92:16:59:59 13JAN92:09:00:00 24JAN92:16:59:59 0 0
Facility 13JAN92:09:00:00 24JAN92:16:59:59 13JAN92:09:00:00 24JAN92:16:59:59 0 0
Init. Prod. 27JAN92:09:00:00 07FEB92:16:59:59 27JAN92:09:00:00 07FEB92:16:59:59 0 0
Evaluate 10FEB92:09:00:00 21FEB92:16:59:59 17FEB92:09:00:00 28FEB92:16:59:59 5 5
Test Market 10FEB92:09:00:00 28FEB92:16:59:59 10FEB92:09:00:00 28FEB92:16:59:59 0 0
Changes 02MAR92:09:00:00 06MAR92:16:59:59 02MAR92:09:00:00 06MAR92:16:59:59 0 0
Production 09MAR92:09:00:00 09MAR92:09:00:00 09MAR92:09:00:00 09MAR92:09:00:00 0 0
Marketing 10FEB92:09:00:00 10FEB92:09:00:00 09MAR92:09:00:00 09MAR92:09:00:00 20 20


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 2. 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='2dec91'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

Controlling the Project Calendar
Scheduling on Workdays
Day Starts at 7 a.m. and is 8.5 Hours Long

task E_START E_FINISH L_START L_FINISH T_FLOAT F_FLOAT
Approve Plan 02DEC91:07:00:00 06DEC91:15:29:59 02DEC91:07:00:00 06DEC91:15:29:59 0 0
Drawings 09DEC91:07:00:00 20DEC91:15:29:59 09DEC91:07:00:00 20DEC91:15:29:59 0 0
Anal. Market 09DEC91:07:00:00 13DEC91:15:29:59 20JAN92:07:00:00 24JAN92:15:29:59 30 0
Write Specs 09DEC91:07:00:00 13DEC91:15:29:59 16DEC91:07:00:00 20DEC91:15:29:59 5 5
Prototype 23DEC91:07:00:00 10JAN92:15:29:59 23DEC91:07:00:00 10JAN92:15:29:59 0 0
Mkt. Strat. 16DEC91:07:00:00 27DEC91:15:29:59 27JAN92:07:00:00 07FEB92:15:29:59 30 30
Materials 13JAN92:07:00:00 24JAN92:15:29:59 13JAN92:07:00:00 24JAN92:15:29:59 0 0
Facility 13JAN92:07:00:00 24JAN92:15:29:59 13JAN92:07:00:00 24JAN92:15:29:59 0 0
Init. Prod. 27JAN92:07:00:00 07FEB92:15:29:59 27JAN92:07:00:00 07FEB92:15:29:59 0 0
Evaluate 10FEB92:07:00:00 21FEB92:15:29:59 17FEB92:07:00:00 28FEB92:15:29:59 5 5
Test Market 10FEB92:07:00:00 28FEB92:15:29:59 10FEB92:07:00:00 28FEB92:15:29:59 0 0
Changes 02MAR92:07:00:00 06MAR92:15:29:59 02MAR92:07:00:00 06MAR92:15:29:59 0 0
Production 09MAR92:07:00:00 09MAR92:07:00:00 09MAR92:07:00:00 09MAR92:07:00:00 0 0
Marketing 10FEB92:07:00:00 10FEB92:07:00:00 09MAR92:07:00:00 09MAR92:07:00:00 20 20


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='2dec91:07:00'dt in conjunction with the specification INTERVAL=DTWRKDAY and DAYLENGTH='08:30't.

Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Top
Top

Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.