Resources

Resource Driven Durations and Res.Calendars (cpme24)

 /****************************************************************/
 /*          S A S   S A M P L E   L I B R A R Y                 */
 /*                                                              */
 /*    NAME: CPME24                                              */
 /*   TITLE: Resource Driven Durations and Res.Calendars (cpme24)*/
 /* PRODUCT: OR                                                  */
 /*  SYSTEM: ALL                                                 */
 /*    KEYS: CPM                                                 */
 /*   PROCS: CPM                                                 */
 /*    DATA:                                                     */
 /*                                                              */
 /* SUPPORT:                             UPDATE:                 */
 /*     REF: Example 24 from the CPM Chapter (PM User's Guide)   */
 /*    MISC: Resource Driven Durations and Resource Calendars    */
 /*                                                              */
 /****************************************************************/

data software;
     input Activity & $15. dur mandays act s1 s2 Programmer Tester;
datalines;
Plans & Reqts    2   .   1   2  3  1   1
Product Design   .   3   2   4  5  1   .
Product Design   .   1   2   .  .  .   1
Test Plan        3   .   3   6  7  .   1
Documentation    .   2   4   9  .  .2  .
Documentation    .   1   4   .  .  .   .5
Code             10  .   5   8  .  .8  .
Test Data        5   .   6   8  .  .   .5
Test Routines    5   .   7   8  .  .   .5
Test Product     6   .   8   9  .  .5  1
Finish           0   .   9   .  .  .   .
;

title 'Software Development';
title2 'Activity Data Set SOFTWARE';
proc print;
   id Activity;
   var act s1 s2 dur mandays Programmer Tester;
run;

goptions hpos=70 vpos=30;

pattern1 v=e c=green;
title h=2 'Software Development';
title2 h=1.5 'Project Network';
proc netdraw graphics data=software;
     actnet / act=act succ=(s1 s2) compress height=6
              ybetween=15
              id=(Activity) nodefid nolabel spantree;
     run;


proc cpm data=software out=sftout ressched=rsftout
         date='12apr04'd interval=weekday resout=rout;
   act act;
   succ s1 s2;
   dur dur;
   res Programmer Tester / work=mandays
                        rschedid=Activity;
   id Activity;
run;


title 'Software Development';
title2 'Resource Schedule Data Set RSFTOUT';
proc print data=rsftout heading=v;
   id Activity;
run;


data gant;
   set rsftout;
   if resource ^= ' ' then 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 'Software Development';
title2 h=1.5 'Project Schedule';



proc gantt graphics data=gant;
   id Activity resource;
   chart / compress scale=3 increment=4 interval=weekday
           height=2.8 nojobnum between=5
           hmile=2
           cprec=cyan cmile=magenta
           caxis=black;
run;


title 'Software Development';
title2 'Resource Usage Data Set ROUT';
proc print data=rout;
run;

data resin;
   input per date7. otype $ Programmer Tester;
   format per date7.;
   datalines;
12apr04  reslevel 1  1
;


title 'Software Development';
title2 'Resource Availability Data Set';
proc print;
   run;

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

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

data gant1;
   set rsftout1;
   if resource ^= ' ' then Activity=' ';
   run;


title h=1.5 'Software Development';
title2 h=1 'Resource Constrained Schedule: Common Resource Calendar';
proc gantt graphics data=gant1 (drop=e_: l_: );
   id Activity resource;
   chart / compress scale=3 increment=4 interval=weekday
           height=2.8 nojobnum nolegend between=5
           hmile=2
           cprec=cyan cmile=magenta
           caxis=black
           ;
run;

data calendar;
   _cal_=1; _fri_="holiday";
   run;

data resin2;
   input per date7. otype $ Programmer Tester;
   format per date7.;
   datalines;
.        calendar 0  1
12apr04  reslevel 1  1
;


title 'Software Development';
title2 'Calendar Data Set CALENDAR';
proc print data=calendar;
   run;
title 'Resource Data Set RESIN2';
proc print data=resin2;
   run;

 proc cpm data=software resin=resin2
         caledata=calendar
         out=sftout2 rsched=rsftout2
         resout=rout2
         date='12apr04'd interval=weekday;
   act act;
   succ s1 s2;
   dur dur;
   res Programmer Tester / work=mandays addcal
                           obstype=otype
                           period=per
                           rschedid=Activity;
   id Activity;
 run;

data gant2;
   set rsftout2;
   if resource ^= ' ' then Activity=' ';
   run;

title h=1.5 'Software Development';
title2 h=1 'Resource Constrained Schedule: Multiple Resource Calendars';
proc gantt graphics data=gant2 (drop=e_: l_: )
     caledata=calendar;
   id Activity resource;
   chart / compress scale=3 increment=4 interval=weekday
           height=2.8 nojobnum nolegend between=5
           hmile=2
           cprec=cyan cmile=magenta
           caxis=black
           ;
run;

title 'Software Development';
title2 'Resource Constrained Schedule: Multiple Resource Calendars';
proc print data=rsftout2 heading=h;
   id Activity;
run;