Introduction to Project Management |
The previous two examples illustrated some of the reports that can be generated using the Schedule output data set produced by PROC CPM. This section illustrates the use of PROC CPM to perform resource-constrained scheduling and to obtain a resource Usage output data set for generating reports of resource utilization during the course of a project. A primary concern in data processing centers is the number of processors needed to perform various tasks. Given a series of programming tasks, a common question faced by a data center operator is how to allocate computer resources to the various tasks.
Consider a simple job that involves sorting six data sets A, B, C, D, E, and F, merging the first three into one master data set, merging the last three into another comparison data set, and then comparing the two merged data sets. The precedence constraints between the activities (captured by the variables task and succ), the time required by the activities (the variable dur), and the resource required (the variable processor) are shown in the following code:
data program; format task $8. succ $8. ; input task & succ & dur processor; datalines; Sort A Merge 1 5 1 Sort B Merge 1 4 1 Sort C Merge 1 3 1 Sort D Merge 2 6 1 Sort E Merge 2 4 1 Sort F Merge 2 6 1 Merge 1 Compare 5 1 Merge 2 Compare 4 1 Compare . 5 1 ;
If the programming project is scheduled (in absolute units) without any resource constraints, it will take 15 time units for completion and will require a maximum availability of six processors. Suppose now that only two processors are available. The resin data set limits the availability of the resource to 2, and PROC CPM is invoked with two input data sets (Activity data set program and Resource data set resin) to produce a resource-constrained schedule.
PROC CPM produces two output data sets. The Schedule data set
(progschd)
contains the resource-constrained schedule (S_START and
S_FINISH variables) in addition to the early
and late start unconstrained schedules. The
Usage data set (progrout) shows the number of processors
required at every unit of time, if the early start schedule or the late
start schedule or the resource-constrained schedule were followed, in
the variables eprocessor, lprocessor, and rprocessor,
respectively; the variable aprocessor shows the number of
processors remaining after resource allocation.
The two output data sets are displayed in Output 1.5.1.
data resin; input per processor; datalines; 0 2 ; proc cpm data=program resin=resin out=progschd resout=progrout; activity task; duration dur; successor succ; resource processor/per=per; run; title 'Scheduling Programming Tasks'; title2 'Data Set PROGSCHD'; proc print data=progschd; run; title2 'Data Set PROGROUT'; proc print data=progrout; run;
The Schedule and Usage data sets, displayed in Output 1.5.1, can be used to generate any type of report concerning the schedules or processor usage. In the following program, the unconstrained and constrained schedules are first plotted using PROC GANTT (see Output 1.5.2).
Output 1.5.1: Data Sets PROGSCHD and PROGROUTgoptions hpos=80 vpos=43; title 'Scheduling Programming Tasks'; title2 h=1.5 'Comparison of Schedules'; proc gantt data=progschd graphics; chart / increment=2 caxis=black; id task; run;Output 1.5.2: Gantt Chart Comparing Schedules
Next, the GPLOT procedure is invoked using the Usage data set to compare the unconstrained and the constrained usage of the resource (see Output 1.5.3).
/* Create a data set for use with PROC GPLOT */ data plotout; set progrout; label _time_='Time of Usage'; label processor='Number of Processors'; label resource='Type of Schedule Followed'; resource='Constrained'; processor=rprocessor; output; resource='Early Start'; processor=eprocessor; output; run;
axis1 minor=none width=3; axis2 length=80 pct; symbol1 i=steplj c=red; symbol2 i=steplj l=3 c=green;
title2 h=1.5 'Comparison of Processor Usage'; proc gplot data=plotout; plot processor * _time_ = resource/ vaxis=axis1 haxis=axis2 caxis=black; run;Output 1.5.3: Plot Comparing Resource Usage
Copyright © 2008 by SAS Institute Inc., Cary, NC, USA. All rights reserved.