The GANTT Procedure

Example 8.28 Using the TIMEAXISFORMAT= Option

The following statements illustrate the use of the TIMEAXISFORMAT= option to specify formats for up to three rows of time-axis labels. The Activity data set for PROC CPM is the WIDGETA data set from Example 4.2, which defines the widget manufacturing project in AOA format.

* 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;
* plot the logic Gantt chart using AOA representation;
proc gantt data=savehp (obs=6);
   chart / compress
           activity=head
           successor=tail
           mininterval=day
           increment=1
           dur=days
           maxdate='24MAR09'd
           taformat=(date7., dowdate., downame2.)
           cprec=black
           ;
   id task;
run;

The resulting Gantt chart, displayed in Output 8.28.1, contains one time-axis row for each format specified.

Output 8.28.1: Using the TIMEAXISFORMAT= Option

Using the TIMEAXISFORMAT= Option