Resources

GANTT Chart by Persons (gantte16)

/****************************************************************/
/*          S A S   S A M P L E   L I B R A R Y                 */
/*                                                              */
/*    NAME: GANTTE16                                            */
/*   TITLE: GANTT Chart by Persons (gantte16)                   */
/* PRODUCT: OR                                                  */
/*  SYSTEM: ALL                                                 */
/*    KEYS: GANTT                                               */
/*   PROCS: CPM, SORT, GANTT                                    */
/*    DATA:                                                     */
/*                                                              */
/* SUPPORT:                             UPDATE:                 */
/*     REF: Example 16 in the GANTT Chapter (PM User's Guide)   */
/*    MISC:                                                     */
/*                                                              */
/****************************************************************/

options ps=60 ls=80;

 /* Activity-on-Arc representation of the project */
data widgbyp;
   format task $12.;
   input task & days tail head thomas william;
   datalines;
Approve Plan   5   1   2  .  .
Drawings      10   2   3  1  .
Study Market   5   2   4  .  .
Write Specs    5   2   3  1  1
Prototype     15   3   5  1  1
Mkt. Strat.   10   4   6  .  .
Materials     10   5   7  .  1
Facility      10   5   7  .  1
Init. Prod.   10   7   8  1  .
Evaluate      10   8   9  1  1
Test Market   15   6   9  .  .
Changes        5   9  10  1  .
Production     0  10  11  .  1
Marketing      0   6  12  .  .
Dummy          0   8   6  .  .
;

proc print data=widgbyp;
   title2 'Data widgbyp';
   run;

title h=1.75 'Gantt Example 16';

proc cpm data=widgbyp date='1dec03'd;
   tailnode tail;
   duration days;
   headnode head;
   id task thomas william;
run;

data persons;
   set _last_;
   if william^=. then do;
      person='William';
      output;
      end;
   if thomas^=. then do;
      person='Thomas';
      output;
      end;
   drop thomas william;
run;

proc sort data=persons;
   by person e_start;
run;

title2 'Data PERSONS';
proc print data=persons;
   run;

/* set up required pattern statements */
pattern1 c=green v=s;    /* duration of a non-critical activity  */
pattern2 c=green v=e;    /* slack time for a noncrit. activity   */
pattern3 c=red v=s;      /* duration of a critical activity      */
pattern4 c=magenta v=e;  /* slack time for a supercrit. activity */
pattern5 c=magenta v=s;  /* duration of a supercrit. activity    */
pattern6 c=cyan v=s;     /* actual duration of an activity       */
pattern7 c=black v=e;    /* break due to a holiday               */
pattern8 c=blue v=s;     /* resource schedule of activity        */
pattern9 c=brown v=s;    /* baseline schedule of activity        */

/* suppress byline */
options nobyline;

goptions hpos=120 vpos=40 htext=1.1;

title2 h=1.25 'Personalized Gantt Chart for #BYVAL(person)';
proc gantt data=persons;
   chart / pcompress;
   by person;
   id task;
   run;