Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
The GANTT Procedure

Example 4.10: Plotting the Actual Schedule

Suppose that the project is complete and you want to compare the actual progress of the activities with the predicted schedule computed by PROC CPM. The following DATA step stores the actual start and finish times of each activity in a data set named COMPLETE. A data set named WIDGELA is then created that contains both the schedule obtained from PROC CPM (the data set SAVEH from Example 4.3 is used because it does not contain the dummy activity) and the actual schedule. The resulting data set is sorted by early start time.

Fill patterns are specified using PATTERN statements, and the COMPRESS option is employed in order to draw the entire Gantt chart on one page. Predicted schedules as well as actual schedules are plotted on separate bars for each activity. The A_START= and A_FINISH= options in the CHART statement are used to specify the variables containing the actual start and finish times for each activity. The actual schedule is plotted with the fill pattern specified in the sixth PATTERN statement. This example also illustrates the drawing of holidays in graphics mode. PROC GANTT uses the fill pattern specified in the seventh PATTERN statement to represent the holidays defined by the HOLIDATA= data set. The holidays are identified to PROC GANTT by specifying the HOLIDAY= and HOLIFIN= options in the CHART statement. The HCONNECT option causes a connecting line to be drawn from the left boundary of the chart to the early start time for each activity. The CHCON= option specifies the color for drawing the connect lines. You can use the LHCON= option in the CHART statement to specify a line style other than the default style for the connect lines.

   data complete;
      format sdate date9. fdate date9.;
      input activity $ 1-12 sdate date9. fdate date9.;
      datalines;
   Approve Plan  02dec91 06dec91
   Drawings      07dec91 17dec91
   Anal. Market  06dec91 10dec91
   Write Specs   08dec91 13dec91
   Prototype     18dec91 04jan92
   Mkt. Strat.   11dec91 20dec91
   Materials     03jan92 12jan92
   Facility      02jan92 14jan92
   Init. Prod.   14jan92 22jan92
   Evaluate      23jan92 02feb92
   Test Market   24jan92 09feb92
   Changes       06feb92 12feb92
   Production    13feb92 13feb92
   Marketing     27jan92 27jan92
   ;


   * merge the computed schedule with the actual schedule;

   data widgela;
      merge saveh complete;


   * sort the data;

   proc sort; by e_start;

   title f=swiss 'Gantt Example 10';
   title2 f=swiss
          'Plotting Actual Start and Finish Times on the Chart';


   * set vpos to 40 and hpos to 100;

   goptions vpos=40 hpos=100;


   * set up required pattern statements;

   pattern1 c=green v=s;  /* duration of a noncrit. activity  */
   pattern2 c=green v=e;  /* slack time for a noncrit. act.   */
   pattern3 c=red   v=s;  /* duration of a critical activity  */
   pattern4 c=green v=s;  /* slack time for a supercrit. act. */
   pattern5 c=green v=e;  /* 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           */

   * plot the computed and actual schedules using proc gantt;

   proc gantt data=widgela holidata=holidays;
      chart / holiday=(holiday) holifin=(holifin)
              a_start=sdate a_finish=fdate
              dur=days cmile=blue
              font=swiss ctext=blue
              caxis=black
              hconnect
              compress
              ;
      id task;
   run;

Output 4.10.1: Plotting the Actual Schedule on the Gantt Chart
ga10.gif (5124 bytes)

Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Top
Top

Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.