Resources

Time Axis Labeling (gantte28)

/****************************************************************/
/*          S A S   S A M P L E   L I B R A R Y                 */
/*                                                              */
/*    NAME: GANTTE28                                            */
/*   TITLE: Time Axis Labeling (gantte28)                       */
/* PRODUCT: OR                                                  */
/*  SYSTEM: ALL                                                 */
/*    KEYS: GANTT                                               */
/*   PROCS: CPM, SORT, GANTT                                    */
/*    DATA:                                                     */
/*                                                              */
/* SUPPORT:                             UPDATE:                 */
/*     REF: Example 28 in the GANTT Chapter (PM User's Guide)   */
/*    MISC:                                                     */
/*                                                              */
/****************************************************************/

title h=2 'Gantt Example 28';

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

data details;
   input task $ 1-12 dept $ 15-27 descrpt $ 30-59;
   label dept = "Department"
         descrpt = "Activity Description";
   datalines;
Approve Plan  Planning       Finalize and Approve Plan
Drawings      Engineering    Prepare Drawings
Study Market  Marketing      Analyze Potential Markets
Write Specs   Engineering    Write Specifications
Prototype     Engineering    Build Prototype
Mkt. Strat.   Marketing      Develop Marketing Concept
Materials     Manufacturing  Procure Raw Materials
Facility      Manufacturing  Prepare Manufacturing Facility
Init. Prod.   Manufacturing  Initial Production Run
Evaluate      Testing        Evaluate Product In-House
Test Market   Testing        Mail Product to Sample Market
Changes       Engineering    Engineering Changes
Production    Manufacturing  Begin Full Scale Production
Marketing     Marketing      Begin Full Scale Marketing
Dummy                        Production Milestone
;
run;

data widgeta;
   merge widgaoa details;
run;

* schedule the project subject to holidays and weekends;
proc cpm data=widgeta out=savehp
         date='11mar09'd;
   successor tail;
   activity head;
   duration days;
   id task dept descrpt;
run;

* sort the schedule by the early start date ;
proc sort;
   by e_start;
run;

* define a date format that includes the day of the week;
proc format;
    picture  dowdate (default=16) low-high = '%a, %d %b %Y'
        (datatype=date fill='0');
run;

* set up 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        */

* set graphics options;
goptions htext=1.025;

* plot the logic Gantt chart using AOA representation;
proc gantt data=savehp (obs=6);
   title2 h=1.5 'Time Axis Labeling for Week Number';
   chart / compress
           activity=head
           successor=tail
           mininterval=day
           increment=1
           dur=days
           maxdate='24MAR09'd
           taformat=(date7., dowdate., downame2.)
           cprec=black
           ;
   id task;
run;