Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
The GANTT Procedure

Example 4.16: Gantt Charts by Persons

Now suppose that you want to obtain individual Gantt charts for two people (Thomas and William) working on the widget manufacturing project. The data set WIDGBYGP, displayed in Output 4.16.1, contains two new variables, THOMAS and WILLIAM. Each variable has a value '1' for activities in which the person is involved and a missing value otherwise. Thus, a value of '1' for the variable THOMAS in observation number 2 indicates that Thomas is working on the activity 'Drawings'.

PROC CPM is used to schedule the project to start on December 2, 1991. A data set named PERSONS is created containing one observation per activity per person working on that activity and a new variable named PERSON containing the name of the person to which the observation pertains. For example, this new data set contains two observations for the activity 'Write Specs', one with PERSON='Thomas' and the other with PERSON='William', and no observation for the activity 'Approve Plan' . This data set is sorted by PERSON and E_START, and displayed in Output 4.16.2. PROC GANTT is next invoked with a BY statement to obtain individual charts for each person. The resulting Gantt charts are shown in Output 4.16.3. The BY-LINE is suppressed by specifying the NOBYLINE option in an OPTIONS statement and the name of the person corresponding to the chart is displayed in the subtitle by using the #BYVAL substitution in the TITLE2 statement.

Output 4.16.1: Gantt Charts by Persons

Gantt Example 16
Data widgbyp

Obs task days tail head thomas william
1 Approve Plan 5 1 2 . .
2 Drawings 10 2 3 1 .
3 Anal. Market 5 2 4 . .
4 Write Specs 5 2 3 1 1
5 Prototype 15 3 5 1 1
6 Mkt. Strat. 10 4 6 . .
7 Materials 10 5 7 . 1
8 Facility 10 5 7 . 1
9 Init. Prod. 10 7 8 1 .
10 Evaluate 10 8 9 1 1
11 Test Market 15 6 9 . .
12 Changes 5 9 10 1 .
13 Production 0 10 11 . 1
14 Marketing 0 6 12 . .
15 Dummy 0 8 6 . .


   title f=swiss 'Gantt Example 16';

   proc cpm data=widgbyp date='2dec91'd;
      tailnode tail;
      duration days;
      headnode head;
      id task thomas william;
   run;


   data persons;
      set _last_;
      if william^=. then do;
         person='William';
         output;
         end;
      if thomas^=. then do;
         person='Thomas';
         output;
         end;
      drop thomas william;
   run;


   proc sort data=persons;
      by person e_start;
   run;


   title2 'Data PERSONS';
   proc print data=persons;
   run;

   /* suppress byline */
   options nobyline;

   title2 f=swiss 'Personalized Gantt Chart for #BYVAL(person)';

   proc gantt data=persons;
      chart / pcompress font=swiss;
      by person;
      id task;
      run;

Output 4.16.2: Gantt Charts by Persons

Data PERSONS

Obs tail head days task E_START E_FINISH L_START L_FINISH T_FLOAT F_FLOAT person
1 2 3 10 Drawings 07DEC91 16DEC91 07DEC91 16DEC91 0 0 Thomas
2 2 3 5 Write Specs 07DEC91 11DEC91 12DEC91 16DEC91 5 5 Thomas
3 3 5 15 Prototype 17DEC91 31DEC91 17DEC91 31DEC91 0 0 Thomas
4 7 8 10 Init. Prod. 11JAN92 20JAN92 11JAN92 20JAN92 0 0 Thomas
5 8 9 10 Evaluate 21JAN92 30JAN92 26JAN92 04FEB92 5 5 Thomas
6 9 10 5 Changes 05FEB92 09FEB92 05FEB92 09FEB92 0 0 Thomas
7 2 3 5 Write Specs 07DEC91 11DEC91 12DEC91 16DEC91 5 5 William
8 3 5 15 Prototype 17DEC91 31DEC91 17DEC91 31DEC91 0 0 William
9 5 7 10 Materials 01JAN92 10JAN92 01JAN92 10JAN92 0 0 William
10 5 7 10 Facility 01JAN92 10JAN92 01JAN92 10JAN92 0 0 William
11 8 9 10 Evaluate 21JAN92 30JAN92 26JAN92 04FEB92 5 5 William
12 10 11 0 Production 10FEB92 10FEB92 10FEB92 10FEB92 0 0 William


Output 4.16.3: Gantt Charts by Person
ga16p1.gif (4333 bytes)

ga16p2.gif (4317 bytes)

Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Top
Top

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