The GANTT Procedure

Example 8.15 BY Processing

Every activity in the widget manufacturing project is carried out by one of five departments: Planning, Engineering, Marketing, Manufacturing, and Testing. The DETAILS data set in Example 8.6 identifies the department responsible for each activity. Thus, the project can be thought of as made up of five smaller subprojects, a subproject being the work carried out by a department. A foreseeable need of the project manager and every department is a separate Gantt chart for each subproject. This example uses the WIDGETN data set from Example 4.1, which is formed by merging the WIDGET data set with the DETAILS data set. After scheduling the master project using PROC CPM with DEPT as an ID variable, the Schedule data set is sorted by department name and early start time. The GANTT procedure is then invoked with the variable DEPT specified in the BY statement to obtain individual Gantt charts for each subproject. The Gantt charts for the five different subprojects are shown in Output 8.15.1. The MINDATE= and MAXDATE= options have been specified to ensure a consistent date range across projects. Notice that the TITLE2 statement uses the text substitution option #BYVARn, which substitutes the name of the nth BY variable. The BY-LINE that appears below the titles identifies the current values of the BY variables. You can suppress this using the NOBYLINE option in an OPTION statement or the HBY option in a GOPTIONS statement. The SPLIT= option is specified to prevent the TASK variable label from being split on the embedded blank.

title h=2 'Gantt Example 15';
data widgetn;
   label task = "Activity Name";
   merge widget details;
proc cpm date='01dec03'd data=widgetn;
   activity task;
   duration days;
   successor succ1 succ2 succ3;
   id dept;

proc sort;
   by dept e_start;

title2 h=1.5 'Project Schedules by #BYVAR1';
goptions htext=1.1;

proc gantt split='/';
   chart / pcompress scale=1 dur=days height=1.2
           mindate='01dec03'd maxdate='11feb04'd;
   by dept;
   id task;

Output 8.15.1: Using BY Processing for Separate Gantt Charts

Using BY Processing for Separate Gantt Charts
External File:images/ga15_1.png
External File:images/ga15_2.png
External File:images/ga15_3.png
External File:images/ga15_4.png