Progress Update and Target Schedules (cpme13)

 /****************************************************************/
 /*          S A S   S A M P L E   L I B R A R Y                 */
 /*                                                              */
 /*    NAME: CPME13                                              */
 /*   TITLE: Progress Update and Target Schedules (cpme13)       */
 /* PRODUCT: OR                                                  */
 /*  SYSTEM: ALL                                                 */
 /*    KEYS: CPM                                                 */
 /*   PROCS: CPM                                                 */
 /*    DATA:                                                     */
 /*                                                              */
 /* SUPPORT:                             UPDATE:                 */
 /*     REF: Example 13 from the CPM Chapter (PM User's Guide)   */
 /*    MISC:                                                     */
 /*                                                              */
 /****************************************************************/

 /* Activity-on-Node representation of the project */

data widget;
   input task $ 1-12 days succ1 $ 19-30 succ2 $ 33-44 succ3 $ 47-58;
   datalines;
Approve Plan   5  Drawings      Study Market  Write Specs
Drawings      10  Prototype
Study Market   5  Mkt. Strat.
Write Specs    5  Prototype
Prototype     15  Materials     Facility
Mkt. Strat.   10  Test Market   Marketing
Materials     10  Init. Prod.
Facility      10  Init. Prod.
Init. Prod.   10  Test Market   Marketing     Evaluate
Evaluate      10  Changes
Test Market   15  Changes
Changes        5  Production
Production     0
Marketing      0
;

data holidays;
   format holiday holifin date7.;
   input holiday & date7. holifin & date7. holidur;
   datalines;
24dec03  26dec03  4
01jan04  .        .
;

* store early schedule as the baseline schedule;

proc cpm data=widget holidata=holidays
         out=widgbase date='1dec03'd;
   activity task;
   succ     succ1 succ2 succ3;
   duration days;
   holiday  holiday / holifin=(holifin);
   baseline / set=early;
   run;

options ls=80;
title 'Progress Update and Target Schedules';
title2 'Set Baseline Schedule';
proc print data=widgbase;
run;

* actual schedule at timenow = 19dec03;
data actual;
   input task $ 1-12 sdate date9. fdate date9. pctc rdur;
   format sdate date9. fdate date9.;
   datalines;
Approve Plan  01dec03 05dec03  .    .
Drawings      06dec03 16dec03  .    .
Study Market  05dec03 .        100  .
Write Specs   07dec03 12dec03  .    .
Prototype     .       .        .    .
Mkt. Strat.   10dec03 .        .    3
Materials     .       .        .    .
Facility      .       .        .    .
Init. Prod.   .       .        .    .
Evaluate      .       .        .    .
Test Market   .       .        .    .
Changes       .       .        .    .
Production    .       .        .    .
Marketing     .       .        .    .
;

options ls=80;
title 'Progress Update and Target Schedules';
title2 'Progress Data';
proc print;
   run;

* merge the baseline information with progress update;
data widgact;
   merge  actual widgbase;
   run;

proc cpm data=widgact holidata=holidays
         out=widgnupd date='1dec03'd;
   activity task;
   succ     succ1 succ2 succ3;
   duration days;
   holiday  holiday / holifin=(holifin);
   baseline / compare=early;
   actual / a_start=sdate a_finish=fdate timenow='19dec03'd
            remdur=rdur pctcomp=pctc noautoupdt;
   run;

title 'Progress Update and Target Schedules';
proc print data=widgnupd heading=h;
   title2 'Updated Schedule vs. Target Schedule: NOAUTOUPDT';
run;

proc cpm data=widgact holidata=holidays
         out=widgupdt date='1dec03'd;
   activity task;
   succ     succ1 succ2 succ3;
   duration days;
   holiday  holiday / holifin=(holifin);
   baseline / compare=early;
   actual / as=sdate af=fdate timenow='19dec03'd
            remdur=rdur pctcomp=pctc
            autoupdt showfloat;
   run;

title 'Progress Update and Target Schedules';
proc print data=widgupdt heading=h;
   title2 'Updated Schedule vs. Target Schedule: AUTOUPDT';
run;