Pool Project

 /****************************************************************/
 /*          S A S   S A M P L E   L I B R A R Y                 */
 /*                                                              */
 /*    NAME: PMEX01                                              */
 /*   TITLE: Pool Project                                        */
 /* PRODUCT: OR                                                  */
 /*  SYSTEM: ALL                                                 */
 /*    KEYS: CPM                                                 */
 /*   PROCS: CPM, PRINT, NETDRAW, GANTT, SORT, GPLOT, GCHART     */
 /*    DATA:                                                     */
 /*                                                              */
 /* SUPPORT:                             UPDATE:                 */
 /*     REF: Example 1 of Project Management Examples Book       */
 /*    MISC: Levine, Project Management Using Microcomputers     */
 /*                                                              */
 /****************************************************************/

goptions border hpos=80 vpos=43
         fby=swiss
         ftitle=swiss
         htitle=2
         ftext=swiss
         htext=1.5;

pattern1 v=solid c=blue;
pattern2 v=e c=blue;
pattern3 v=solid c=red;
pattern4 v=e c=red;
pattern5 v=x2 c=red;
pattern6 v=solid c=green;
pattern7 v=e c=magenta;
pattern8 v=solid c=magenta;
pattern9 v=x1 c=cyan;

title 'Pool Project';

data pooldata;
format id $25.;
input id & act s1 s2 s3 s4 s5 dur;
cards;
Decide to do                  10      20      .      .      .      .    2
Gather Info                   20      30      .      .      .      .    8
Concept                       30     210    310    510      .      .    5
Estab Program                 40      50    110      .      .      .    3
Estimate Costs                50     140    220    320    420    520    2
Apply for Permit             110     120      .      .      .      .    3
Issue Permit                 120     340    540      .      .      .   15
Apply for Loan               140     150      .      .      .      .    3
Issue Loan                   150     230    330    430    530      .   10
Price Fencing                210      40      .      .      .      .    5
Order Fencing                220     230      .      .      .      .    2
Fencing Delivered            230     240      .      .      .      .   15
Erect Fence                  240     610      .      .      .      .    5
Price Patio Kits             310      40      .      .      .      .    5
Patio Detailed Plans         320     330      .      .      .      .    5
Obtain Support Matl          330     340      .      .      .      .    2
Dig Holes                    340     350      .      .      .      .    1
Form                         350     360      .      .      .      .    2
Pour                         360     370      .      .      .      .    1
Cure                         370     380      .      .      .      .    3
Strip and Backfill           380     440      .      .      .      .    1
Order Patio Kit              420     430      .      .      .      .    2
Patio Kit Delivered          430     440      .      .      .      .   10
Erect Patio Base             440     450    620      .      .      .    4
Erect Patio Rails            450     460    610      .      .      .    2
Finish Patio                 460     610      .      .      .      .    2
Get Pool Quotes              510      40      .      .      .      .    5
Order Pool                   520     530      .      .      .      .    2
Pool Delivered               530     540      .      .      .      .   15
Install Pool                 540     240    550    610    620      .   10
Fill Pool                    550     640      .      .      .      .    3
Clean-Up                     610     630    640      .      .      .    2
Send Invites                 620     640      .      .      .      .    1
Get Party Supplies           630     640      .      .      .      .    1
Hold Pool Party              640       .      .      .      .      .    1
;

pattern1 v=e;

title2 'Initial Network';

proc netdraw graphics data=pooldata;
actnet/compress activity=act id=(id dur) font=simplex
successor=(s1-s5) nodefid nolabel separatearcs;
run;

title2 'Details of Initial Network';

proc netdraw graphics data=pooldata;
actnet/activity=act id=(id dur)
successor=(s1-s5) nodefid nolabel separatearcs;
run;

pattern1 v=s;

title2 'Initial Schedule Using CPM';

proc cpm data=pooldata out=poolout interval=day
date='31mar92'd;
activity act;
duration dur;
id id;
successor s1 s2 s3 s4 s5;
run;

proc sort data=poolout;
by e_start;
run;

proc print data=poolout noobs;
var id e_start e_finish l_start l_finish t_float f_float;
run;

