Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
The NETDRAW Procedure

Example 5.8: PATTERN and SHOWSTATUS Options

As a project progresses, in addition to the criticality of the activities, you may also want to display the status of the activity: whether it is in progress, has been completed, or is still to be scheduled. The SHOWSTATUS option in the ACTNET statement displays this additional information. In the current example, the same progress data as shown in Example 2.13 in Chapter 2, "The CPM Procedure," are used to illustrate the SHOWSTATUS option. The following program shows the necessary code. First, PROC CPM schedules the project with the SHOWFLOAT option; this allows activities that are already in progress or completed also to show non zero float. Following this, a DATA step sets the variable style to `3' for activities that are completed or in progress; the remaining activities have missing values for this variable.

PROC NETDRAW is then invoked with the SHOWSTATUS option, which draws two diagonal lines across nodes referring to completed activities and one diagonal line for in-progress activities. The PATTERN= option in the ACTNET statement identifies the variable style containing the pattern information. Thus, the third pattern statement is used for in-progress or completed activities; the other activities (which have missing values for the variable style) use the second or the first pattern statement according to whether or not they are critical. However, since the first two PATTERN statements have EMPTY fill patterns specified, the nodes representing activities that have not yet started are in fact colored on the basis of the COUTLINE= and CCRITOUT= options. The resulting network diagram is shown in Output 5.8.1.

   data holidays;
      format holiday holifin date7.;
      input holiday date8. holifin date8. holidur;
      datalines;
   25dec91 27dec91 4
   01jan92 .       .
   ;

   * actual schedule at timenow = 20dec91;
   data actual;
      input task $ 1-12 sdate date9. fdate date9. pctc rdur;
      format sdate date9. fdate date9.;
      datalines;
   Approve Plan  02dec91 06dec91  .    .
   Drawings      07dec91 17dec91  .    .
   Anal. Market  06dec91 .        100  .
   Write Specs   08dec91 13dec91  .    .
   Prototype     .       .        .    .
   Mkt. Strat.   11dec91 .        .    3
   Materials     .       .        .    .
   Facility      .       .        .    .
   Init. Prod.   .       .        .    .
   Evaluate      .       .        .    .
   Test Market   .       .        .    .
   Changes       .       .        .    .
   Production    .       .        .    .
   Marketing     .       .        .    .
   ;
   * merge the predicted information with network data;
   data widgact;
      merge  actual widget;
      run;

   * estimate schedule based on actual data;
   proc cpm data=widgact holidata=holidays
            out=widgupd date='2dec91'd;
      activity task;
      succ     succ1 succ2 succ3;
      duration days;
      holiday  holiday / holifin=(holifin);
      actual / as=sdate af=fdate timenow='20dec91'd
               remdur=rdur pctcomp=pctc showfloat;
      run;

   /* Set patterns for activities that have started */
   data netin;
      set widgupd;
      if a_start ^= . then style = 3;
      run;

   goptions hpos=120 vpos=70 border;
   pattern1 c=green  v=e;
   pattern2 c=red    v=e;
   pattern3 c=ltgray v=s;

   title  j=l f=swissb h=3 ' Project: Widget Manufacture';
   title2 j=l f=swissb h=3 ' Date: December 20, 1991';
   footnote1 j=l f=swissb h=1.5 '  Activity';
   footnote2 j=l f=swissb h=1.5 '  Start';
   footnote3 j=l f=swissb h=1.5 '  Finish' 
             j=r f=swissb h=1.5 'PATTERN and SHOWSTATUS Options  ';
   proc netdraw data=netin graphics;
      actnet / act=task
               succ=(succ1 succ2 succ3)
               ybetween = 10
               separatearcs
               pcompress
               font=swiss
               id=(task e_start e_finish)
               nodefid nolabel
               carcs=cyan
               ccritarcs=red
               coutline = green
               ccritout = red
               showstatus
               pattern = style
               htext=2
               ;
      run;

Output 5.8.1: PATTERN and SHOWSTATUS Options
ndr8g1.gif (6176 bytes)

Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Top
Top

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