Previous Page | Next Page

The GANTT Procedure

Example 8.14 Specifying the Schedule Data Directly

Although each of the examples shown so far uses PROC CPM to produce the Schedule data set for PROC GANTT, this is by no means a requirement of the GANTT procedure. While the CPM procedure is a convenient means for producing different types of schedules, you can create your own schedule and draw a Gantt chart of the schedule without any intervention from PROC CPM. This is done by storing the schedule information in a SAS data set and specifying the data set name using the DATA= option in the PROC GANTT statement. It is also not necessary for the variables in the data set to have specific names, although giving the variables certain names can eliminate the need to explicitly identify them in the CHART statement.

An example of the direct type of input can be seen in Example 8.10 which illustrates plotting of the actual schedule. In Example 8.10, PROC CPM was used to compute the predicted early/late schedule, which was then stored in the SAVEH data set. However, information about the actual schedule, which was provided in the COMPLETE data set, was not used by PROC CPM. Instead, this information was merged with the SAVEH data set to form WIDGELA, the Schedule data set for PROC GANTT. The variables representing the actual start and finish were identified to PROC GANTT using the A_START= and A_FINISH= options, respectively, in the CHART statement. The identification of the variables would not have been necessary if the start and finish variable names were A_START and A_FINISH, respectively.

The following example draws a Gantt chart of the early, late, and resource-constrained schedules for the widget manufacturing project. The schedule information is held in the WIDGDIR data set. The WIDGDIR data set contains the variables TASK, SEGMT_NO, DUR, RS, RF, E_START, E_FINISH, SDATE, and FDATE. The variable TASK identifies the activity. E_START and E_FINISH are recognized as the default names of the early start and early finish variables, respectively. The variables SDATE and FDATE define the late start and late finish times, respectively. Since these are not the default names for the late schedule variables, they need to be identified as such by specifying the LS= and LF= options (or the L_START= and L_FINISH= options) in the CHART statement. The variables RS and RF represent the resource-constrained start and finish times, respectively. As with the late schedule, these variables need to be identified to PROC GANTT by specifying the SS= and SF= options (or the S_START= and S_FINISH= options) in the CHART statement. Further, the SEGMT_NO variable identifies the segment number of the resource constrained schedule that an observation corresponds to since these are activities that start and stop multiple times before completion. The ZDUR variable is identified as a zero duration indicator by specifying the DUR= option in the CHART statement. Since ZDUR is zero for 'Production' and 'Marketing,' these activities are represented by milestones on the chart. Notice that although all the other activities have a value of '1' for the ZDUR variable, any nonzero value will produce the same result. This is due to the fact that PROC GANTT only uses this variable as an indicator of whether the activity has zero duration or not, in contrast to the interpretation of the DURATION variable in PROC CPM.

options ps=60 ls=100;

title 'Gantt Example 14';
 /* Activity-on-Node representation of the project */
data widgdir;
   format task $12. rs rf e_start e_finish sdate fdate date7.;
   input task & segmt_no zdur rs & date7. rf & date7.
         e_start & date7. e_finish & date7.
         sdate & date7.  fdate & date7.;
   datalines;
Approve Plan  . 1 01DEC03  05DEC03  01DEC03  05DEC03  01DEC03  05DEC03
Drawings      . 1 08DEC03  23DEC03  08DEC03  19DEC03  08DEC03  19DEC03
Drawings      1 1 08DEC03  09DEC03  08DEC03  19DEC03  08DEC03  19DEC03
Drawings      2 1 12DEC03  23DEC03  08DEC03  19DEC03  08DEC03  19DEC03
Study Market  . 1 08DEC03  12DEC03  08DEC03  12DEC03  21JAN04  27JAN04
Write Specs   . 1 08DEC03  12DEC03  08DEC03  12DEC03  15DEC03  19DEC03
Prototype     . 1 24DEC03  15JAN04  22DEC03  13JAN04  22DEC03  13JAN04
Mkt. Strat.   . 1 15DEC03  20JAN04  15DEC03  29DEC03  28JAN04  10FEB04
Mkt. Strat.   1 1 15DEC03  23DEC03  15DEC03  29DEC03  28JAN04  10FEB04
Mkt. Strat.   2 1 16JAN04  20JAN04  15DEC03  29DEC03  28JAN04  10FEB04
Materials     . 1 16JAN04  29JAN04  14JAN04  27JAN04  14JAN04  27JAN04
Facility      . 1 16JAN04  29JAN04  14JAN04  27JAN04  14JAN04  27JAN04
Init. Prod.   . 1 30JAN04  12FEB04  28JAN04  10FEB04  28JAN04  10FEB04
Evaluate      . 1 13FEB04  26FEB04  11FEB04  24FEB04  18FEB04  02MAR04
Test Market   . 1 13FEB04  04MAR04  11FEB04  02MAR04  11FEB04  02MAR04
Changes       . 1 05MAR04  11MAR04  03MAR04  09MAR04  03MAR04  09MAR04
Production    . 0 12MAR04  12MAR04  10MAR04  10MAR04  10MAR04  10MAR04
Marketing     . 0 13FEB04  13FEB04  11FEB04  11FEB04  10MAR04  10MAR04
;

data holdata;
   format hol date7.;
   input hol & date7.;
   datalines;
25dec03
01jan04
;
/* set up required 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        */

title2 'Specifying the Schedule Data Directly';

proc gantt data=widgdir holidata=holdata;
   chart / holiday=(hol) dur=zdur
           ss=rs sf=rf ls=sdate lf=fdate
           height=1.5 pcompress;
   id task;
   run;

Output 8.14.1 Specifying the Schedule Data Directly
Specifying the Schedule Data Directly

Previous Page | Next Page | Top of Page