The CPM Procedure

Example 3.25 Resource-Driven Durations and Alternate Resources

(View the complete code for this example.)

Consider the software project defined in Example 3.24 but now the project requires a single resource: a programmer. A network diagram displaying the activities and their precedence relationships is shown in Output 3.24.1, as part of the same example.

Some of the activities in this project have a fixed duration, requiring a fixed length of time from a programmer. Other activities specify the amount of work required in terms of man-days; for these activities, the length of the task will depend on the number of programmers (or rate) that is assigned to the task. The activities in the project, their durations (if fixed) or the total work required (if resource-driven) in days, the precedence constraints, and the resource requirements are displayed in Output 3.25.1.

Suppose that you have only one programmer assigned to the project. You can determine a resource-constrained schedule using PROC CPM by specifying a resource availability data set, resin (also in Output 3.25.1). The Resource data set indicates that the resource Programmer is a driving resource whenever the WORK variable has a valid value.

Output 3.25.1: Project Data

Software Development
Activity Data Set SOFTWARE

Activityacts1s2durmandaysProgrammer
Plans & Reqts1232.1
Product Design245.31
Test Plan3673..
Documentation49.121
Code58.1101
Test Data68.5..
Test Routines78.5..
Test Product89.6.1
Finish9..0..

Software Development
Resource Availability Data Set

ObsperotypeProgrammer
1.resrcdur1
212APR27reslevel1


The following statements invoke PROC CPM with a WORK= specification on the RESOURCE statement, which identifies (in number of man-days, in this case) the amount of work required from the resource Programmer for each activity. If the WORK variable has a missing value, the activity in that observation is assumed to have a fixed duration. The project is scheduled to start on April 12, 2027, and the activities are assumed to follow a five-day work week. The resulting schedule is displayed in Output 3.25.2. For each activity in the project, the value of the variable DUR_TYPE indicates whether the resource drives the activity’s duration ('RDRIVEN') or not ('FIXED').

proc cpm data=software
         out=sftout1 resout=rout1
         rsched=rsftout1
         resin=resin
         date='12apr27'd interval=weekday;
   act act;
   succ s1 s2;
   dur dur;
   res Programmer / work=mandays
                    obstype=otype
                    period=per
                    rschedid=Activity;
   id Activity;
   run;

title 'Software Development';
title2 'Resource Constrained Schedule: Single Programmer';
proc print data=rsftout1 heading=h;
   id Activity;
   run;

Output 3.25.2: Resource Schedule

Software Development
Resource Constrained Schedule: Single Programmer

ActivityactRESOURCEDUR_TYPEdurmandaysR_RATES_STARTS_FINISHE_STARTE_FINISHL_STARTL_FINISH
Plans & Reqts1  2..12APR2713APR2712APR2713APR2712APR2713APR27
Plans & Reqts1ProgrammerFIXED2.112APR2713APR2712APR2713APR2712APR2713APR27
Product Design2  3..14APR2716APR2714APR2716APR2714APR2716APR27
Product Design2ProgrammerRDRIVEN33114APR2716APR2714APR2716APR2714APR2716APR27
Test Plan3  3..14APR2716APR2714APR2716APR2721APR2723APR27
Documentation4  1..11MAY2712MAY2719APR2720APR2707MAY2710MAY27
Documentation4ProgrammerRDRIVEN22111MAY2712MAY2719APR2720APR2707MAY2710MAY27
Code5  1..19APR2730APR2719APR2730APR2719APR2730APR27
Code5ProgrammerRDRIVEN1010119APR2730APR2719APR2730APR2719APR2730APR27
Test Data6  5..19APR2723APR2719APR2723APR2726APR2730APR27
Test Routines7  5..19APR2723APR2719APR2723APR2726APR2730APR27
Test Product8  6..03MAY2710MAY2703MAY2710MAY2703MAY2710MAY27
Test Product8ProgrammerFIXED6.103MAY2710MAY2703MAY2710MAY2703MAY2710MAY27
Finish9  0..13MAY2713MAY2711MAY2711MAY2711MAY2711MAY27


The following statements invoke PROC GANTT to display a Gantt chart of the schedule in Output 3.25.3. The activity, 'Documentation', is delayed until May 11, 2027, because there is only one programmer available to the project.


title h=2.5 'Software Development';
title2 h=1.5 'Resource Constrained Schedule: Single Programmer';
proc gantt data=sftout1;
   id Activity Programmer;
   chart / compress scale=3 increment=4 interval=weekday
           height=2.8 nojobnum nolegend between=5
           act=act succ=(s1 s2)
           cprec=steel
           caxis=black
           ;
   run;

Output 3.25.3: Resource-Constrained Schedule: Single Programmer

Resource-Constrained Schedule: Single Programmer


