The GANTT Procedure

Example 6.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 6.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 2.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 6.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 'Gantt Example 15'; 
  
    data widgetn; 
       label task = "Activity Name"; 
       merge widget details; 
       run; 
  
    proc cpm date='01dec03'd data=widgetn; 
       activity task; 
       duration days; 
       successor succ1 succ2 succ3; 
       id dept; 
       run; 
  
    proc sort; 
       by dept e_start; 
       run; 
  
    title2 'Project Schedules by #BYVAR1'; 
  
    proc gantt split='/';; 
       chart / pcompress scale=1 dur=days 
               mindate='01dec03'd maxdate='11feb04'd; 
       by dept; 
       id task; 
       run;
 

Output 6.15.1: Using BY Processing for Separate Gantt Charts
ga15p1.gif (8322 bytes)

ga15p2.gif (8219 bytes)

ga15p3.gif (8115 bytes)

ga15p4.gif (7261 bytes)

ga15p5.gif (7512 bytes)


Previous Page | Next Page | Top of Page