Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
The NETDRAW Procedure

Getting Started

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 5.1.

Software Project
Data Set SOFTWARE

Obs descrpt duration activity succesr1 succesr2
1 Initial Testing 20 TESTING RECODE  
2 Prel. Documentation 15 PRELDOC DOCEDREV QATEST
3 Meet Marketing 1 MEETMKT RECODE  
4 Recoding 5 RECODE DOCEDREV QATEST
5 QA Test Approve 10 QATEST PROD  
6 Doc. Edit and Revise 10 DOCEDREV PROD  
7 Production 1 PROD    

Figure 5.1: Software Project

The following code produces the network diagram shown in Figure 5.2.

   pattern1 v=e c=green;
   title f=swiss 'Software Project';
   proc netdraw graphics data=software;
      actnet / act=activity
               succ=(succesr1 succesr2)
               pcompress separatearcs
               font=swiss;
      run;

ndrovg2.gif (3076 bytes)

Figure 5.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 5.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.

Software Project
Data Set SOFTNET

Obs descrpt duration activity succesor _x_ _y_
1 Initial Testing 20 TESTING RECODE 1 1
2 Meet Marketing 1 MEETMKT RECODE 1 2
3 Prel. Documentation 15 PRELDOC DOCEDREV 1 3
4 Prel. Documentation 15 PRELDOC QATEST 1 3
5 Recoding 5 RECODE DOCEDREV 2 2
6 Recoding 5 RECODE QATEST 2 2
7 QA Test Approve 10 QATEST PROD 3 3
8 Doc. Edit and Revise 10 DOCEDREV PROD 3 1
9 Production 1 PROD   4 2

Figure 5.3: Software Project: Specify Node Positions

The following code produces a network diagram (shown in Figure 5.4) with the new node placement.

   title2 h=1.5 f=swiss 'Controlled Layout';
   proc netdraw graphics data=softnet;
      actnet / act=activity
               succ=(succesor)
               pcompress
               font=swiss;
      run;

ndrovg4.gif (3224 bytes)

Figure 5.4: Software Project: Controlled Layout

Software Project
Project Schedule

descrpt activity succesr1 succesr2 duration E_START E_FINISH L_START L_FINISH T_FLOAT F_FLOAT
Initial Testing TESTING RECODE   20 01MAR92 20MAR92 01MAR92 20MAR92 0 0
Prel. Documentation PRELDOC DOCEDREV QATEST 15 01MAR92 15MAR92 11MAR92 25MAR92 10 10
Meet Marketing MEETMKT RECODE   1 01MAR92 01MAR92 20MAR92 20MAR92 19 19
Recoding RECODE DOCEDREV QATEST 5 21MAR92 25MAR92 21MAR92 25MAR92 0 0
QA Test Approve QATEST PROD   10 26MAR92 04APR92 26MAR92 04APR92 0 0
Doc. Edit and Revise DOCEDREV PROD   10 26MAR92 04APR92 26MAR92 04APR92 0 0
Production PROD     1 05APR92 05APR92 05APR92 05APR92 0 0

Figure 5.5: Software Project Schedule

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 5.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 5.6.

   title2 h=1.5 f=swiss 'Time-Scaled Diagram';
   proc netdraw graphics data=intro1;
      actnet / act=activity succ=(succ:)
               separatearcs pcompress font=swiss htext=2
               timescale linear frame mininterval=week
               id=(activity duration) nolabel nodefid;
      run;

ndrovg6.gif (4634 bytes)

Figure 5.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 allow the procedure to break cycles. All of these options are discussed in detail in the following sections.

Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Top
Top

Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.