The NETDRAW procedure draws a network diagram of the activities in a project. Boxes (or nodes) are used to represent the activities, and lines (or arcs) are used to show the precedence relationships among the activities. Though the description of the procedure is written using project management terminology, PROC NETDRAW can be used to draw any network such as an organizational chart or a software flow diagram. The only information required by the procedure for drawing such a diagram is the name of each activity in the project (or node in the network) and a list of all its immediate successor activities (or nodes connected to it by arcs). Note that project networks are acyclic. However, the procedure can also be used to draw cyclic networks by specifying explicitly the coordinates for the nodes or by requesting the procedure to break the cycles in an arbitrary fashion.
The ACTNET statement in the NETDRAW procedure is designed to draw activity networks that represent a project in Activity-On-Node (AON) format. All network information is contained in SAS data sets. The input data sets used by PROC NETDRAW and the output data set produced by the procedure are as follows:
The Network input data set contains the precedence information, namely, the activity-successor information for all the nodes in the network. This data set can be an Activity data set that is used as input to the CPM procedure or a Schedule data set that is produced by the CPM procedure, or it can even be a Layout data set produced by the NETDRAW procedure. The minimum amount of information that is required by PROC NETDRAW is the activity-successor information that can be obtained from any one of the preceding three possible types of data sets. The additional information in the input data set can be used by the procedure to add detail to the nodes in the diagram, and, in the case of the Layout data set, the procedure can use the _X_ and _Y_ variables to lay out the nodes and arcs of the diagram.
The Annotate input data set contains the graphics and text that are to be annotated on the network diagram. This data set is used by the procedure through the Annotate facility in SAS/GRAPH software.
The Layout output data set produced by PROC NETDRAW contains all the information about the layout of the network. For each node in the network, the procedure saves the coordinates; for each arc between each pair of nodes, the procedure saves the coordinates of each turning point of the arc in a separate observation. Using these values, the procedure can draw the network diagram without recomputing node placement and arc routing.
Two issues arise in drawing and displaying a network diagram: the layout of the diagram and the format of the display. The layout of the diagram consists of placing the nodes of the network and routing the arcs of the network in an appropriate manner. The format of the display includes the size of the nodes, the distance between nodes, the color of the nodes and arcs, and the information that is placed within each node. Several options available in the ACTNET statement enable you to control the format of the display and the layout of the diagram; these options and their uses are explained in detail later in this chapter.
Following is a list of some of the key aspects of the procedure:
The Network input data set specifies the activities (or nodes) in the network and their immediate successors. The amount of information displayed within each node can be controlled by the ID= option and by the use of default variables in the data set.
The procedure uses the node-successor information to determine the placement of the nodes and the layout of the arcs connecting the nodes.
By default, PROC NETDRAW uses the topological ordering of the activity network to determine the coordinates of the nodes. In a time-based network diagram, the nodes can be ordered according to any numeric, SAS date, time, or datetime variable (the ALIGN= variable) in the input data set.
The network does not have to represent a project. You can use PROC NETDRAW to draw any network. If the network has no cycles, then the procedure bases the node placement and arc routing on the precedence relationships. Alternately, you can specify explicitly the node positions or use the ALIGN= variable, and let the procedure determine the arc routing.
To draw networks with cycles, use the BREAKCYCLE option. Alternately, you can use the ALIGN= option or specify the node positions so that the procedure needs only to determine the arc routing. See Example 9.12 for an illustration of a cyclic network.
The ZONE= option enables you to divide the network into horizontal bands or zones. This is useful in grouping the activities of the project according to some appropriate classification.
The TREE option instructs PROC NETDRAW to check if the network is indeed a tree, and, if so, to exploit the tree structure in the node layout. This feature is useful for drawing organizational charts, hierarchical charts, and work break-down structures.
PROC NETDRAW gives you the option of displaying the network diagram in one of three modes: graphics, line-printer, or full-screen. The default mode is graphics mode, which enables you to produce charts of high resolution quality. Graphics mode requires SAS/GRAPH software. See the section Graphics Options for more information about producing high-resolution quality network diagrams. You can also produce line-printer quality network diagrams by specifying the LINEPRINTER (LP) option in the PROC NETDRAW statement. In addition to sending the output to either a plotter or printer, you can view the network diagram at the terminal in full-screen mode by specifying the FULLSCREEN (FS) option in the PROC NETDRAW statement. See the section Full-Screen Options for more information about viewing network diagrams in full-screen mode.
The full-screen version of the procedure enables you to move the nodes around on the screen (subject to maintaining the precedence order of the activities) and thus change the layout of the network diagram.
The graphics version of the procedure enables you to annotate the network diagram using the Annotate facility in SAS/GRAPH software.
The positions of the nodes and arcs of the layout determined by PROC NETDRAW are saved in an output data set called the Layout data set. This data set can be used again as input to PROC NETDRAW; using such a data set saves some processing time because the procedure does not need to determine the node and arc placement.
If necessary, the procedure draws the network across page boundaries. The number of pages that are used depends on the number of print positions that are available in the horizontal and vertical directions.
In graphics mode, the COMPRESS and PCOMPRESS options enable you to produce the network on one page. You can also control the number of pages used to create the network diagram with the HPAGES= and VPAGES= options.
In graphics mode, the ROTATE and ROTATETEXT options enable you to produce a top-down tree diagram.