Next, suppose that you have two programmers assigned to your project and you can use either one of them for a given task, depending on their availability. To model this scenario, specify Chris and John as alternate resources that can be substituted for the resource Programmer. The Resource data set, resin2, printed in Output 3.25.4, indicates that Chris and John are alternates for Programmer. Specifying an availability of '0' for the resource Programmer ensures that the procedure will assign one of the two programmers, Chris or John, to each task.

The second observation in the data set resin2 indicates two different rates of substitution for the alternate resources. A value less than 1 indicates that the alternate resource is more efficient than the primary resource, while a value greater than 1 indicates that the alternate resource is less efficient. For fixed-duration activities, the use of the alternate resource changes the rate of utilization of the resource, while for a resource-driven activity, it changes the duration of the resource. The data set resin specifies that John is twice as efficient as the primary resource Programmer while Chris takes one and a half times as long as the generic resource to accomplish a task.

Output 3.25.4: Alternate Programmers

Resource Data Set RESIN2

ObsperotyperesidProgrammerChrisJohn
1.resrcdur 11.01.0
2.altrateProgrammer.1.50.5
312APR27reslevel .1.01.0


The following statements invoke PROC CPM with the new Resource data set and a modified Activity data set that includes the newly added resource variables, Chris and John. You can see the effects of the alternate resource specifications in the Resource Schedule data set, printed in Output 3.25.5. The activity 'Product Design' that takes 3 days of time from a generic programmer actually takes 4.5 days because the programmer used is Chris, who is substituted at a rate of 1.5. On the other hand, the programmer John efficiently completes the task, 'Documentation', in only 1 day, instead of the planned 2 days for a generic programmer. Note also that the start and finish times are specified as SAS datetime values because the substitution of alternate resources results in some of the resource durations being fractional.

data software2;
  set software;
  Chris = .;
  John = .;
  run;

proc cpm data=software2 out=sftout2 rsched=rsftout2
         resin=resin2
         date='12apr27'd interval=weekday resout=rout2;
   act act;
   succ s1 s2;
   dur dur;
   res Programmer Chris John / work=mandays
                               obstype=otype
                               period=per
                               resid=resid
                               rschedid=Activity;
   id Activity;
   run;

Output 3.25.5: Resource Schedule with Alternate Programmers

Software Development
Resource Constrained Schedule
Alternate Resources at Varying Rates

ActivityactRESOURCEDUR_TYPEdurmandaysR_RATES_STARTS_FINISHE_STARTE_FINISH
Plans & Reqts1  2.0..12APR27:00:00:0013APR27:23:59:5912APR27:00:00:0013APR27:23:59:59
Plans & Reqts1ProgrammerFIXED2.0.1.0..12APR27:00:00:0013APR27:23:59:59
Plans & Reqts1JohnFIXED2.0.0.512APR27:00:00:0013APR27:23:59:59..
Product Design2  3.0..14APR27:00:00:0020APR27:11:59:5914APR27:00:00:0016APR27:23:59:59
Product Design2ProgrammerRDRIVEN3.03.01.0..14APR27:00:00:0016APR27:23:59:59
Product Design2ChrisRDRIVEN4.54.51.014APR27:00:00:0020APR27:11:59:59..
Test Plan3  3.0..14APR27:00:00:0016APR27:23:59:5914APR27:00:00:0016APR27:23:59:59
Documentation4  1.0..20APR27:12:00:0021APR27:11:59:5919APR27:00:00:0020APR27:23:59:59
Documentation4ProgrammerRDRIVEN2.02.01.0..19APR27:00:00:0020APR27:23:59:59
Documentation4JohnRDRIVEN1.01.01.020APR27:12:00:0021APR27:11:59:59..
Code5  1.0..20APR27:12:00:0011MAY27:11:59:5919APR27:00:00:0030APR27:23:59:59
Code5ProgrammerRDRIVEN10.010.01.0..19APR27:00:00:0030APR27:23:59:59
Code5ChrisRDRIVEN15.015.01.020APR27:12:00:0011MAY27:11:59:59..
Test Data6  5.0..19APR27:00:00:0023APR27:23:59:5919APR27:00:00:0023APR27:23:59:59
Test Routines7  5.0..19APR27:00:00:0023APR27:23:59:5919APR27:00:00:0023APR27:23:59:59
Test Product8  6.0..11MAY27:12:00:0019MAY27:11:59:5903MAY27:00:00:0010MAY27:23:59:59
Test Product8ProgrammerFIXED6.0.1.0..03MAY27:00:00:0010MAY27:23:59:59
Test Product8JohnFIXED6.0.0.511MAY27:12:00:0019MAY27:11:59:59..
Finish9  0.0..19MAY27:12:00:0019MAY27:12:00:0011MAY27:00:00:0011MAY27:00:00:00


Last updated: November 10, 2025