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
   successor tail;
   activity head;
   duration days;
   id task dept descrpt;

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

* 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'); 

* 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
           taformat=(date7., dowdate., downame2.)
   id task;

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