The GANTT Procedure

 

Example 8.3 Marking Holidays

This example uses the widget manufacturing project introduced in Chapter 4, The CPM Procedure. The data sets used in this example are the same as those used in Example 4.8 to illustrate holiday processing in PROC CPM. The WIDGET data set describes the project in AON format. The variable TASK identifies the activity and the variables SUCC1, SUCC2, and SUCC3 identify the successors to TASK. The variable DAYS defines the duration of an activity. Another data set, HOLIDAYS, defines the holidays that need to be taken into account when scheduling the project. Although the HOLIDAYS data set contains three variables HOLIDAY, HOLIFIN, and HOLIDUR, the HOLIDUR variable is not used in this example. Thus, the Christmas holiday starts on December 24, 2003, and finishes on December 26, 2003. PROC CPM schedules the project to start on December 1, 2003, and saves the schedule in a data set named SAVEH. This data set is shown in Output 8.3.1.

Next, the GANTT procedure is invoked with the specification of HOLIDATA= HOLIDAYS in the PROC GANTT statement and the HOLIDAY= and HOLIEND= options in the CHART statement, causing the Christmas and New Year holidays to be marked on the chart. The resulting Gantt chart is shown in Output 8.3.2. Note that the procedure marks the duration of the holiday with the pattern corresponding to the seventh PATTERN statement. (See the section Graphics Examples for a list of the pattern statements used in the examples.)

options ps=60 ls=80;

title h=2 'Gantt Example 3';
title2 'Marking Holidays';
/* Activity-on-Node representation of the project */
data widget;
   format task $12. succ1-succ3 $12. ;
   input task & days succ1 & succ2 & succ3 & ;
   datalines;
Approve Plan   5  Drawings      Study Market  Write Specs
Drawings      10  Prototype     .             .
Study Market   5  Mkt. Strat.   .             .
Write Specs    5  Prototype     .             .
Prototype     15  Materials     Facility      .
Mkt. Strat.   10  Test Market   Marketing     .
Materials     10  Init. Prod.   .             .
Facility      10  Init. Prod.   .             .
Init. Prod.   10  Test Market   Marketing     Evaluate
Evaluate      10  Changes       .             .
Test Market   15  Changes       .             .
Changes        5  Production    .             .
Production     0  .             .             .
Marketing      0  .             .             .
;

data holidays;
   format holiday holifin date7.;
   input holiday & date7. holifin & date7. holidur;
   datalines;
24dec03  26dec03  4
01jan04  .        .
;
* schedule the project subject to holidays;
proc cpm data=widget holidata=holidays
         out=saveh date='1dec03'd ;
   activity task;
   succ     succ1 succ2 succ3;
   duration days;
   holiday  holiday / holifin=(holifin);
   run;

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

* print the schedule;
proc print data=saveh;
   var task days e_start e_finish l_start l_finish
       t_float f_float;
   run;

Output 8.3.1 Schedule Data Set SAVEH
Gantt Example 3
Marking Holidays

Obs task days E_START E_FINISH L_START L_FINISH T_FLOAT F_FLOAT
1 Approve Plan 5 01DEC03 05DEC03 01DEC03 05DEC03 0 0
2 Drawings 10 06DEC03 15DEC03 06DEC03 15DEC03 0 0
3 Study Market 5 06DEC03 10DEC03 09JAN04 13JAN04 30 0
4 Write Specs 5 06DEC03 10DEC03 11DEC03 15DEC03 5 5
5 Mkt. Strat. 10 11DEC03 20DEC03 14JAN04 23JAN04 30 30
6 Prototype 15 16DEC03 03JAN04 16DEC03 03JAN04 0 0
7 Materials 10 04JAN04 13JAN04 04JAN04 13JAN04 0 0
8 Facility 10 04JAN04 13JAN04 04JAN04 13JAN04 0 0
9 Init. Prod. 10 14JAN04 23JAN04 14JAN04 23JAN04 0 0
10 Evaluate 10 24JAN04 02FEB04 29JAN04 07FEB04 5 5
11 Test Market 15 24JAN04 07FEB04 24JAN04 07FEB04 0 0
12 Marketing 0 24JAN04 24JAN04 13FEB04 13FEB04 20 20
13 Changes 5 08FEB04 12FEB04 08FEB04 12FEB04 0 0
14 Production 0 13FEB04 13FEB04 13FEB04 13FEB04 0 0

* plot the schedule;
proc gantt holidata=holidays data=saveh;
   chart / holiday=(holiday) holiend=(holifin);
   id task;
   run;

Output 8.3.2 Marking Holidays on the Gantt Chart
Marking Holidays on the Gantt Chart