Resources

Non Standard Precedence Relationships (gantt20)

/****************************************************************/
/*          S A S   S A M P L E   L I B R A R Y                 */
/*                                                              */
/*    NAME: GANTT20                                             */
/*   TITLE: Non Standard Precedence Relationships (gantt20)     */
/* PRODUCT: OR                                                  */
/*  SYSTEM: ALL                                                 */
/*    KEYS: GANTT                                               */
/*   PROCS: CPM, SORT, GANTT                                    */
/*    DATA:                                                     */
/*                                                              */
/* SUPPORT:                             UPDATE:                 */
/*     REF: Example 20 in the GANTT Chapter (PM User's Guide)   */
/*    MISC:                                                     */
/*                                                              */
/****************************************************************/

options ps=60 ls=100;

title h=2 'Gantt Example 20';

 /* Activity-on-Node representation of the project with lags */
data widglag2;
   format task $12. succ $12. lagdur $4. ;
   input task & days succ & lagdur $ ;
   datalines;
Approve Plan   5  Drawings      .
Approve Plan   5  Study Market  .
Approve Plan   5  Write Specs   .
Drawings      10  Prototype     .
Study Market   5  Mkt. Strat.   .
Write Specs    5  Prototype     .
Prototype     15  Materials     ss_9
Prototype     15  Facility      ss_9
Mkt. Strat.   10  Test Market   .
Mkt. Strat.   10  Marketing     .
Materials     10  Init. Prod.   .
Facility      10  Init. Prod.   fs_2
Init. Prod.   10  Test Market   .
Init. Prod.   10  Marketing     .
Init. Prod.   10  Evaluate      .
Evaluate      10  Changes       ss_6
Test Market   15  Changes       ff_3
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=widglag2 holidata=holidays date='1dec03'd
         interval=weekday collapse;
   activity task;
   succ     succ / lag = (lagdur);
   duration days;
   holiday  holiday / holifin=(holifin);
   run;

data widglagh;
   set _last_;
   drop succ;
   run;


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

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

title2 c=black h=1.5
   'Nonstandard Precedence Relationships and the PRECDATA= Option';

proc gantt graphics data=widglagh precdata=widglag2
                    holidata=holidays;
   chart / compress dur=days height=1.5
           holiday=(holiday) holifin=(holifin)
           cmile=blue cprec=blue wprec=2
           ref='01dec03'd to '01mar04'd by month
           cref=black lref=2 reflabel caxis=black
           act=task succ=(succ) lag=(lagdur)
           minintgv=2 minofflv=.5;
   id task;
   run;