The GANTT Procedure |
This example demonstrates the use of nonstandard precedence relationships and specification of the PRECDATA= option in the PROC GANTT statement.
The project and nonstandard precedence relationships are defined by the WIDGLAG2 data set, which is a modification of the WIDGLAG data set that was used in Example 2.11 to illustrate the CPM procedure. The activity and successor variables are represented by the TASK and SUCC variables, respectively, and the lag type of the relationship is defined by the LAGDUR variable. The LAGDUR variable defines the lag type in keyword_duration_calendar format for the purpose of passing the information to PROC CPM. Although PROC GANTT accepts this format for a lag variable, it does not use the duration and calendar values when drawing the connection since the schedule is already computed at this time (presumably by PROC CPM).
As in the WIDGLAG data set, the WIDGLAG2 data set specifies a Start-to-Start lag of nine days between the activity 'Prototype' and its successors, 'Materials' and 'Facility,' and a Finish-to-Start lag of two days between 'Facility' and 'Init. Prod.'. In addition, changes to the widget design are permitted to be made no earlier than six days after in-house evaluation of the product has begun. Furthermore, the Engineering department has to ensure that there will be at least three days available for any changes that need to be carried out after the test market results have come in. These constraints are incorporated in the WIDGLAG data set by setting the value of the LAGDUR variable equal to 'ss_6' for the relationship between 'Evaluate' and 'Changes' and equal to 'ff_3' for the relationship between 'Test Market' and 'Changes.'
The project is scheduled using PROC CPM subject to weekends and the holidays defined in the HOLIDAYS data set. Specifying the COLLAPSE option in the PROC CPM statement ensures that there is one observation per activity. The WIDGLAGH data set is created by deleting the successor variable from the Schedule data set produced by PROC CPM.
Since there is no precedence information contained in the WIDGLAGH data set, specifying DATA=WIDGLAGH in the PROC GANTT statement without the PRECDATA= option produces a nonprecedence Gantt chart. You can produce a Logic Gantt chart by specifying the precedence information using the PRECDATA= option in the PROC GANTT statement as long as the activity variable is common to both the schedule and Precedence data sets.
The Gantt chart shown in Output 8.20.1 is produced by specifying PRECDATA= WIDGLAG2. The lag type of the precedence connections is indicated to PROC GANTT using the LAG= option in the CHART statement. The width of the precedence connections is set to 2 with the WPREC= option, and the color of the connections is set to blue using the CPREC= option. The MININTGV= and MINOFFLV= options are specified in the CHART statement in an attempt to minimize the number of 5-segment connections. A reference line with a line style of 2 is drawn at the beginning of every month by using the REF= and LREF= options in the CHART statement.
options ps=60 ls=100; title 'Gantt Example 20';
/* Activity-on-Node representation of the project with lags */ data widglag2; format task $12. succ $12. lagdur $4. ; input task & days succ & lagdur $ ; datalines; Approve Plan 5 Drawings . Approve Plan 5 Study Market . Approve Plan 5 Write Specs . Drawings 10 Prototype . Study Market 5 Mkt. Strat. . Write Specs 5 Prototype . Prototype 15 Materials ss_9 Prototype 15 Facility ss_9 Mkt. Strat. 10 Test Market . Mkt. Strat. 10 Marketing . Materials 10 Init. Prod. . Facility 10 Init. Prod. fs_2 Init. Prod. 10 Test Market . Init. Prod. 10 Marketing . Init. Prod. 10 Evaluate . Evaluate 10 Changes ss_6 Test Market 15 Changes ff_3 Changes 5 Production . Production 0 . . Marketing 0 . . ; data holidays; format holiday holifin date7.; input holiday & date7. holifin & date7. holidur; datalines; 24dec03 26dec03 4 01jan04 . . ;
proc cpm data=widglag2 holidata=holidays date='1dec03'd interval=weekday collapse; activity task; succ succ / lag = (lagdur); duration days; holiday holiday / holifin=(holifin); run;
data widglagh; set _last_; drop succ; run;
* set up required pattern statements; pattern1 c=blue v=s; /* duration of a noncrit. activity */ pattern2 c=blue v=e; /* slack time for a noncrit. act. */ pattern3 c=red v=s; /* duration of a critical activity */ pattern4 c=red v=e; /* slack time for a supercrit. act. */ pattern5 c=red v=r2; /* duration of a supercrit. act. */ pattern6 c=cyan v=s; /* actual duration of an activity */ pattern7 c=black v=x1; /* break due to a holiday */ * set vpos to 50 and hpos to 100; goptions vpos=50 hpos=100; title2 c=black 'Nonstandard Precedence Relationships and the PRECDATA= Option'; proc gantt graphics data=widglagh precdata=widglag2 holidata=holidays; chart / compress dur=days height=1.5 holiday=(holiday) holifin=(holifin) cmile=blue cprec=blue wprec=2 ref='01dec03'd to '01mar04'd by month cref=black lref=2 reflabel caxis=black act=task succ=(succ) lag=(lagdur) minintgv=2 minofflv=.5; id task; run;
Copyright © SAS Institute, Inc. All Rights Reserved.