The NETDRAW Procedure |
The first step in defining a
project is to make a list of the activities in the project and
determine the precedence constraints that need to be satisfied
by these activities. It is useful at this stage to view a
graphical representation of the project network.
In order to draw the network, you specify the
nodes of the network and the precedence relationships among them.
Consider the software development project that is described
in the "Getting Started" section of Chapter 2, "The CPM Procedure."
The network
data are in the SAS data set SOFTWARE, displayed in Figure 7.1.
The following code produces the network diagram shown in Figure 7.2:
pattern1 v=e c=green; title 'Software Project'; proc netdraw graphics data=software; actnet / act=activity succ=(succesr1 succesr2) pcompress separatearcs; run;
Figure 7.2: Software Project
The procedure determines the placement of the nodes and the routing
of the arcs on the basis of the topological ordering of the nodes
and attempts to produce a compact diagram.
You can control the placement of the
nodes by specifying explicitly the node positions. The
data set SOFTNET, shown
in Figure 7.3, includes the variables _X_ and _Y_, which
specify the desired node coordinates. Note that the precedence
information is conveyed using a single SUCCESSOR variable unlike the
data set SOFTWARE, which contains two SUCCESSOR variables.
|
The following code produces a network diagram (shown in Figure 7.4) with the new node placement:
title2 h=1.5 'Controlled Layout'; proc netdraw graphics data=softnet; actnet / act=activity succ=(succesor) pcompress; run;
Figure 7.4: Software Project: Controlled Layout
|
While the project is in progress, you may want to use the network diagram to show the current status of each activity as well as any other relevant information about each activity. PROC NETDRAW can also be used to produce a time-scaled network diagram using the schedule produced by PROC CPM. The schedule data for the software project described earlier are saved in a data set, INTRO1, which is shown in Figure 7.5.
To produce a time-scaled network diagram, use the TIMESCALE option in the ACTNET statement, as shown in the following program. The MININTERVAL= and the LINEAR options are used to control the time axis on the diagram. The ID=, NOLABEL, and NODEFID options control the amount of information displayed within each node. The resulting diagram is shown in Figure 7.6.
title2 h=1.5 'Time-Scaled Diagram'; proc netdraw graphics data=intro1; actnet / act=activity succ=(succ:) separatearcs pcompress htext=2 timescale linear frame mininterval=week id=(activity duration) nolabel nodefid; run;
Figure 7.6: Software Project: Time-Scaled Network Diagram
Several other options are available to control the layout of the nodes, the appearance of the network, and the format of the time axis. For projects that have natural divisions, you can use the ZONE= option to divide the network into horizontal zones or bands. For networks that have an embedded tree structure, you can use the TREE option to draw the network like a tree laid out from left to right, with the root at the left edge of the diagram; in graphics mode, you can obtain a top-down tree with the root at the top of the diagram. For cyclic networks you can use the BREAKCYCLE option to enable the procedure to break cycles. All of these options are discussed in detail in the following sections.
Copyright © 2008 by SAS Institute Inc., Cary, NC, USA. All rights reserved.