Chapter Contents
Chapter Contents
The GANTT Procedure

Example 4.3: Marking Holidays

This example uses the widget manufacturing project introduced in the PROC CPM chapter. The data sets used in this example are the same as those used in Example 2.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 25, 1991, and finishes on December 27, 1991. PROC CPM schedules the project to start on December 2, 1991, and saves the schedule in a data set named SAVEH.

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. Note that the procedure marks the duration of the holiday with the pattern corresponding to the seventh PATTERN statement. The HPAGES= option is used to fit horizontal span of the chart on one page. The SIMPLEX font is used for all text by specifying the FONT= option in the CHART statement.

   options ps=60 ls=100;

   title 'Gantt Example 3';
   title2 'Marking Holidays';

   /* Activity-on-Node representation of the project */
   data widget;
      input task $ 1-12 days succ1 $ 19-30 succ2 $ 33-44
            succ3 $ 47-58;
   Approve Plan   5  Drawings      Anal. Market  Write Specs
   Drawings      10  Prototype
   Anal. 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 date8. holifin date8. holidur;
   25dec91 27dec91 4
   01jan92 .       .

   * schedule the project subject to holidays;

   proc cpm data=widget holidata=holidays
            out=saveh date='2dec91'd ;
      activity task;
      succ     succ1 succ2 succ3;
      duration days;
      holiday  holiday / holifin=(holifin);

   * sort the schedule by the early start date ;

   proc sort;
      by e_start;

   * print the schedule;

   proc print data=saveh;
      var task days e_start e_finish l_start l_finish
          t_float f_float;

   * plot the schedule;

   proc gantt holidata=holidays data=saveh;
      chart / holiday=(holiday) holiend=(holifin)
              hpages=1 font=simplex;
      id task;

Output 4.3.1: Marking Holidays

Gantt Example 3
Holidays Data Set

1 Approve Plan 5 02DEC91 06DEC91 02DEC91 06DEC91 0 0
2 Drawings 10 07DEC91 16DEC91 07DEC91 16DEC91 0 0
3 Anal. Market 5 07DEC91 11DEC91 10JAN92 14JAN92 30 0
4 Write Specs 5 07DEC91 11DEC91 12DEC91 16DEC91 5 5
5 Mkt. Strat. 10 12DEC91 21DEC91 15JAN92 24JAN92 30 30
6 Prototype 15 17DEC91 04JAN92 17DEC91 04JAN92 0 0
7 Materials 10 05JAN92 14JAN92 05JAN92 14JAN92 0 0
8 Facility 10 05JAN92 14JAN92 05JAN92 14JAN92 0 0
9 Init. Prod. 10 15JAN92 24JAN92 15JAN92 24JAN92 0 0
10 Evaluate 10 25JAN92 03FEB92 30JAN92 08FEB92 5 5
11 Test Market 15 25JAN92 08FEB92 25JAN92 08FEB92 0 0
12 Marketing 0 25JAN92 25JAN92 14FEB92 14FEB92 20 20
13 Changes 5 09FEB92 13FEB92 09FEB92 13FEB92 0 0
14 Production 0 14FEB92 14FEB92 14FEB92 14FEB92 0 0

Output 4.3.2: Marking Holidays
ga03p1.gif (4622 bytes)

ga03p2.gif (4372 bytes)

Chapter Contents
Chapter Contents

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