Example 4.22: Using the Automatic Text Annotation Feature
The following example is a subproject of larger project involving the
the maintenance of a pipeline and steam calender (Moder, Phillips, and Davis 1983),
and it illustrates the automatic text annotation feature
of the GANTT procedure. The SHUTDOWN data set is input as the activity data set
to PROC CPM, and the project is scheduled to begin on June 1, 1994.
PROC GANTT is used to produce a Gantt chart of the resulting schedule
with the data set LABELS specified as a Label data set. The LABVAR=
option in the CHART statement specifies the ACT variable as the
common linking variable.
The LABSPLIT= option is specified in order to prevent the labels
from splitting on embedded blanks.
The first observation in the LABELS data set causes the value of the ACT
variable to be displayed at the E_START time for every activity in the project.
The value of _YOFFSET='-.2' positions the baseline of the displayed text at
0.2 barheights above the top of the first bar for the activity.
Similarly the second observation displays the ID variable at the E_START
time for each activity with the baseline positioned at 0.8 barheights
below the bottom of the first bar for the activity.
The heights for both these strings is 1 barheight.
The next two observations in the LABELS data set display the symbols
corresponding to the values 'N' and 'M' in the ORFONT font, rotated at an angle
of 90 degrees, beside the milestones corresponding to the deactivation
and activation of the calender, respectively.
Observations 5 and 6 indicate the start and finish of the "Maintenance
Period" by displaying the indicated strings rotated 90 degrees at the
start and finish times of the activity 'Repair Calender.'
Finally, the last three observations provide headings for each of the
three distinct regions on the chart. The _JLABEL variable is used along
with the _XVAR variable to place the strings in the regions defined by
the start and finish times of the 'Repair Calender' activity.
It should be noted that since the
plot times are linked to variables rather than absolute values, the
Label data set need not be changed even if the project is rescheduled.
This is a convenient feature when monitoring a project in progress, since
the annotation automatically places the labels at the appropriate times.
title c=black f=swiss 'Gantt Example 22';
input act succ id & $20. dur;
1100 1110 Start Project 0
1110 1120 Procure Pipe 10
1120 1130 Prefab Pipe Sections 5
1130 1140 Deactivate Calender 0
1140 1150 Position New Pipe 1
1150 1160 Start Dissasembly 0
1160 1170 Dissasemble Calender 2
1170 1200 Finish Dissasembly 0
1200 1300 Repair Calender 10
1300 1310 Start Assembly 0
1310 1320 Reassemble Calender 3
1320 1330 Finish Assembly 0
1330 1340 Connect Pipes 2
1340 1350 Adjust and Balance 1
1350 1360 Activate Calender 0
1360 1370 System Testing 1
1370 . Finish Project 0
proc cpm data=shutdown date='01jun94'd interval=day out=sched;
input act _y _xvar $ _lvar $ _yoffset _xoffset _label & $25.
_alabel _hlabel _jlabel $ _flabel $ ;
. -1 e_start act -.3 0 . 0 1.5 . .
. -1 e_start id 2.3 0 . 0 1.5 . .
1130 . e_start . 1.5 -1 N 90 2 L orfont
1350 . e_finish . 1.5 5 M 90 2 L orfont
1200 17 e_start . 2.5 1 Start Maintenance Period 90 2 . swiss
1200 17 e_finish . 2.5 .5 Finish Maintenance Period 90 2 . swiss
1200 1 e_start . . -6 Shutdown 0 3 R .
1200 1 e_start . . 2 Maintenance 0 3 L .
1200 1 e_finish . . 6 Start-Up 0 3 L .
title2 f=swiss 'Automatic Text Annotation Example';
proc gantt data=sched labdata=labels maxdec=0;
chart / pcompress nolegend nojobnum dur=dur
ref='19jun94'd '29jun94'd lref=20
Output 4.22.1: Using the LABDATA= Option
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.