The GANTT Procedure |
The following example illustrates an application of the PATTERN variable to display summary bars for subprojects. The LAN Selection Project (Bostwick 1986) consists of eight subprojects, two of which represent the beginning and ending of the master project. The data set LANACT defines the structure of the project. The ACT and SUCC variables define the precedence relationships, the PARENT variable defines the parent task, and the DAYS variable contains the duration of the activity.
The project is scheduled using the CPM procedure with a PARENT statement to identify the parent. The schedule data set, SCHED, is created by appending a _PATTERN variable to the output data set generated by CPM. The value of this variable is set to '4,' corresponding to subprojects, and set to missing otherwise. This results in the subproject bars being filled using PATTERN4, namely a solid black pattern. The ACTID variable is indented within the DATA step to reflect the level of each activity in the project hierarchy when used as the ID variable.
A Label data set, LABELS, is created in order to add markers to both ends of the schedule bars that correspond to subprojects. The two observations in the LABELS data set are linked to the SCHED data set with the _PATTERN variable.
The GANTT procedure is next invoked to produce the Gantt chart in Output 6.23.1. The LABVAR=_PATTERN specification establishes the link between the Schedule and Label data sets. The ACT= and SUCC= options are used to display the precedence relationships between activities.
pattern1 c=blue v=r5; /* Non-critical duration */ pattern2 c=blue v=e; /* Slack duration */ pattern3 c=red v=x5; /* Critical duration */ pattern4 c=black v=s; /* Project duration */
data lanact; format act $30. succ $30. parent $20.; input act & succ & parent & days; datalines; Measure Current Volume Forecast Future Volume NEEDS ASSESSMENT 2 Literature Survey Manufacturer Demos MARKET SURVEY 5 Determine Current Users Forecast Future Needs NEEDS ASSESSMENT 2 Forecast Future Volume Prepare Network Spec NEEDS ASSESSMENT 2 Manufacturer Demos Identify Vendors MARKET SURVEY 5 Forecast Future Needs Prepare Network Spec NEEDS ASSESSMENT 2 Identify Vendors . MARKET SURVEY 2 Prepare Network Spec . NEEDS ASSESSMENT 2 Prepare RFQ Evaluate Vendor Responses VENDOR SELECTION 4 Prepare Cable Plan Procure Cable SITE PREPARATION 4 Evaluate Vendor Responses Notify Final Candidate VENDOR SELECTION 15 Procure Cable Install Cable SITE PREPARATION 22 Notify Final Candidate Negotiate Price/Config VENDOR SELECTION 1 Install Cable . SITE PREPARATION 10 Negotiate Price/Config Prepare Purchase Order VENDOR SELECTION 3 Prepare Purchase Order . VENDOR SELECTION 1 Server Functional Spec Server Detail Design SPECIAL HARDWARE 5 Procure LAN Hardware Receive Network Hardware NETWORK INSTALLATION 25 Server Detail Design Server Coding SPECIAL HARDWARE 10 Receive Network Hardware Install LAN Hardware NETWORK INSTALLATION 4 Server Coding Test Server Code SPECIAL HARDWARE 10 Install LAN Hardware Test Network NETWORK INSTALLATION 7 Test Server Code Install/Integrate Server SPECIAL HARDWARE 5 Test Network . NETWORK INSTALLATION 5 Install/Integrate Server . SPECIAL HARDWARE 2 BEGIN PROCUREMENT NEEDS ASSESSMENT . . BEGIN PROCUREMENT MARKET SURVEY . . NEEDS ASSESSMENT VENDOR SELECTION . . NEEDS ASSESSMENT SITE PREPARATION . . MARKET SURVEY Prepare Network Spec . . VENDOR SELECTION NETWORK INSTALLATION . . VENDOR SELECTION SPECIAL HARDWARE . . SITE PREPARATION Install LAN Hardware . . NETWORK INSTALLATION NETWORK AVAILABLE . . SPECIAL HARDWARE NETWORK AVAILABLE . . ; proc sort data=lanact; by act; run; proc cpm data=lanact out=lanout expand interval=workday date='03nov03'd; parent parent / wbs eso; activity act; duration days; successor succ; run; /* create the schedule data set with a pattern variable */ data sched; label wbs_code= 'WBS'; label act='Project/Activity'; set lanout; if proj_lev !0 then do; if parent=' ' then _pattern=4; actid=act; do i=1 to proj_lev-1; /* indent the id values */ actid = " " || actid; end; output; end; ; proc sort data=sched; by es_asc wbs_code; run;
/* create the label data set */ data labels; _pattern=4; _flabel='orfont'; _jlabel='c'; _yoffset=0.925; _label='Z'; _xvar='e_start '; output; _xvar='l_finish'; output; ; title1 f='Cumberland AMT' 'Gantt Example 23'; title2 f='Cumberland AMT' 'Displaying Summary Bars For Each Subproject'; proc gantt data=sched labdata=labels; id actid wbs_code; chart / pcompress nojobnum increment=7 scale=1.5 ctext=black caxis=black mindate='01nov03'd maxdate='29feb04'd labvar=_pattern font='Cumberland AMT' height=1.5 minoffgv=1.5 minofflv=1.5 cprec=black wprec=1 act=act succ=succ; run;Output 6.23.1: Using the PATTERN Variable and Labels
Copyright © 2008 by SAS Institute Inc., Cary, NC, USA. All rights reserved.