Resources

Logic Gantt chart: (AON) & LEVEL= Option (gantte18)

/****************************************************************/
/*          S A S   S A M P L E   L I B R A R Y                 */
/*                                                              */
/*    NAME: GANTTE18                                            */
/*   TITLE: Logic Gantt chart: (AON) & LEVEL= Option (gantte18) */
/* PRODUCT: OR                                                  */
/*  SYSTEM: ALL                                                 */
/*    KEYS: GANTT                                               */
/*   PROCS: CPM, SORT, GANTT                                    */
/*    DATA:                                                     */
/*                                                              */
/* SUPPORT:                             UPDATE:                 */
/*     REF: Example 18 in the GANTT Chapter (PM User's Guide)   */
/*    MISC:                                                     */
/*                                                              */
/****************************************************************/

title h=1.75 'Gantt Example 18';

 /* 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;

* set up required pattern statements;
pattern1 c=green v=s;  /* duration of a noncrit. activity  */
pattern2 c=green v=e;  /* slack time for a noncrit. act.   */
pattern3 c=red   v=s;  /* duration of a critical activity  */
pattern4 c=green v=s;  /* slack time for a supercrit. act. */
pattern5 c=green v=e;  /* duration of a supercrit. act.    */
pattern6 c=cyan  v=s;  /* actual duration of an activity   */
pattern7 c=blue  v=x1; /* break due to a holiday           */

title2 h=1.25 'Logic Gantt Chart: AON Representation and LEVEL= Option';

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

* set graphics options;
goptions vpos=50 hpos=100 htext=1.2;

* draw the logic Gantt chart;
proc gantt graphics data=widgela holidata=holidays;
   chart / holiday=(holiday) holifin=(holifin)
           a_start=sdate a_finish=fdate dur=days
           compress
           cmile=black
           activity=task successor=(succ1-succ3)
           caxis=black
           level=2
           cprec=blue;
   id task;
   run;