Resource Driven Durations and Alt Resources (cpm25)
/****************************************************************/
/* S A S S A M P L E L I B R A R Y */
/* */
/* NAME: CPM25 */
/* TITLE: Resource Driven Durations and Alt Resources (cpm25) */
/* PRODUCT: OR */
/* SYSTEM: ALL */
/* KEYS: CPM */
/* PROCS: CPM, NETDRAW, GANTT */
/* DATA: Software Development */
/* */
/* SUPPORT: UPDATE: */
/* REF: */
/* MISC: Example 25 from CPM chapter of PM User's Guide */
/* Example 1 from CPM chapter of OR V8.1 Changes */
/* and Enhancements */
/* */
/****************************************************************/
data software;
input Activity & $15. dur mandays act s1 s2 Programmer;
datalines;
Plans & Reqts 2 . 1 2 3 1
Product Design . 3 2 4 5 1
Test Plan 3 . 3 6 7 .
Documentation 1 2 4 9 . 1
Code 1 10 5 8 . 1
Test Data 5 . 6 8 . .
Test Routines 5 . 7 8 . .
Test Product 6 . 8 9 . 1
Finish 0 . 9 . . .
;
data resin;
input per date7. otype $ Programmer;
format per date7.;
datalines;
. resrcdur 1
12apr04 reslevel 1
;
title 'Software Development';
title2 'Activity Data Set SOFTWARE';
proc print data=software;
id Activity;
var act s1 s2 dur mandays Programmer;
run;
title2 'Resource Availability Data Set';
proc print data=resin;
run;
title 'Software Development';
title2 h=1.5 'Project Network';
proc netdraw graphics data=software;
actnet / act=act succ=(s1 s2) compress height=3
ybetween=15
id=(Activity) nodefid nolabel spantree;
run;
proc cpm data=software
out=sftout1 resout=rout1
rsched=rsftout1
resin=resin
date='12apr04'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;
pattern1 c=green v=s; /* duration of a non-critical activity */
pattern2 c=green v=e; /* slack time for a noncrit. activity */
pattern3 c=red v=s; /* duration of a critical activity */
pattern4 c=magenta v=e; /* slack time for a supercrit. activity */
pattern5 c=magenta v=s; /* duration of a supercrit. activity */
pattern6 c=cyan v=s; /* actual duration of an activity */
pattern7 c=black v=e; /* break due to a holiday */
pattern8 c=blue v=s; /* resource schedule of activity */
pattern9 c=brown v=s; /* baseline schedule of activity */
title h=2.5 'Software Development';
title2 h=1.5 'Resource Constrained Schedule: Single Programmer';
proc gantt graphics 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=cyan
caxis=black
;
run;
title 'Software Development';
title2 'Alternate Resources';
data resin2;
input per date7. otype $ resid $ 18-27 Programmer Chris John;
format per date7.;
datalines;
. resrcdur . 1 1 1
. altrate Programmer . 1.5 .5
12apr04 reslevel . . 1 1
;
title 'Resource Data Set RESIN2';
proc print;
run;
data software2;
set software;
Chris = .;
John = .;
run;
proc cpm data=software2 out=sftout2 rsched=rsftout2
resin=resin2
date='12apr04'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;
title 'Software Development';
title2 'Resource Constrained Schedule';
title3 'Alternate Resources at Varying Rates';
proc print data=rsftout2 (drop=l_start l_finish) heading=h;
id Activity;
run;