Resources

Plotting ACTUAL Schedule (gantte10)

/****************************************************************/
/*          S A S   S A M P L E   L I B R A R Y                 */
/*                                                              */
/*    NAME: GANTTE10                                            */
/*   TITLE: Plotting ACTUAL Schedule (gantte10)                 */
/* PRODUCT: OR                                                  */
/*  SYSTEM: ALL                                                 */
/*    KEYS: GANTT                                               */
/*   PROCS: CPM, SORT, GANTT                                    */
/*    DATA:                                                     */
/*                                                              */
/* SUPPORT:                             UPDATE:                 */
/*     REF: Example 10 in the GANTT Chapter (PM User's Guide)   */
/*    MISC:                                                     */
/*                                                              */
/****************************************************************/

options ps=60 ls=100;

 /* Activity-on-Node representation of the project */
data widget;
   format task $12. succ1-succ3 $12. ;
   input task & days succ1 & succ2 & succ3 & ;
   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  .        .
;

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

data complete;
   format activity $12. sdate date7. fdate date7.;
   input activity & sdate & date7. fdate & date7.;
   datalines;
Approve Plan   01dec03  05dec03
Drawings       06dec03  16dec03
Study Market   05dec03  09dec03
Write Specs    07dec03  12dec03
Prototype      17dec03  03jan04
Mkt. Strat.    10dec03  19dec03
Materials      02jan04  11jan04
Facility       01jan04  13jan04
Init. Prod.    13jan04  21jan04
Evaluate       22jan04  01feb04
Test Market    23jan04  08feb04
Changes        05feb04  11feb04
Production     12feb04  12feb04
Marketing      26jan04  26jan04
;

 * merge the computed schedule with the actual schedule;
data widgela;
   merge saveh complete;

* sort the data;
proc sort;
   by e_start;
   run;

* set vpos to 40 and hpos to 100;
goptions vpos=40 hpos=100;

title h=1.75 f='Albany AMT' 'Gantt Example 10';
title2 h=1.25
   f='Albany AMT' 'Plotting Actual Start and Finish Times on the Chart';

* set up required pattern statements;
pattern1 c=green v=s;
pattern2 c=green v=e;
pattern3 c=red v=s;
pattern4 c=green v=s;
pattern5 c=green v=e;
pattern6 c=cyan v=s;
pattern7 c=black v=x1;

* plot the computed and actual schedules using proc gantt;
proc gantt graphics data=widgela holidata=holidays;
   chart / holiday=(holiday) holifin=(holifin)
           a_start=sdate a_finish=fdate
           dur=days font='Albany AMT' chcon=black
           hconnect compress ctext=blue height=1.5
           caxis=black cmile=blue;
   id task;
   run;