proc gantt graphics data=poolout;
chart/compress hconnect; id id;
run;

data pcalendr;
input _cal_   _sun_ $ _mon_ $ _tue_ $
      _wed_ $ _thu_ $ _fri_ $ _sat_ $;
cards;
0 holiday workday workday workday workday workday workday
1 workday holiday holiday holiday holiday holiday workday
;

data pooldata;
set pooldata;
if act=640 then _cal_=1;
else _cal_=0;
run;

proc cpm data=pooldata out=poolout2 interval=day
caledata=pcalendr date='31mar92'd;
activity act;
duration dur;
id id;
successor s1 s2 s3 s4 s5;
run;

proc sort data=poolout2;
by e_start;
run;

title2 'CPM with a Revised Project Calendar';

proc gantt graphics data=poolout2 caledata=pcalendr;
chart/compress markwknd hconnect;
id id;
run;

 /* Resource Codes:  L   Laborer time ($80.00/day)      */
 /*                  C   Carpenter time ($100.00/day)   */
 /*                  M   Material Dollars               */
 /*                  S   Subcontractor Dollars          */

data poolres;
input act l c matl sub;
cards;
230 . .   250     .
240 2 .    .      .
330 . .   150     .
340 2 .    .      .
350 1 2    .      .
360 2 .    .     300
380 2 2    .      .
430 . .   350     .
440 1 2    .      .
450 . 2    .      .
460 1 1    .      .
530 2 .   6000    .
540 . .    .     4000
550 . .    .     75
610 2 .    .      .
;

data pooldata;
     merge pooldata poolres;
     by act;
     m=matl/dur;
     s=sub/dur;
run;

proc cpm data=pooldata out=poolout3 interval=day
caledata=pcalendr date='31mar92'd resout=presusg;
activity act;
duration dur;
id id;
successor s1 s2 s3 s4 s5;
resource l c m s;
run;

data poolcost (keep=_time_ ecumcost lcumcost);
set presusg;
retain ecumcost 0;
ecumcost=ecumcost + 80*el + 100*ec + em + es;
retain lcumcost 0;
lcumcost=lcumcost + 80*ll + 100*lc + lm + ls;
run;

data poolplot;set poolcost;
format date date7.;
date=_time_;
label resource='Type of Schedule Followed';
resource='Early Start';
cumcost=ecumcost;output;
resource='Late Start';
cumcost=lcumcost;output;
run;

symbol1 i=join v=none w=2 l=1 c=blue;
symbol2 i=join v=none w=2 l=2 c=green;

title2 'Comparison of Project Costs';

proc gplot data=poolplot;
plot cumcost * date = resource;
run;
quit;

data preslvl;
format date date7.;
input date date7. obstype $ l c;
cards;
.       restype  1 1
31mar92 reslevel 2 2
;

proc cpm data=pooldata out=poolout4 interval=day
caledata=pcalendr date='31mar92'd
resin=preslvl resout=presusg;
activity act;
duration dur;
id id;
successor s1 s2 s3 s4 s5;
resource l c m s/obstype=obstype period=date delayanalysis;
run;

proc sort data=poolout4;
by s_start;
run;

title2 'Schedule with Limited Resources';

proc gantt graphics data=poolout4 caledata=pcalendr;
chart/compress mininterval=week scale=10 hconnect;
id id;
run;

proc print data=poolout4 noobs;
     var id e_start e_finish s_start s_finish r_delay delay_r;
run;

data plot1;
     set presusg;
     format resource $14. cost dollar8.;
     resource='Laborers';
     cost=rl*80;output;
     resource='Carpenters';
     cost=rc*100;output;
     resource='Materials';
     cost=rm;output;
     resource='Subcontractors';
     cost=rs;output;
run;

pattern1 v=e;
pattern2 v=e;
pattern3 v=e;
pattern4 v=e;

title2 'Breakdown of Resource Costs';

proc gchart data=plot1;
     pie resource / sumvar=cost
                    percent=inside
                    value=inside
                    slice=outside
                    noheading;
run;
quit;

pattern1 v=s;
pattern2 v=e;
pattern3 v=s;
pattern4 v=e;