Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
The GANTT Procedure

Example 4.8: Variable Length Holidays

This example shows how you can mark vacation periods that last longer than one day on the Gantt chart. This can be done by using the HOLIDUR= option in the CHART statement. Recall that holiday duration is assumed to be in interval units where interval is the value specified for the INTERVAL= option. The project data for this example are the same as the data used in the previous example. Suppose that in your scheduling plans you want to assign work on all days of the week, allowing for a Christmas vacation of four days starting from December 25, 1991, and a day off on January 1, 1992 for the New Year. The data set HOLIDAYS contains the holiday information for the project. First, the project is scheduled with INTERVAL=DAY so that the holidays are on December 25, 26, 27, and 28, 1991, and on January 1, 1992. PROC GANTT is invoked with INTERVAL=DAY to correspond to the invocation of PROC CPM. The resulting Gantt chart is shown in Output 4.8.1.

   title f=swiss 'Gantt Example 8';

   data holidays;
      format holiday holifin date7.;
      input holiday date8. holifin date8. holidur;
      datalines;
   25dec91 27dec91 4
   01jan92 .       .
   ;


   * schedule the project subject to holidays;

   proc cpm data=widgeta holidata=holidays out=sched1
            date='2dec91'd interval=day;
      tailnode tail;
      headnode head;
      duration days;
      id task dept descrpt;
      holiday  holiday / holidur=(holidur);
   run;


   * sort the schedule by the early start date ;

   proc sort;
      by e_start;
   run;


   * plot the schedule;

   title2 'Variable Length Holidays: INTERVAL=DAY';

   proc gantt holidata=holidays data=sched1;
      chart / holiday=(holiday) holidur=(holidur)
              interval=day
              dur=days
              pcompress;
      id task;
   run;

Output 4.8.1: Variable Length Holidays: INTERVAL=DAY
ga081.gif (5405 bytes)

Next, consider the same project and Holiday data set, but invoke PROC CPM with INTERVAL=WEEKDAY. Then, the value '4' specified for the variable HOLIDUR is interpreted as 4 weekdays. The holidays are on December 25, 26, 27, and 30, 1991, and on January 1, 1992, because December 28 and 29 (Saturday and Sunday) are nonworking days. The same steps are used as previously, except that INTERVAL is set to WEEKDAY instead of DAY in both PROC CPM and PROC GANTT. Suppose that the resulting data set is saved as SCHED2. The following invocation of PROC GANTT produces Output 4.8.2. Note that the use of INTERVAL=WEEKDAY causes weekends to be also marked on the chart.

   title2 'Variable Length Holidays: INTERVAL=WEEKDAY';

   proc gantt holidata=holidays data=sched2;
      chart / holiday=(holiday) holidur=(holidur)
              interval=weekday
              dur=days
              pcompress;
      id task;
   run;

Output 4.8.2: Variable Length Holidays: INTERVAL=WEEKDAY
ga082.gif (5565 bytes)

Finally, when the INTERVAL= option is specified as WORKDAY, the workday is assumed to be from 9:00 a.m. to 5:00 p.m., and the Christmas holiday period begins at 5:00 p.m. on December 24, 1991, and ends at 9:00 a.m. on December 31, 1991. PROC GANTT is invoked with the MARKBREAK option and MININTERVAL=DTHOUR so that all breaks during a day can be seen. Because the SCALE= option is not specified, each column denotes one hour of the schedule. Since the project duration is several days long, the entire Gantt chart would be spread across many pages. Simply specifying the COMPRESS or PCOMPRESS option will not be of much help since the text would be barely legible owing to the extent of the scaling. Hence, only a portion of the Gantt chart is shown in Output 4.8.3 using the MINDATE= and MAXDATE= options. Note that the Gantt chart is labeled with the date as well as the time values on the time axis.

   title2 'Variable Length Holidays: INTERVAL=WORKDAY';

   proc gantt holidata=holidays data=sched3;
      chart / holiday=(holiday) holidur=(holidur)
              interval=workday
              dur=days
              mininterval=dthour markbreak
              mindate='30dec91:09:00:00'dt
              maxdate='04jan92:00:00:00'dt
              pcompress;
      id task;
   run;

Output 4.8.3: Variable Length Holidays: INTERVAL=WORKDAY
ga083.gif (4706 bytes)

Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Top
Top

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