The CPM Procedure |
This example illustrates multiproject scheduling. Consider a Survey project that contains three phases, Plan, Prepare, and Implement, with each phase containing more than one activity. You can consider each phase of the project as a subproject within the master project, Survey. Each subproject in turn contains the lowest level activities, also referred to as the leaf tasks. The Activity data set, containing the task durations, project hierarchy, and the precedence constraints, is displayed in Output 2.23.1.
The PROJECT and ACTIVITY variables together define the project hierarchy using the parent/child relationship. Thus, the subproject, 'Plan', contains the two leaf tasks, 'plan sur' and 'design q'. Precedence constraints are specified between leaf tasks as well as between subprojects. For example, the subproject 'Prepare' is followed by the subproject 'Implement'. Durations are specified for all the tasks in the project, except for the master project 'Survey'.
In addition to the Activity data set, define a Holiday data set, also displayed in Output 2.23.1.
Output 2.23.1: Survey ProjectThe following statements invoke PROC CPM with a PROJECT statement identifying the parent task for each subtask in the Survey project. The calendar followed is a weekday calendar with a holiday defined on April 9, 2004. The ORDERALL option on the PROJECT statement creates the ordering variables ES_ASC and LS_ASC in the Schedule data set, and the ADDWBS option creates a work breakdown structure code for the project. The Schedule data set is displayed in Output 2.23.2, after being sorted by the variable ES_ASC.
The PROJ_DUR variable is missing for all the leaf tasks, and it contains the project duration for the supertasks. The project duration is computed as the span of all the subtasks of the supertask. The PROJ_LEV variable specifies the level of the subtask within the tree defining the project hierarchy, starting with the level '0' for the master project (or the root), 'Survey'. The variable WBS_CODE contains the Work Breakdown Structure code defined by the CPM procedure using the project hierarchy.
proc cpm data=survey date='29mar04'd out=survout1 interval=weekday holidata=holidata; activity activity; successor succ1-succ3; duration duration; id id; holiday hol; project project / orderall addwbs; run; proc sort; by es_asc; run; title 'Conducting a Market Survey'; title2 'Early and Late Start Schedule'; proc print; run;Output 2.23.2: Survey Project Schedule
|
Next, a Gantt chart of the master project schedule is produced with the subtasks of each project indented under the parent task. To produce the required indentation, prefix the Activity description (saved in the variable id) by a suitable number of blanks using a simple DATA step. The following program shows the DATA step and the invocation of the GANTT procedure; the resulting Gantt chart is plotted in Output 2.23.3. Note the precedence constraints between the two supertasks 'Prepare' and 'Implement'.
data gant; length id $26.; set survout1; if proj_lev=1 then id=" "||id; else if proj_lev=2 then id=" "||id; run; goptions hpos=80 vpos=43; title c=black f=swiss 'Conducting a Market Survey'; title2 c=black f=swiss h=1.5 'Project Schedule'; proc gantt graphics data=gant holidata=holidata; chart / holiday=(hol) interval=weekday font=swiss skip=2 height=1.2 nojobnum compress noextrange activity=activity succ=(succ1-succ3) cprec=cyan cmile=magenta caxis=black cframe=ligr; id id; run;Output 2.23.3: Gantt Chart of Schedule
PROJ_LEV, WBS_CODE, and other project-related variables can be used to display selected information about specific subprojects, summary information about subprojects at a given level of the hierarchy, and more. For example, the following statements display the summary schedule of the first level subtasks of the Survey project (Output 2.23.4).
title 'Market Survey'; title2 'Summary Schedule'; proc print data=survout1; where proj_lev=1; id activity; var proj_dur duration e_start--t_float; run;Output 2.23.4: Survey Project Summary
The variable WBS_CODE in the Schedule data set (see Output 2.23.2) contains the Work Breakdown structure code defined by the CPM procedure. This code is defined to be '0.1' for the subproject 'Prepare'. Thus, the values of WBS_CODE for all subtasks of this subproject are prefixed by '0.1'. To produce reports for the subproject 'Prepare', you can use a simple WHERE clause to subset the required observations from the Schedule data set, as shown in the following statements.
title 'Market Survey'; title2 'Sub-Project Schedule'; proc print data=survout1; where substr(WBS_CODE,1,3) = "0.1"; id activity; var project--activity duration e_start--t_float; run;Output 2.23.5: Subproject Schedule
|
In the first invocation of PROC CPM, the Survey project is scheduled with only a specification for the project start date. Continuing, this example shows how you can impose additional constraints on the master project or on the individual subprojects.
First, suppose that you impose a FINISHBEFORE constraint on the Survey project by specifying the FBDATE to be May 10, 2004. The following program schedules the project with a project start and finish specification. The resulting summary schedule for the subprojects is shown in Output 2.23.6. The late finish time of the project is the 7th of May because there is a weekend on the 8th and 9th of May, 2004.
proc cpm data=survey date='29mar04'd out=survout2 interval=weekday holidata=holidata fbdate='10may04'd; /* project finish date */ activity activity; successor succ1-succ3; duration duration; id id; holiday hol; project project / orderall addwbs; run; title 'Market Survey'; title2 'Summary Schedule: FBDATE Option'; proc print data=survout2; where proj_lev=1; /* First level subprojects */ id activity; var proj_dur duration e_start--t_float; run;Output 2.23.6: Summary Schedule: FBDATE Option
The procedure computes the backward pass of the schedule starting from the project finish date. Thus, the critical path is computed in the context of the entire project. If you want to obtain individual critical paths for each subproject, use the SEPCRIT option on the PROJECT statement. You can see the effect of this option in Output 2.23.7: all the subprojects have T_FLOAT = '0'.
Output 2.23.7: Summary Schedule: FBDATE and SEPCRIT OptionsNow, suppose that, in addition to imposing a FINISHBEFORE constraint on the entire project, the project manager for each subproject specifies a desired duration for his or her subproject. In the present example, the variable duration has values '6', '8', and '18' for the three subprojects. By default these values are not used in either the backward or forward pass, even though they may represent desired durations for the corresponding subprojects. You can specify the USEPROJDUR option on the PROJECT statement to indicate that the procedure should use these specified durations to determine the late finish schedule for each of the subprojects. In other words, if the USEPROJDUR option is specified, the late finish for each subproject is constrained to be less than or equal to
E_START + duration
and this value is used during the backward pass.
The summary schedule resulting from the use of the USEPROJDUR option is shown in Output 2.23.8. Note the difference in the schedules in Output 2.23.7 and Output 2.23.8. In Output 2.23.7, the computed project duration, PROJ_DUR, is used to set an upper bound on the late finish time of each subproject, while in Output 2.23.8, the specified project duration is used for the same purpose. Here, only the summary schedules are displayed; the effect of the two options on the subtasks within each subproject can be seen by displaying the entire schedule in each case. A Gantt chart of the entire project is displayed in Output 2.23.9.
Output 2.23.8: Summary Schedule: FBDATE and USEPROJDUR OptionsThe project schedule is further affected by the presence of any alignment dates on the individual activities or subprojects. For example, if the implementation phase of the project has a deadline of May 5, 2004, you can specify an alignment date and type variable with the appropriate values for the subproject 'Implement', as follows, and invoke PROC CPM with the ALIGNDATE and ALIGNTYPE statements, to obtain the new schedule, displayed in Output 2.23.10.
data survey2; format aldate date7.; set survey; if activity="Implement" then do; altype="fle"; aldate='5may04'd; end; run; proc cpm data=survey2 date='29mar04'd out=survout5 interval=weekday holidata=holidata fbdate='10jun04'd; activity activity; successor succ1-succ3; duration duration; id id; holiday hol; project project / orderall addwbs sepcrit useprojdur; aligntype altype; aligndate aldate; run; title 'Market Survey'; title2 'USEPROJDUR option and Alignment date'; proc print; where proj_lev=1; id activity; var proj_dur duration e_start--t_float; run;Output 2.23.10: USEPROJDUR option and Alignment Date
Copyright © 2008 by SAS Institute Inc., Cary, NC, USA. All rights reserved.