The GANTT Procedure |
This example uses the widget manufacturing project introduced in Chapter 2, "The CPM Procedure." The data sets used in this example are the same as those used in Example 2.8 to illustrate holiday processing in PROC CPM. The WIDGET data set describes the project in AON format. The variable TASK identifies the activity and the variables SUCC1, SUCC2, and SUCC3 identify the successors to TASK. The variable DAYS defines the duration of an activity. Another data set, HOLIDAYS, defines the holidays that need to be taken into account when scheduling the project. Although the HOLIDAYS data set contains three variables HOLIDAY, HOLIFIN, and HOLIDUR, the HOLIDUR variable is not used in this example. Thus, the Christmas holiday starts on December 24, 2003, and finishes on December 26, 2003. PROC CPM schedules the project to start on December 1, 2003, and saves the schedule in a data set named SAVEH. This data set is shown in Output 6.3.1.
Next, the GANTT procedure is invoked with the specification of HOLIDATA= HOLIDAYS in the PROC GANTT statement and the HOLIDAY= and HOLIEND= options in the CHART statement, causing the Christmas and New Year holidays to be marked on the chart. The resulting Gantt chart is shown in Output 6.3.2. Note that the procedure marks the duration of the holiday with the pattern corresponding to the seventh PATTERN statement. (See the "Graphics Examples" section for a list of the pattern statements used in the examples.) The HPAGES= option is used to fit the horizontal span of the chart on one page.
options ps=60 ls=100; title 'Gantt Example 3'; title2 'Marking Holidays'; /* Activity-on-Node representation of the project */ data widget; format task $12. succ1-succ3 $12. ; input task & days succ1 & succ2 & succ3 & ; datalines; Approve Plan 5 Drawings Study Market Write Specs Drawings 10 Prototype . . Study Market 5 Mkt. Strat. . . Write Specs 5 Prototype . . Prototype 15 Materials Facility . Mkt. Strat. 10 Test Market Marketing . Materials 10 Init. Prod. . . Facility 10 Init. Prod. . . Init. Prod. 10 Test Market Marketing Evaluate Evaluate 10 Changes . . Test Market 15 Changes . . Changes 5 Production . . Production 0 . . . Marketing 0 . . . ;
data holidays; format holiday holifin date7.; input holiday & date7. holifin & date7. holidur; datalines; 24dec03 26dec03 4 01jan04 . . ; * schedule the project subject to holidays; proc cpm data=widget holidata=holidays out=saveh date='1dec03'd ; activity task; succ succ1 succ2 succ3; duration days; holiday holiday / holifin=(holifin); run; * sort the schedule by the early start date ; proc sort; by e_start; run; * print the schedule; proc print data=saveh; var task days e_start e_finish l_start l_finish t_float f_float; run; * plot the schedule; proc gantt holidata=holidays data=saveh; chart / holiday=(holiday) holiend=(holifin) hpages=1; id task; run;Output 6.3.1: Schedule Data Set SAVEH
Copyright © 2008 by SAS Institute Inc., Cary, NC, USA. All rights reserved.