Or Ug Proj 7310
Or Ug Proj 7310
and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS
Institute Inc. in the USA and other countries. indicates USA registration.
Other brand and product names are trademarks of their respective companies.
Contents
Whats New in SAS/OR 9 and 9.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Using This Book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Chapter 1. Introduction to Project Management . . . . . . . . . . . . . . . . . . . . . . 15
Chapter 2. The CPM Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Chapter 3. The DTREE Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303
Chapter 4. The GANTT Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . 407
Chapter 5. The NETDRAW Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . 581
Chapter 6. The PM Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 693
Chapter 7. The Projman Application . . . . . . . . . . . . . . . . . . . . . . . . . . . 747
Appendix A. Glossary of Project Management Terms . . . . . . . . . . . . . . . . . . 819
Subject Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 835
Syntax Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 859
iv
Acknowledgments
Credits
Documentation
Writing Gehan A. Corea, Charles B. Kelly, Radhika V. Kulkarni,
Michelle Opp, Tien-yi D. Shaw
Editing Virginia Clark, Donna Sawyer
Documentation Support Tim Arnold, Michelle Opp
Technical Review Marc-david Cohen, Phil Gibbs, Tao Huang, Edward P.
Hughes, John Jasperse, Charles B. Kelly, Michelle Opp,
Bengt Pederson, Rob Pratt, Marianne Bohinski, Donna
Fulenwider, Barbara J. Hoopes
Software
The procedures in SAS/OR software were implemented by the Operations Research
and Development Department. Substantial support was given to the project by
other members of the Analytical Solutions Division. Core Development Division,
Display Products Division, Graphics Division, and the Host Systems Division also
contributed to this product.
In the following list, the names of the developers currently supporting the procedure
are listed rst. Other developers previously worked on the procedure.
CPM Radhika V. Kulkarni, Marc-david Cohen
DTREE Tien-yi D. Shaw
GANTT Gehan A. Corea, Radhika V. Kulkarni
NETDRAW Radhika V. Kulkarni
PM Gehan A. Corea, Radhika V. Kulkarni
PROJMAN Charles B. Kelly, Marc-david Cohen
Support Groups
Software Testing Tao Huang, John Jasperse, Bengt Pederson, Rob Pratt,
Nitin Agarwal, Marianne Bohinski, Edward P. Hughes,
Charles B. Kelly, Tugrul Sanli
Technical Support Tonya Chapman
vi
Acknowledgments
Many people have been instrumental in the development of SAS/OR software. The
individuals acknowledged here have been especially helpful.
Lance Broad New Zealand Ministry of Forestry
Richard Brockmeier Union Electric Company
Ken Cruthers Goodyear Tire & Rubber Company
Patricia Duffy Auburn University
Richard A. Ehrhardt University of North Carolina at Greensboro
Paul Hardy Babcock & Wilcox
Don Henderson ORI Consulting Group
Dave Jennings Lockheed Martin
Vidyadhar G. Kulkarni University of North Carolina at Chapel Hill
Wayne Maruska Basin Electric Power Cooperative
Bruce Reed Auburn University
Charles Rissmiller Lockheed Martin
David Rubin University of North Carolina at Chapel Hill
John Stone North Carolina State University
Keith R. Weiss ICI Americas Inc.
The nal responsibility for the SAS System lies with SAS Institute alone. We hope
that you will always let us know your opinions about the SAS System and its doc-
umentation. It is through your participation that SAS software is continuously im-
proved.
vii
viii
Acknowledgments
Whats New in SAS/OR 9 and 9.1
Contents
OVERVIEW . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
THE BOM PROCEDURE . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
THE CLP PROCEDURE (EXPERIMENTAL) . . . . . . . . . . . . . . . . 4
THE CPM PROCEDURE . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
THE GA PROCEDURE (EXPERIMENTAL) . . . . . . . . . . . . . . . . . 4
THE GANTT PROCEDURE . . . . . . . . . . . . . . . . . . . . . . . . . . 5
THE LP PROCEDURE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
THE PM PROCEDURE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
THE QP PROCEDURE (EXPERIMENTAL) . . . . . . . . . . . . . . . . . 5
BILL OF MATERIAL POST PROCESSING MACROS . . . . . . . . . . . 5
2
Whats New in SAS/OR 9 and 9.1
Whats New in SAS/OR 9 and 9.1
Overview
SAS/OR software contains several new and enhanced features since SAS 8.2. Brief
descriptions of the new features appear in the following sections. For more informa-
tion, refer to the SAS/OR documentation, which is now available in the following six
volumes:
SAS/OR Users Guide: Bills of Material Processing
SAS/OR Users Guide: Constraint Programming
SAS/OR Users Guide: Local Search Optimization
SAS/OR Users Guide: Mathematical Programming
SAS/OR Users Guide: Project Management
SAS/OR Users Guide: The QSIM Application
The online help can also be found under the corresponding classication.
The BOM Procedure
The BOM procedure in SAS/OR Users Guide: Bills of Material Processing was in-
troduced in Version 8.2 of the SAS System to perform bill of material processing.
Several new features have been added to the procedure, enabling it to read all product
structure records from a product structure data le and all part master records from
a part master le, and compose the combined information into indented bills of mate-
rial. This data structure mirrors the most common method for storing bill-of-material
data in enterprise settings; the part master le contains data on each part while the
product structure le holds data describing the various part-component relationships
represented in bills of material.
The PMDATA= option on the PROC BOM statement enables you to specify the name
of the Part Master data set. If you do not specify this option, PROC BOM uses the
Product Structure data set (as specied in the DATA= option) as the Part Master
data set. The BOM procedure now looks up the Part, LeadTime, Requirement,
QtyOnHand, and ID variables in the Part Master data set. On the other hand, the
Component and Quantity variables remain in the Product Structure data set.
You can use the NRELATIONSHIPS= (or NRELTS=) option to specify the number
of parent-component relationships in the Product Structure data set. You have greater
control over the handling of redundant relationships in the Product Structure data set
using the DUPLICATE= option.
4
Whats New in SAS/OR 9 and 9.1
Several options have been added to the STRUCTURE statement enabling you to spec-
ify information related to the parent-component relationships. In particular, the vari-
able specied with the PARENT= option identies the parent item, while the vari-
ables listed in the LTOFFSET= option specify lead-time offset information. You can
also specify variables identifying scrap factor information for all parent-component
relationships using the SFACTOR= option. The RID= option identies all variables
in the Product Structure data set that are to be included in the Indented BOM output
data set.
The CLP Procedure (Experimental)
The new CLP procedure in SAS/OR Users Guide: Constraint Programming is an 9.1
experimental nite domain constraint programming solver for solving constraint sat-
isfaction problems (CSPs) with linear, logical, global, and scheduling constraints.
In addition to having an expressive syntax for representing CSPs, the solver fea-
tures powerful built-in consistency routines and constraint propagation algorithms,
a choice of nondeterministic search strategies, and controls for guiding the search
mechanism that enable you to solve a diverse array of combinatorial problems.
The CPM Procedure
The CPM procedure in SAS/OR Users Guide: Project Management adds more op-
tions for describing resource consumption by activities, enhancing its applicability to
production scheduling models.
A new keyword, RESUSAGE, has been added to the list of values for the OBSTYPE
variable in the Resource data set. This keyword enables you to specify whether a
resource is consumed at the beginning or at the end of a given activity.
The MILESTONERESOURCE option enables you to specify a nonzero usage of
consumable resources for milestone activities. For example, this option is useful if
you wish to designate specic milestones to be the points of payment for a subcon-
tractor. The MILESTONENORESOURCE option is the current default behavior of
the CPM procedure, which indicates that all resource requirements are to be ignored
for milestone activities.
The GA Procedure (Experimental)
The new GA procedure in SAS/OR Users Guide: Local Search Optimization fa- 9.1
cilitates the application of genetic algorithms to general optimization. Genetic al-
gorithms adapt the biological processes of natural selection and evolution to search
for optimal solutions. The procedure can be applied to optimize problems involv-
ing integer, continuous, binary, or combinatorial variables. The GA procedure is
especially useful for nding optima for problems where the objective function may
have discontinuities or may not otherwise be suitable for optimization by traditional
calculus-based methods.
Bill of Material Post Processing Macros
5
The GANTT Procedure
The GANTT procedure in SAS/OR Users Guide: Project Management includes a
new option for controlling the width of the Gantt chart. The CHARTWIDTH= option
species the width of the axis area as a percentage of the total Gantt chart width.
This option enables you to generate Gantt charts that are consistent in appearance,
independent of the total time spanned by the project.
The LP Procedure
The performances of primal and dual simplex algorithms in the LP procedure
(SAS/OR Users Guide: Mathematical Programming) have been signicantly im-
proved on large scale linear or mixed integer programming problems.
The PM Procedure
The new options added to the CPM procedure are also available with PROC PM.
The QP Procedure (Experimental)
The new QP procedure in SAS/OR Users Guide: Mathematical Programming im- 9.1
plements a primal-dual predictor-corrector interior-point algorithm for large sparse
quadratic programs. Depending on the distribution of the eigenvalues of the Hessian
matrix, H, two main classes of quadratic programs are distinguished (assuming min-
imization):
convex: H is positive semi-denite
nonconvex: H has at least one negative eigenvalue
Diagonal and nonseparable Hessian matrices are recognized and handled automati-
cally.
Bill of Material Post Processing Macros
Several macros enable users to generate miscellaneous reports using the Indented
BOM output data set from the BOM procedure in SAS/OR Users Guide: Bills of
Material Processing. Other transactional macros perform specialized transactions
for maintaining and updating the bills of material for a product, product line, plant,
or company.
6
Whats New in SAS/OR 9 and 9.1
Using This Book
Contents
PURPOSE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
ORGANIZATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
TYPOGRAPHICAL CONVENTIONS . . . . . . . . . . . . . . . . . . . . 10
CONVENTIONS FOR EXAMPLES . . . . . . . . . . . . . . . . . . . . . . 11
Additional Graphics Options by Procedure . . . . . . . . . . . . . . . . . . 12
ACCESSING THE SAS/OR SAMPLE LIBRARY . . . . . . . . . . . . . . 13
ONLINE HELP SYSTEM AND UPDATES . . . . . . . . . . . . . . . . . . 13
ADDITIONAL DOCUMENTATION FOR SAS/OR SOFTWARE . . . . . 14
8
Using This Book
Using This Book
Purpose
SAS/OR Users Guide: Project Management provides a complete reference for the
project management procedures in SAS/OR software. This book serves as the pri-
mary documentation for the CPM, DTREE, GANTT, NETDRAW, and PM proce-
dures and the Projman application.
Using This Book describes the organization of this book and the conventions used
in the text and example code. To gain full benet from using this book, you should
familiarize yourself with the information presented in this section and refer to it when
needed. Additional Documentation at the end of this section provides references to
other books that contain information on related topics.
Organization
Chapter 1 contains a brief overview of the project management procedures in
SAS/OR software and provides an introduction to project management methodology
and the use of the project management tools in the SAS System. The rst chapter
also describes the ow of data between the procedures and how the components of
the SAS System t together.
After the introductory chapter, the next ve chapters describe the CPM, DTREE,
GANTT, NETDRAW, and PM procedures. Each procedure description is self-
contained; you need to be familiar with only the basic features of the SAS System
and SAS terminology to use most procedures. The statements and syntax necessary
to run each procedure are presented in a uniform format throughout this book.
The following list summarizes the types of information provided for each procedure:
Overview provides a general description of what the procedure does.
It outlines major capabilities of the procedure and lists all
input and output data sets that are used with it.
Getting Started illustrates simple uses of the procedure using a few short
examples. It provides introductory hands-on information
for the procedure.
10
Using This Book
Syntax constitutes the major reference section for the syntax of
the procedure. First, the statement syntax is summa-
rized. Next, functional summary tables list all the state-
ments and options in the procedure, classied by function.
In addition, the online version includes a Dictionary of
Options, which provides an alphabetical list of all options.
Following these tables, the PROC statement is described,
and then all other statements are described in alphabet-
ical order. The mode-specic options (line-printer, full-
screen, and graphics options) for the DTREE, GANTT,
and NETDRAW procedures are described alphabetically
under appropriate subheadings.
Details describes the features of the procedure, including algorith-
mic details and computational methods. It also explains
how the various options interact with each other. This sec-
tion describes input and output data sets in greater detail,
with denitions of the output variables, and explains the
format of printed output, if any.
Examples consists of examples designed to illustrate the use of the
procedure. Each example includes a description of the
problem and lists the options highlighted by the exam-
ple. The example shows the data and the SAS state-
ments needed, and includes the output produced. You
can duplicate the examples by copying the statements and
data and running the SAS program. The SAS Sample
Library contains the code used to run the examples shown
in this book; consult your SAS Software representative
for specic information about the Sample Library. Cross-
reference tables in each chapter list all the options and
statements illustrated by the different examples in that
chapter.
References lists references that are relevant to the chapter.
Typographical Conventions
The printed version of SAS/OR Users Guide: Project Management uses various type
styles, as explained by the following list:
roman is the standard type style used for most text.
Conventions for Examples
11
UPPERCASE ROMAN is used for SAS statements, options, and other SAS lan-
guage elements when they appear in the text. However,
you can enter these elements in your own SAS code in
lowercase, uppercase, or a mixture of the two. This style
is also used for identifying arguments and values (in the
Syntax specications) that are literals (for example, to de-
note valid keywords for a specic option).
UPPERCASE BOLD is used in the Syntax section to identify SAS keywords,
such as the names of procedures, statements, and options.
bold is used in the Syntax section to identify options. In the
chapters for PROC PM and PROJMAN, bold is also used
to identify menu items and dialog boxes.
helvetica is used for the names of SAS variables and data sets when
they appear in the text.
oblique is used for user-supplied values for options (for example,
INTERVAL= interval).
italic is used for terms that are dened in the text, for emphasis,
and for references to publications.
monospace is used to show examples of SAS statements. In most
cases, this book uses lowercase type for SAS code. You
can enter your own SAS code in lowercase, uppercase, or
a mixture of the two. This style is also used for values of
character variables when they appear in the text.
Conventions for Examples
Most of the output shown in this book is produced with the following SAS System
options:
options linesize=80 pagesize=60 nonumber nodate;
In addition, most of the graphics output shown in this book is produced with the
following options:
Printed Version
goptions hpos=80 vpos=32;
Online Version
goptions hpos=80 vpos=32 ypixels=800;
The remaining graphics options used in this book depend on the type of output, as
well as the procedure used to create the output. The general options for half-page
portrait, full-page portrait, and full-page landscape output are as follows:
12
Using This Book
Half-page Portrait
goptions hsize=5.75 in vsize=4.0 in;
Full-page Portrait
goptions hsize=5.75 in vsize=8.0 in;
Full-page Landscape
goptions hsize=8.0 in vsize=5.75 in
border rotate=landscape;
Additional Graphics Options by Procedure
GANTT Procedure
The following PATTERN statements are used to create the online (color) output from
PROC GANTT.
pattern1 c=green v=s;
pattern2 c=green v=e;
pattern3 c=red v=s;
pattern4 c=magenta v=e;
pattern5 c=magenta v=s;
pattern6 c=cyan v=s;
pattern7 c=black v=e;
pattern8 c=blue v=s;
pattern9 c=brown v=s;
The following PATTERN statements are used to create the black-and-white output
from PROC GANTT, which appears in the printed version of the manual.
pattern1 v=x1 c=black;
pattern2 v=l1 c=black;
pattern3 v=s c=black;
pattern4 v=r1 c=black;
pattern5 v=x2 c=black;
pattern6 v=x4 c=black;
pattern7 v=e c=black;
pattern8 v=x3 c=black;
pattern9 v=l2 c=black;
NETDRAW Procedure
The following GOPTIONS and PATTERN statements are used to create the online
(color) output from PROC NETDRAW.
goptions cback=ligr;
pattern1 v=e c=green;
pattern2 v=e c=red;
pattern3 v=e c=magenta;
pattern4 v=e c=blue;
pattern5 v=e c=cyan;
Online Help System and Updates
13
The following GOPTIONS and PATTERN statements are used to create the black-
and-white output from PROC NETDRAW, which appears in the printed version of
the manual.
pattern1 c=black v=e r=5;
DTREE Procedure
The following GOPTIONS statement is used to create the online (color) output from
PROC DTREE.
goptions cback=ligr ctext=black ftext=swissu;
The following GOPTIONS statement is used to create the black-and-white output
from PROC DTREE, which appears in the printed version of the manual.
goptions ftext=swissu;
Accessing the SAS/OR Sample Library
The SAS/OR sample library includes many examples that illustrate the use of
SAS/OR software, including the examples used in this documentation. To access
these sample programs, select Learning to Use SAS->Sample SAS Programs from
the SAS Help and Documentation window, and then select SAS/OR from the list
of available topics.
Online Help System and Updates
You can access online help information about SAS/OR software in two ways, de-
pending on whether you are using the SAS windowing environment in the command
line mode or the pull-down menu mode.
If you are using a command line, you can access the SAS/OR help menus by typing
help or on the command line. If you are using the pull-down menus, you can select
SAS Help and Documentation->SAS Products fromthe Help pull-down menu, and
then select SAS/OR from the list of available topics.
14
Using This Book
Additional Documentation for SAS/OR Software
In addition to SAS/OR Users Guide: Project Management, you may nd these other
documents helpful when using SAS/OR software:
SAS/OR Users Guide: Bills of Material Processing
provides documentation for the BOM procedure and all bill-of-material post-
processing SAS macros. The BOM procedure and SAS macros provide the ability to
generate different reports and to perform several transactions to maintain and update
bills of material.
SAS/OR Users Guide: Constraint Programming
provides documentation for the constraint programming procedure in SAS/OR soft-
ware. This book serves as the primary documentation for the CLP procedure, an
experimental procedure new to SAS/OR software.
SAS/OR Users Guide: Local Search Optimization
provides documentation for the local search optimization procedure in SAS/OR soft-
ware. This book serves as the primary documentation for the GA procedure, an
experimental procedure that uses genetic algorithms to solve optimization problems.
SAS/OR Users Guide: Mathematical Programming
provides documentation for the mathematical programming procedures in SAS/OR
software. This book serves as the primary documentation for optimization proce-
dures, such as the ASSIGN, LP, INTPOINT, NETFLOW, NLP, and TRANS proce-
dures, and the new procedure, QP, for solving quadratic programming problems.
SAS/OR Users Guide: The QSIM Application
provides documentation for the QSIMApplication, which is used to build and analyze
models of queueing systems using discrete event simulation. This book shows you
how to build models using the simple point-and-click graphical user interface; how
to run the models; and how to collect and analyze the sample data to give you insight
into the behavior of the system.
SAS/OR Software: Project Management Examples, Version 6
contains a series of examples that illustrate how to use SAS/OR software to man-
age projects. Each chapter contains a complete project management scenario and
describes how to use PROC GANTT, PROC CPM, and PROC NETDRAW, in addi-
tion to other reporting and graphing procedures in the SAS System, to perform the
necessary project management tasks.
SAS/IRP Users Guide: Inventory Replenishment Planning
provides documentation for SAS/IRP software. This book serves as the primary doc-
umentation for the IRP procedure for determining replenishment policies, as well as
the %IRPSIM SAS programming macro for simulating replenishment policies.
Chapter 1
Introduction to Project Management
Chapter Contents
OVERVIEW . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
DATA FLOW . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
The CPM Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
The GANTT Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
The NETDRAW Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . 20
The PM Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Communication between Procedures . . . . . . . . . . . . . . . . . . . . . 23
DECISION SUPPORT SYSTEMS . . . . . . . . . . . . . . . . . . . . . . . 24
DECISION ANALYSIS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
The DTREE Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
EXAMPLES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Example 1.1. Project Denition . . . . . . . . . . . . . . . . . . . . . . . . 26
Example 1.2. Work Breakdown Structure . . . . . . . . . . . . . . . . . . . 29
Example 1.3. Project Scheduling and Reporting . . . . . . . . . . . . . . . 30
Example 1.4. Summary Report . . . . . . . . . . . . . . . . . . . . . . . . 32
Example 1.5. Resource-Constrained Scheduling . . . . . . . . . . . . . . . 34
Example 1.6. Multiple Projects . . . . . . . . . . . . . . . . . . . . . . . . 38
Example 1.7. Sequential Scheduling of Projects . . . . . . . . . . . . . . . 47
Example 1.8. Project Cost Control . . . . . . . . . . . . . . . . . . . . . . 49
Example 1.9. Subcontracting Decisions . . . . . . . . . . . . . . . . . . . . 57
PROJECT MANAGEMENT SYSTEMS . . . . . . . . . . . . . . . . . . . 60
THE PROJMAN APPLICATION . . . . . . . . . . . . . . . . . . . . . . . 61
WEB-BASED SCHEDULING SYSTEMS . . . . . . . . . . . . . . . . . . . 61
MICROSOFT PROJECT CONVERSION MACROS . . . . . . . . . . . . 62
REFERENCES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
16
Chapter 1. Introduction to Project Management
Chapter 1
Introduction to Project Management
Overview
This chapter briey describes how you can use SAS/OR software for managing your
projects. This chapter is not meant to dene all the concepts of project management;
several textbooks on project management explain the basic steps involved in dening,
planning, and managing projects (for example, Moder, Phillips, and Davis 1983).
Briey, a project is dened as any task comprising a set of smaller tasks that need to
be performed, either sequentially or in parallel. Projects can be small and last only
a few minutes (for instance, running a set of small computer programs), or they can
be mammoth and run for several years (for example, the construction of the Channel
Tunnel).
SAS/OR software has four procedures that can be used for planning, controlling, and
monitoring projects: the CPM and PM procedures for scheduling project activities
subject to precedence, time, and resource constraints; the GANTT procedure for dis-
playing the computed schedule; and the NETDRAW procedure for displaying the
activity network. These procedures integrate with the SAS System so that you can
easily develop a customized project management system. The Projman application,
a user-friendly graphical user interface included as part of SAS/OR software, is one
such system.
This chapter gives a brief introduction to the CPM, GANTT, NETDRAW, and PM
procedures and shows how you can use the SAS System for project management.
In addition to these four procedures and the Projman application, which are the major
tools for the traditional functions associated with project management, SAS/OR soft-
ware also contains a procedure for decision analysis, the DTREE procedure. Decision
analysis is a tool that attempts to provide an analytic basis for management decisions
under uncertainty. It can be used effectively as an integral part of project manage-
ment methods. A brief introduction to PROC DTREE is provided in the Decision
Analysis section on page 24.
Data Flow
This section provides an overview of how project information is stored in the
SAS System in data sets and how these data sets are used by the CPM, GANTT,
NETDRAW, and PM procedures. Maintaining the project information in SAS data
sets enables you to merge project information easily from several sources, summa-
rize information, subset project data, and perform a wide variety of other operations
using any of the many procedures in SAS software. Each of the SAS/OR procedures
also denes a SAS macro variable that contains a character string indicating whether
18
Chapter 1. Introduction to Project Management
or not the procedure terminated successfully. This information is useful when the
procedure is one of the steps in a larger program.
The CPM Procedure
PROC CPM does the project scheduling and forms the core of the project man-
agement functionality in SAS/OR software. It uses activity precedence, time, and
resource constraints, and holiday and calendar information to determine a feasible
schedule for the project. The precedence constraints between the activities are de-
scribed using a network representation, either in Activity-On-Arc (AOA) or Activity-
On-Node (AON) notation, and input to PROC CPM in an Activity data set. The
two different representations are described in Chapter 2, The CPM Procedure. The
Activity data set can also specify time constraints on the activities and resource re-
quirement information. The Activity data set is required. Resource availability infor-
mation can be specied using another data set, referred to here as the Resource data
set. Holiday, workday, and other calendar information is contained in the Holiday,
Workday, and Calendar data sets; each of these data sets is described in detail in
Chapter 2, The CPM Procedure. The schedule calculated by PROC CPM using all
the input information and any special scheduling options is saved in an output data
set, referred to as the Schedule data set. For projects that use resources, individual
resource schedules for each activity can be saved in a Resource Schedule output data
set. Resource usage information can also be saved in another output data set, referred
to as the Usage data set. Figure 1.1 illustrates all the input and output data sets that are
possible with PROC CPM. In the same gure,
ORCPM
ORCPM
?
Figure 1.1. Input and Output Data Flow in PROC CPM
The three output data sets produced by PROC CPM contain all the information about
the schedule and the resource usage; these data sets can be used as input to either
PROC GANTT or PROC NETDRAW or to any of the several reporting, charting, or
plotting procedures in the SAS System.
The GANTT Procedure
19
The Schedule data set can also contain additional project information such as project
ID, department and phase information, accounting categories, and so on, in the form
of ID variables passed to it from the Activity input data set with the ID statement.
These variables can be used to produce customized reports by reordering, subsetting,
summarizing, or condensing the information in the Schedule data set in various ways.
The GANTT Procedure
PROC GANTT draws, in line-printer, high-resolution graphics, or full-screen mode,
a bar chart of the schedules computed by PROC CPM. Such a bar chart is referred
to as a Gantt chart in project management terminology. In addition to the Schedule
data set, PROC GANTT can also use the Calendar, Workday, and Holiday data sets
(that were used by PROC CPM when scheduling the activities in the project) to mark
holidays and weekends and other nonwork periods appropriately on the Gantt chart.
You can indicate target dates, deadlines, and other important dates on a Gantt chart
by adding CHART variables to the Schedule data set. Furthermore, the GANTT
procedure can indicate milestones on the chart by using a DURATION variable in
the Schedule data set.
Precedence information can be used by PROC GANTT in either Activity-on-Node or
Activity-on-Arc format to produce a Logic bar chart that shows the precedence rela-
tionships between the activities. The precedence information, required for drawing
the network logic, can be conveyed to PROC GANTT using the Activity data set or a
Logic data set, as described in Chapter 4, The GANTT Procedure.
The Gantt procedure also supports an automatic text annotation facility, using the
Label data set, which is designed specically for labeling Gantt charts independently
of the SAS/GRAPH Annotate facility. The specications in this data set enable you
to print label strings with a minimum of effort and data entry while providing the
capability for more complex chart labeling situations.
The Gantt procedure is Web-enabled. The HTML= option enables you to specify a
variable in the Schedule data set that denes a URL for each activity. If you route the
Gantt chart to an HTML le using the Output Delivery System, then you can click on
a schedule bar and browse text or other descriptive information about the associated
activity. You also use this information to create custom HTML les with drill-down
graphs. PROC GANTT also produces an Imagemap data set that contains the outline
coordinates for the schedule bars used in the Gantt chart that can be used to generate
HTML MAP tags.
As with PROC CPM, PROC GANTT also denes a macro variable named
ORGANTT
?
-
-
-
-
HTML output
High Resolution graphics
Full-Screen mode
Line-Printer output
Figure 1.2. Input and Output Data Flow in PROC GANTT
The NETDRAW Procedure
PROC NETDRAW draws project networks. The procedure automatically places the
nodes in the network and draws the arcs connecting them, using the (activity, succes-
sor) relationship as specied by the Network data set described in Chapter 5, The
NETDRAW Procedure. The Network data set, used as input to PROC NETDRAW,
can be an Activity data set, a Schedule data set, or a Layout data set, as described in
Chapter 5. If a Schedule data set, output by PROC CPM, is used as the Network data
set, the network diagram also contains all the schedule times calculated by PROC
CPM. The procedure can draw the diagram in line-printer mode as well as in high-
resolution graphics mode. Further, you can invoke the procedure in full-screen mode,
which enables you to scroll around the network to view different parts of it; in this
mode, you can also modify the layout of the network by moving the nodes of the
network.
By default, PROC NETDRAW uses the topological ordering of the activity network
to determine the X coordinates of the nodes. In a time-based network diagram, the
nodes can be ordered according to any SAS date, time, or datetime variable in the
Network data set. In fact, PROC NETDRAW enables you to align the nodes accord-
ing to any numeric variable in this data set, not just the start and nish times.
You can produce a zoned network diagram by identifying a ZONE variable in the in-
put data set, which divides the network into horizontal bands or zones. This is useful
in grouping the activities of the project according to some appropriate classication.
The NETDRAW procedure also draws tree diagrams. This feature can be used to
draw work breakdown structures or other organizational diagrams (see Example 1.2).
PROC NETDRAW produces an output data set (Layout data set), which contains
the positions of the nodes and the arcs connecting them. This output data set can
also be used as an input data set to PROC NETDRAW; this feature is useful when
the same project network is drawn several times during the course of a project. You
The NETDRAW Procedure
21
may want to see the updated information drawn on the network every week; you can
save computer resources by using the same node placement and arc routing, without
having the procedure recompute it every time. PROC NETDRAW denes the macro
variable
ORNETDR, which contains a character string indicating if the procedure
terminated successfully.
The NETDRAW procedure is also Web-enabled (like PROC GANTT), and it sup-
ports the HTML= and IMAGEMAP= options.
Figure 1.3 illustrates the ow of data in and out of PROC NETDRAW.
activity data
or
schedule data
or
network data
-
network data
imagemap data
-
-
PROC
NETDRAW
ORNETDR
?
-
-
-
-
HTML output
High Resolution graphics
Full-Screen mode
Line-Printer output
Figure 1.3. Input and Output Data Flow in PROC NETDRAW
22
Chapter 1. Introduction to Project Management
The PM Procedure
PROC PM is an interactive procedure that can be used for planning, controlling,
and monitoring a project. The syntax and the scheduling features of PROC PM are
virtually the same as those of PROC CPM; there are a few differences, which are
described in Chapter 6, The PM Procedure. As far as the ow of data is concerned
(see Figure 1.4), the PM procedure supports an additional data set that can be used to
save and restore preferences that control the project view. The scheduling engine used
by the PM procedure is the same as the one used by PROC CPM; the same macro
variable,
ORCPM
ORCPM
?
Figure 1.4. Input and Output Data Flow in PROC PM
Communication between Procedures
23
Communication between Procedures
Figure 1.1, Figure 1.2, Figure 1.3, and Figure 1.4 illustrate the data ow going in and
out of each of the four procedures: CPM, GANTT, NETDRAW, and PM, respectively.
The data sets described in the previous sections store project information and can be
used to communicate project data between the procedures in the SAS System. Figure
1.5 shows a typical sequence of steps in a project management system built around
these procedures.
Data denition:
PROC PM, the
VIEWTABLE window,
other procedures
where you enter data
-
Data manipulation:
sort, merge,
concatenate, other
ways you transform
your data
-
PROC CPM
PROC PM
-
-
schedule data
resource usage data
-
Data manipulation:
sort, merge, subset,
etc.
-
Reporting procedures:
GANTT, NETDRAW, PRINT,
CALENDAR, PLOT, CHART,
GPLOT, GCHART, other
ways you display and
print your data
Figure 1.5. Using the SAS System for Project Management
Of course, this is only one possible scenario of the use of these procedures. In addi-
tion, you may want to use PROC NETDRAW to check the logic of the network dia-
gram before scheduling the project using PROC CPM. Further, the data ow shown
in Figure 1.5 may represent only the rst iteration in a continuous scheme for moni-
toring the progress of a project. As the project progresses, you may update the data
sets, including actual start and nish times for some of the activities, invoke PROC
CPM again, produce updated Gantt charts and network diagrams, and thus continue
monitoring the project.
For example, a project management system designed for scheduling and tracking a
major outage at a power plant may include the steps illustrated in Figure 1.6. In the
sequences of steps illustrated in both these gures, you can use PROC PM to update
most of the activity information using the procedures graphical user interface.
Thus, SAS/OR software provides four different procedures designed for performing
many of the traditional project management tasks; these procedures can be combined
in a variety of ways to build a customized comprehensive project management sys-
24
Chapter 1. Introduction to Project Management
tem. The Examples section beginning on page 26 illustrates several applications of
the procedures in typical project management situations.
Project
denition
using
SAS data sets
-
PROC CPM
to obtain
initial schedule
-
Use GANTT and
NETDRAW to
communicate plans
to all managers
?
Start
outage
-
Daily update
of activity
information
-
PROC CPM
to update
schedule
-
Schedule and
resource
status reports 6
Figure 1.6. Scheduling a Power Plant Outage
Decision Support Systems
In addition to the CPM, GANTT, NETDRAW, and PM procedures, which are the ma-
jor tools for the traditional functions associated with project management, SAS/OR
software has several procedures that can be used to create a many-faceted Decision
Support System. Traditional CPM/PERT techniques form only one part of effective
project management and may be considered as a specialized application of Decision
Support Systems (Williams and Boyd 1990). SAS/OR software contains several
mathematical programming procedures that can be used to design effective systems
for solving inventory control, transportation, network ow, transshipment, product-
mix, cutting stock problems, and so on. These procedures are discussed in detail in
the SAS/OR Users Guide: Mathematical Programming.
Decision analysis is another important tool that is receiving recognition as a compo-
nent of project management. The next section briey describes PROC DTREE and
the role it can play in making important decisions in project management.
Decision Analysis
There are several stages in the course of a project when critical decisions are to be
made regarding the future path that is to be followed. In fact, the most crucial decision
might be to decide at the beginning whether to embark on the project or not. Other
important decisions that could benet from using decision analysis tools may be sub-
contract awarding, subproject termination in a research and development (R&D) en-
vironment, what-if analysis, and so on. Decision analysis techniques can be used
effectively in such situations to help make decisions under uncertainty.
The DTREE Procedure
25
The DTREE Procedure
PROC DTREE interprets a decision problem represented in SAS data sets, nds the
optimal decisions, and plots on a line printer or a graphics device the decision tree
showing the optimal decisions. A decision tree contains two types of nodes: decision
nodes and chance nodes. A decision node represents a stage in the problem where a
decision is to be made that could lead you along different paths through the tree. A
chance node represents a stage in the problem where some uncertain factors result in
one of several possible outcomes, once again leading you to different branches of the
tree, with associated probabilities.
The structure of a decision model is given in the STAGEIN= data set. This data set,
described in detail in Chapter 3, The DTREE Procedure, species the name, type,
and attributes of all outcomes for each stage in your model. This is the only data set
that is required to produce a diagrammatic representation of your decision problem.
To evaluate and analyze your decision model, you need to specify the PROBIN= and
PAYOFFS= data sets. The PROBIN= data set species the conditional probabilities
for every event in your model. The PAYOFFS= data set species the value of each
possible scenario (sequence of outcomes). The objective is to use the information
summarized in these data sets to determine the optimal decision based on some mea-
sure of performance. One common objective is to maximize the expected value of
the return. Figure 1.7 illustrates the data ow for PROC DTREE.
stage data
probability data
payoff data
-
imagemap data
-
PROC
DTREE
-
-
-
HTML output
High Resolution graphics
Line-Printer output
Figure 1.7. Input and Output Data Flow in PROC DTREE
You can use PROC DTREE to display, evaluate, and summarize your decision prob-
lem. The procedure can be used to plot the decision tree in line-printer or graphics
mode. The optimal decisions are highlighted on the output. Further, a summary table
can be displayed listing all paths through the decision tree along with the cumulative
reward and the evaluating values of all alternatives for that path. The summary table
indicates the optimal evaluating value for each path with an asterisk. The procedure
can also perform sensitivity analysis and what-if analysis. A simple decision problem
is described in Example 1.9.
26
Chapter 1. Introduction to Project Management
Examples
In this section, a few simple examples illustrate some of the basic data ow concepts
described in this chapter. More detailed examples of each procedure are provided
in the corresponding chapters and can also be found in SAS/OR Software: Project
Management Examples.
Example 1.1. Project Denition
Suppose you want to prepare and conduct a market survey (Moder, Phillips, and
Davis 1983) to determine the desirability of launching a new product. As a rst step,
you need to identify the steps involved. Make a list of the tasks that need to be
performed and obtain a reasonable estimate of the length of time needed to perform
each task. Further, you need to specify the order in which these tasks can be done.
The following DATA step creates a SAS data set, survey, representing the project.
This Activity data set contains a representation of the Survey project in Activity-On-
Node format; a brief discussion of the two types of representations is given in Chapter
2, The CPM Procedure. The data set contains a variable activity listing the basic
activities (tasks) involved, a variable duration specifying the length of time in days
needed to perform the tasks, and, for each task, the variables succ1succ3, which
indicate the immediate successors. An ID variable is also included to provide a more
informative description of each task. Thus, the activity Plan Survey takes four days.
Once the planning is done, the tasks Hire Personnel and Design Questionnaire can
begin. The Activity data set also contains a variable named phase associating each
activity with a particular phase of the project.
data survey;
format id $20. activity $8. succ1-succ3 $8. phase $9. ;
input id & activity & duration succ1 & succ2 & succ3 & phase $ ;
label phase = Project Phase
id = Description;
datalines;
Plan Survey plan sur 4 hire per design q . Plan
Hire Personnel hire per 5 trn per . . Prepare
Design Questionnaire design q 3 trn per select h print q Plan
Train Personnel trn per 3 cond sur . . Prepare
Select Households select h 3 cond sur . . Prepare
Print Questionnaire print q 4 cond sur . . Prepare
Conduct Survey cond sur 10 analyze . . Implement
Analyze Results analyze 6 . . . Implement
;
The data set survey can be input to PROC CPM, which calculates how long the
project will take given the current estimates of the durations. As a rst step, you may
want to graph the project network using PROC NETDRAW. In the initial stages of
dening the tasks in a project, it is useful to see how the tasks relate to each other and
perhaps modify some of the relationships. The following program invokes PROC
NETDRAW; the ZONE= option is used to create a zoned network diagram with the
activities grouped according to the phase of the project to which they correspond.
The network diagram is shown in Output 1.1.1.
Example 1.1. Project Denition
27
title ;
title2 h=3 c=black f=swiss Conducting a Market Survey;
goptions hpos=100 vpos=65 border;
proc netdraw data=survey graphics;
actnet/act=activity font=swiss
succ=(succ1-succ3)
separatearcs
xbetween=3
id=(id)
nodefid
nolabel
zone=phase
zonepat
frame;
run;
28
Chapter 1. Introduction to Project Management
Output 1.1.1. Network Diagram of SURVEY Project
Example 1.2. Work Breakdown Structure
29
Example 1.2. Work Breakdown Structure
Atree diagramis a useful method of visualizing the work breakdown structure (WBS)
of a project. For the survey project, the activities are divided into three phases. In
this example, the NETDRAW procedure is used to represent the work breakdown
structure of the project. The following program saves the data in a Network data
set that is input to PROC NETDRAW. The TREE option is used to draw the WBS
structure in the form of a tree (Output 1.2.1).
data wbs;
format parent $10. child $10. ;
input parent & child & style;
datalines;
Survey Plan 1
Survey Prepare 1
Survey Implement 1
Plan Plan S. 2
Plan Design Q. 2
Prepare Hire P. 3
Prepare Train P. 3
Prepare Select H. 3
Prepare Print Q. 3
Implement Conduct S. 4
Implement Analyze R. 4
Plan S. . 2
Design Q. . 2
Hire P. . 3
Train P. . 3
Select H. . 3
Print Q. . 3
Conduct S. . 4
Analyze R. . 4
;
goptions vsize=5.75 in hsize=4.0 in border;
title a=90 h=1 f=swiss Conducting a Market Survey;
title2 a=90 h=.8 f=swiss Work Breakdown Structure;
proc netdraw data=wbs graphics;
actnet/act=parent succ=child tree
rotate rotatetext coutline=black
ctext=white font=swiss rectilinear
htext=2 compress
xbetween=15 ybetween=3 pattern=style
centerid;
run;
30
Chapter 1. Introduction to Project Management
Output 1.2.1. Work Breakdown Structure of SURVEY Project
Example 1.3. Project Scheduling and Reporting
Having dened the project and ensured that all the relationships have been modeled
correctly, you can schedule the activities in the project by invoking PROC CPM.
Suppose the activities can occur only on weekdays, and there is a holiday on July
4, 2003. Holiday information is passed to PROC CPM using the Holiday data set
holidata. The following statements schedule the project to start on July 1, 2003.
The early and late start schedules and additional project information are saved in the
output data set survschd. The output data set produced by PROC CPM can then be
used to generate a variety of reports. In this example, the data set is rst sorted by
the variable E
START and then displayed using the PRINT procedure (see Output
1.3.1).
data holidata;
format hol date7.;
hol = 4jul03d;
run;
Example 1.3. Project Scheduling and Reporting
31
proc cpm data=survey date=1jul03d out=survschd
interval=weekday holidata=holidata;
activity activity;
successor succ1-succ3;
duration duration;
id id phase;
holiday hol;
run;
proc sort;
by e_start;
run;
proc print;
run;
Output 1.3.1. Project Schedule: Listing
Conducting a Market Survey
Early and Late Start Schedule
Obs activity succ1 succ2 succ3 duration id
1 plan sur hire per design q 4 Plan Survey
2 hire per trn per 5 Hire Personnel
3 design q trn per select h print q 3 Design Questionnaire
4 select h cond sur 3 Select Households
5 print q cond sur 4 Print Questionnaire
6 trn per cond sur 3 Train Personnel
7 cond sur analyze 10 Conduct Survey
8 analyze 6 Analyze Results
Obs phase E_START E_FINISH L_START L_FINISH T_FLOAT F_FLOAT
1 Plan 01JUL03 07JUL03 01JUL03 07JUL03 0 0
2 Prepare 08JUL03 14JUL03 08JUL03 14JUL03 0 0
3 Plan 08JUL03 10JUL03 09JUL03 11JUL03 1 0
4 Prepare 11JUL03 15JUL03 15JUL03 17JUL03 2 2
5 Prepare 11JUL03 16JUL03 14JUL03 17JUL03 1 1
6 Prepare 15JUL03 17JUL03 15JUL03 17JUL03 0 0
7 Implement 18JUL03 31JUL03 18JUL03 31JUL03 0 0
8 Implement 01AUG03 08AUG03 01AUG03 08AUG03 0 0
The schedule produced by PROC CPM is then graphed by invoking PROC GANTT,
as shown in the following code. The CALENDAR procedure or NETDRAW proce-
dure can also be used to display the schedule. The Gantt chart produced is shown in
Output 1.3.2. Note that the precedence relationships are displayed on the Gantt chart.
32
Chapter 1. Introduction to Project Management
goptions hpos=80 vpos=43;
title c=black f=swiss Conducting a Market Survey;
title2 c=black f=swiss h=1.5 Early and Late Start Schedule;
proc gantt graphics data=survschd holidata=holidata;
chart / holiday=(hol) interval=weekday
font=swiss skip=2 height=1.2 nojobnum
compress noextrange
activity=activity succ=(succ1-succ3)
cprec=blue caxis=black ;
id id phase;
run;
Output 1.3.2. Gantt Chart of SURVEY Project
Example 1.4. Summary Report
As mentioned in the Data Flow section beginning on page 17, the output data set
can be manipulated in several different ways. You can subset the project data to report
progress on selected activities, or you can produce reports sorted by a particular eld
or grouped according to a natural division of the project activities. For large projects,
you may want to get a summarized view of the schedule, with the start and nish
times of only the major phases of the project.
For the survey project, suppose that you want a condensed report, containing only
information about the start and nish times of the three different phases of the project.
The following program summarizes the information in the data set survschd and
produces a Gantt chart of the summarized schedule (shown in Output 1.4.1).
Example 1.4. Summary Report
33
proc sort data=survschd;
by phase;
run;
proc summary data=survschd;
by phase;
output out=sumsched min(e_start)= max(e_finish)= ;
var e_start e_finish;
run;
proc sort data=sumsched;
by e_start;
format e_start e_finish date7.;
run;
goptions hpos=80 vpos=43;
title c=black f=swiss h=3 Conducting a Market Survey;
title2 c=black f=swiss h=2 Summarized Schedule;
proc gantt data=sumsched graphics
holidata=holidata;
id phase;
chart / nojobnum
nolegend font=swiss
interval=weekday
height=2 skip=4
ref=01jul03d to 15aug03d by week
caxis=black
holiday=(hol);
run;
34
Chapter 1. Introduction to Project Management
Output 1.4.1. Summary Gantt Chart of SURVEY Project
Example 1.5. Resource-Constrained Scheduling
The previous two examples illustrated some of the reports that can be generated using
the Schedule output data set produced by PROC CPM. This section illustrates the use
of PROC CPM to perform resource-constrained scheduling and to obtain a resource
Usage output data set for generating reports of resource utilization during the course
of a project. A primary concern in data processing centers is the number of processors
needed to perform various tasks. Given a series of programming tasks, a common
question faced by a data center operator is how to allocate computer resources to the
various tasks.
Consider a simple job that involves sorting six data sets A, B, C, D, E, and F, merging
the rst three into one master data set, merging the last three into another comparison
data set, and then comparing the two merged data sets. The precedence constraints
between the activities (captured by the variables task and succ), the time required by
the activities (the variable dur), and the resource required (the variable processor)
are shown in the following code:
Example 1.5. Resource-Constrained Scheduling
35
data program;
format task $8. succ $8. ;
input task & succ & dur processor;
datalines;
Sort A Merge 1 5 1
Sort B Merge 1 4 1
Sort C Merge 1 3 1
Sort D Merge 2 6 1
Sort E Merge 2 4 1
Sort F Merge 2 6 1
Merge 1 Compare 5 1
Merge 2 Compare 4 1
Compare . 5 1
;
If the programming project is scheduled (in absolute units) without any resource con-
straints, it will take 15 time units for completion and will require a maximum avail-
ability of six processors. Suppose now that only two processors are available. The
resin data set limits the availability of the resource to 2, and PROC CPM is invoked
with two input data sets (Activity data set program and Resource data set resin) to
produce a resource-constrained schedule.
PROC CPM produces two output data sets. The Schedule data set (progschd)
contains the resource-constrained schedule (S
START and S
FINISH variables)
in addition to the early and late start unconstrained schedules. The Usage data set
(progrout) shows the number of processors required at every unit of time, if the early
start schedule or the late start schedule or the resource-constrained schedule were
followed, in the variables eprocessor, lprocessor, and rprocessor, respectively;
the variable aprocessor shows the number of processors remaining after resource
allocation. The two output data sets are displayed in Output 1.5.1.
data resin;
input per processor;
datalines;
0 2
;
proc cpm data=program resin=resin
out=progschd resout=progrout;
activity task;
duration dur;
successor succ;
resource processor/per=per;
run;
title Scheduling Programming Tasks;
title2 Data Set PROGSCHD;
proc print data=progschd;
run;
title2 Data Set PROGROUT;
36
Chapter 1. Introduction to Project Management
proc print data=progrout;
run;
The Schedule and Usage data sets, displayed in Output 1.5.1, can be used to generate
any type of report concerning the schedules or processor usage. In the following
program, the unconstrained and constrained schedules are rst plotted using PROC
GANTT (see Output 1.5.2).
Output 1.5.1. Data Sets PROGSCHD and PROGROUT
Scheduling Programming Tasks
Data Set PROGSCHD
p
r S E L
o S _ E _ L _
c _ F _ F _ F
e S I S I S I
t s s T N T N T N
O a u d s A I A I A I
b s c u o R S R S R S
s k c r r T H T H T H
1 Sort A Merge 1 5 1 0 5 0 5 0 5
2 Sort B Merge 1 4 1 6 10 0 4 1 5
3 Sort C Merge 1 3 1 10 13 0 3 2 5
4 Sort D Merge 2 6 1 0 6 0 6 0 6
5 Sort E Merge 2 4 1 11 15 0 4 2 6
6 Sort F Merge 2 6 1 5 11 0 6 0 6
7 Merge 1 Compare 5 1 13 18 5 10 5 10
8 Merge 2 Compare 4 1 15 19 6 10 6 10
9 Compare 5 1 19 24 10 15 10 15
Data Set PROGROUT
Obs _TIME_ Eprocessor Lprocessor Rprocessor Aprocessor
1 0 6 3 2 0
2 1 6 4 2 0
3 2 6 6 2 0
4 3 5 6 2 0
5 4 3 6 2 0
6 5 3 4 2 0
7 6 2 2 2 0
8 7 2 2 2 0
9 8 2 2 2 0
10 9 2 2 2 0
11 10 1 1 2 0
12 11 1 1 2 0
13 12 1 1 2 0
14 13 1 1 2 0
15 14 1 1 2 0
16 15 0 0 2 0
17 16 0 0 2 0
18 17 0 0 2 0
19 18 0 0 1 1
20 19 0 0 1 1
21 20 0 0 1 1
22 21 0 0 1 1
23 22 0 0 1 1
24 23 0 0 1 1
25 24 0 0 0 2
Example 1.5. Resource-Constrained Scheduling
37
goptions hpos=80 vpos=43;
title f=swiss Scheduling Programming Tasks;
title2 f=swiss h=1.5 Comparison of Schedules;
proc gantt data=progschd graphics;
chart / font=swiss increment=2 caxis=black;
id task;
run;
Output 1.5.2. Gantt Chart Comparing Schedules
Next, the GPLOT procedure is invoked using the Usage data set to compare the un-
constrained and the constrained usage of the resource (see Output 1.5.3).
/* Create a data set for use with PROC GPLOT */
data plotout;
set progrout;
label _time_=Time of Usage;
label processor=Number of Processors;
label resource=Type of Schedule Followed;
resource=Constrained;
processor=rprocessor; output;
resource=Early Start;
processor=eprocessor; output;
run;
38
Chapter 1. Introduction to Project Management
axis1 minor=none width=3;
axis2 length=80 pct;
symbol1 i=steplj;
symbol2 i=steplj l=3;
goptions ftext=swiss;
title2 h=1.5 Comparison of Processor Usage;
proc gplot data=plotout;
plot processor * _time_ = resource/ vaxis=axis1
haxis=axis2
caxis=black;
run;
Output 1.5.3. Plot Comparing Resource Usage
Example 1.6. Multiple Projects
Often a project is divided into several subprojects, each of which is then broken into
activities with precedence constraints. For reporting or accounting purposes, it may
be essential to group activities or to aggregate the information pertaining to activi-
ties in a given group. Sometimes, totally different projects use a common pool of
resources and you may want to schedule all the projects using the common pool; you
may want to vary the priority with which the resources are allotted to the activities on
the basis of the projects to which they belong. Often, you have several projects that
are essentially the same, with only a few minor differences; these projects may also
share a common pool of resources. In such cases, you may want to have a project
template listing all the activities and their precedence relationships; for each specic
Example 1.6. Multiple Projects
39
project you can copy the template, make any modications that are necessary for the
given scenario, and determine the project schedule accordingly.
This example illustrates some of these possibilities for a multiproject scenario. The
project is rst scheduled using PROC CPM, and then the PM procedure is used with
the same input data set to illustrate the project displayed in the PM Window.
Output 1.6.1. Network Diagram for Project Book
Consider a publishing company that accepts manuscripts from different authors for
publication. The publication of each book can be treated as a project. Thus, at a
given point in time, several projects, almost identical in nature, may be in progress.
Some of the resources that may be needed are a technical editor, a copyeditor, and
a graphic artist. All the books that are currently being worked on share a common
pool of these resources. This example uses a simplied version of such a scenario to
illustrate some of the ways in which you can handle multiple projects competing for
the same pool of resources.
The network in Output 1.6.1 represents some of the tasks required to publish one
book and the precedence constraints among these tasks; the durations in the diagram
are in weeks. Suppose that the generic project data are in the data set book, which is
displayed in Output 1.6.2. This data set is used as a template for creating the Activity
data set for any book publishing project.
Suppose that the company is working on two books simultaneously. The editor and
artist must now allocate their time between the two books. The following program
uses the template data set book to create Activity data sets book1 and book2 corre-
sponding to the publication of each book. Any modications to the generic project
40
Chapter 1. Introduction to Project Management
data can be made in the DATA step or by using PROC PM. In this example, the dura-
tion for the rst activity, Preliminary Edit, is changed to two weeks for the second
book. The two Activity data sets book1 and book2 are also displayed in Output
1.6.2.
data book1;
length act $6. succ $6.;
set book;
subproj = "Book 1";
act = "B1"||task;
if succ ^= " " then succ = "B1"||succ;
run;
title Publishing Book 1;
proc print data=book1;
var subproj task act succ id dur editor artist;
run;
data book2;
length act $6. succ $6.;
set book;
subproj = "Book 2";
act = "B2"||task;
if act = "B2PEDT" then dur = 2;
if succ ^= " " then succ = "B2"||succ;
run;
title Publishing Book 2;
proc print data=book2;
var subproj task act succ id dur editor artist;
run;
Example 1.6. Multiple Projects
41
Output 1.6.2. Template and Activity Data Sets for Book Publishing Example
Publishing a Book
Template Data Set
Obs id task dur succ editor artist
1 Preliminary Edit PEDT 1 REV 1 .
2 Preliminary Edit PEDT 1 GRPH 1 .
3 Revise Book REV 2 CEDT 1 .
4 Graphics GRPH 3 CEDT . 1
5 Copyedit Book CEDT 1 PRF 1 .
6 Proofread Book PRF 1 PRNT 1 .
7 Print Book PRNT 2 . .
Publishing Book 1
Obs subproj task act succ id dur editor artist
1 Book 1 PEDT B1PEDT B1REV Preliminary Edit 1 1 .
2 Book 1 PEDT B1PEDT B1GRPH Preliminary Edit 1 1 .
3 Book 1 REV B1REV B1CEDT Revise Book 2 1 .
4 Book 1 GRPH B1GRPH B1CEDT Graphics 3 . 1
5 Book 1 CEDT B1CEDT B1PRF Copyedit Book 1 1 .
6 Book 1 PRF B1PRF B1PRNT Proofread Book 1 1 .
7 Book 1 PRNT B1PRNT Print Book 2 . .
Publishing Book 2
Obs subproj task act succ id dur editor artist
1 Book 2 PEDT B2PEDT B2REV Preliminary Edit 2 1 .
2 Book 2 PEDT B2PEDT B2GRPH Preliminary Edit 2 1 .
3 Book 2 REV B2REV B2CEDT Revise Book 2 1 .
4 Book 2 GRPH B2GRPH B2CEDT Graphics 3 . 1
5 Book 2 CEDT B2CEDT B2PRF Copyedit Book 1 1 .
6 Book 2 PRF B2PRF B2PRNT Proofread Book 1 1 .
7 Book 2 PRNT B2PRNT Print Book 2 . .
As a next step, the data sets for the two subprojects are combined to form an Activity
data set for the entire project. Avariable priority is assigned the value 1 for activities
pertaining to the rst book and the value 2 for those pertaining to the second one.
In other words, Book 1 has priority over Book 2. The Resource data set species
the availability for each of the resources to be 1. The input data sets, books and
resource, are displayed in Output 1.6.3.
data books;
set book1 book2;
if subproj = "Book 1" then priority = 1;
else priority = 2;
run;
title Publishing Books 1 and 2;
proc print data=books;
var subproj priority task act succ id dur editor artist;
run;
42
Chapter 1. Introduction to Project Management
data resource;
input avdate & date7. editor artist;
format avdate date7.;
datalines;
1jan03 1 1
;
title Resources Available;
proc print data=resource;
run;
Output 1.6.3. Input Data Sets for Book Publishing Example
Publishing Books 1 and 2
Obs subproj priority task act succ id dur editor artist
1 Book 1 1 PEDT B1PEDT B1REV Preliminary Edit 1 1 .
2 Book 1 1 PEDT B1PEDT B1GRPH Preliminary Edit 1 1 .
3 Book 1 1 REV B1REV B1CEDT Revise Book 2 1 .
4 Book 1 1 GRPH B1GRPH B1CEDT Graphics 3 . 1
5 Book 1 1 CEDT B1CEDT B1PRF Copyedit Book 1 1 .
6 Book 1 1 PRF B1PRF B1PRNT Proofread Book 1 1 .
7 Book 1 1 PRNT B1PRNT Print Book 2 . .
8 Book 2 2 PEDT B2PEDT B2REV Preliminary Edit 2 1 .
9 Book 2 2 PEDT B2PEDT B2GRPH Preliminary Edit 2 1 .
10 Book 2 2 REV B2REV B2CEDT Revise Book 2 1 .
11 Book 2 2 GRPH B2GRPH B2CEDT Graphics 3 . 1
12 Book 2 2 CEDT B2CEDT B2PRF Copyedit Book 1 1 .
13 Book 2 2 PRF B2PRF B2PRNT Proofread Book 1 1 .
14 Book 2 2 PRNT B2PRNT Print Book 2 . .
Resources Available
Obs avdate editor artist
1 01JAN03 1 1
PROC CPM is then invoked to schedule the project to start on January 1, 2003. The
PROJECT statement is used to indicate the subproject to which each activity belongs.
The data set bookschd (displayed in Output 1.6.4) contains the schedule for the
entire project. The ADDACT option on the PROC CPM statement adds observations
for each of the subprojects, Book 1 and Book 2, as well as one observation for the
entire project. These observations are added at the end of the list of the observations
corresponding to the observations in the input data set. The Usage data set booksout
is also displayed in Output 1.6.4.
Example 1.6. Multiple Projects
43
proc cpm data=books resin=resource
out=bookschd resout=booksout
date=1jan03d interval=week
addact;
act act;
dur dur;
succ succ;
resource editor artist / per=avdate avp rcp
rule=actprty actprty=priority
delayanalysis;
id id task;
project subproj;
run;
Compare the E
START and S
DELAY does not include any delay in the activity that is caused by a
resource delay in one of its predecessors. See Example 2.15 in Chapter 2, The CPM
Procedure, for more details about the R
DELAY variable.
44
Chapter 1. Introduction to Project Management
Output 1.6.4. Data Sets BOOKSCHD and BOOKSOUT
Schedule for Project BOOKS
P P
s R R S
u O O e a _
b J J d r S
p _ _ s t i t T
O r D L a u d a t i A
b o U E c c u i s o s R
s j R V t c r d k r t T
1 Book 1 . 2 B1PEDT B1REV 1 Preliminary Edit PEDT 1 . 01JAN03
2 Book 1 . 2 B1PEDT B1GRPH 1 Preliminary Edit PEDT 1 . 01JAN03
3 Book 1 . 2 B1REV B1CEDT 2 Revise Book REV 1 . 08JAN03
4 Book 1 . 2 B1GRPH B1CEDT 3 Graphics GRPH . 1 08JAN03
5 Book 1 . 2 B1CEDT B1PRF 1 Copyedit Book CEDT 1 . 05FEB03
6 Book 1 . 2 B1PRF B1PRNT 1 Proofread Book PRF 1 . 12FEB03
7 Book 1 . 2 B1PRNT 2 Print Book PRNT . . 19FEB03
8 Book 2 . 2 B2PEDT B2REV 2 Preliminary Edit PEDT 1 . 22JAN03
9 Book 2 . 2 B2PEDT B2GRPH 2 Preliminary Edit PEDT 1 . 22JAN03
10 Book 2 . 2 B2REV B2CEDT 2 Revise Book REV 1 . 19FEB03
11 Book 2 . 2 B2GRPH B2CEDT 3 Graphics GRPH . 1 05FEB03
12 Book 2 . 2 B2CEDT B2PRF 1 Copyedit Book CEDT 1 . 05MAR03
13 Book 2 . 2 B2PRF B2PRNT 1 Proofread Book PRF 1 . 12MAR03
14 Book 2 . 2 B2PRNT 2 Print Book PRNT . . 19MAR03
15 9 1 Book 1 . . . 01JAN03
16 10 1 Book 2 . . . 22JAN03
17 13 0 . . . 01JAN03
S E L
_ E _ L _ R D S
F _ F _ F _ E U
I S I S I D L P
N T N T N E A P
O I A I A I L Y L
b S R S R S A _ _
s H T H T H Y R R
1 07JAN03 01JAN03 07JAN03 08JAN03 14JAN03 0
2 07JAN03 01JAN03 07JAN03 08JAN03 14JAN03 0
3 21JAN03 08JAN03 21JAN03 22JAN03 04FEB03 0
4 28JAN03 08JAN03 28JAN03 15JAN03 04FEB03 0
5 11FEB03 29JAN03 04FEB03 05FEB03 11FEB03 1 editor
6 18FEB03 05FEB03 11FEB03 12FEB03 18FEB03 0
7 04MAR03 12FEB03 25FEB03 19FEB03 04MAR03 0
8 04FEB03 01JAN03 14JAN03 01JAN03 14JAN03 3 editor
9 04FEB03 01JAN03 14JAN03 01JAN03 14JAN03 3 editor
10 04MAR03 15JAN03 28JAN03 22JAN03 04FEB03 2 editor
11 25FEB03 15JAN03 04FEB03 15JAN03 04FEB03 0
12 11MAR03 05FEB03 11FEB03 05FEB03 11FEB03 0
13 18MAR03 12FEB03 18FEB03 12FEB03 18FEB03 0
14 01APR03 19FEB03 04MAR03 19FEB03 04MAR03 0
15 04MAR03 01JAN03 25FEB03 08JAN03 04MAR03 0
16 01APR03 01JAN03 04MAR03 01JAN03 04MAR03 3
17 01APR03 01JAN03 04MAR03 01JAN03 04MAR03 0
Resource Usage for Project BOOKS
Obs _TIME_ Reditor Aeditor Rartist Aartist
1 01JAN03 1 0 0 1
2 08JAN03 1 0 1 0
3 15JAN03 1 0 1 0
4 22JAN03 1 0 1 0
5 29JAN03 1 0 0 1
6 05FEB03 1 0 1 0
7 12FEB03 1 0 1 0
8 19FEB03 1 0 1 0
9 26FEB03 1 0 0 1
10 05MAR03 1 0 0 1
11 12MAR03 1 0 0 1
12 19MAR03 0 1 0 1
13 26MAR03 0 1 0 1
14 02APR03 0 1 0 1
Example 1.6. Multiple Projects
45
The output data sets bookschd and booksout can be used to produce graphical re-
ports of the schedule and the resource usage. In particular, the Schedule data set can
be used to produce a zoned, time-scaled network diagram as shown in Output 1.6.5.
The program used to produce the network diagram is shown in the following code.
In this example, only the leaf tasks (those without any subtasks) are used to draw
the network diagram. Further, the activities are aligned according to the resource-
constrained start times and grouped according to the subproject.
goptions hpos=98 vpos=60;
pattern1 v=e c=green;
pattern2 v=e c=red;
title c=black f=swiss h=4 Schedule for Project Books;
proc netdraw data=bookschd(where=(proj_dur=.) graphics;
actnet / act=task succ=succ font=swiss
id=(task) nodefid nolabel
xbetween=8 htext=3 pcompress
zone=subproj zonepat zonespace
align=s_start separatearcs;
label subproj = Subproject;
run;
Output 1.6.5. Resource Constrained Schedule for Project Books
46
Chapter 1. Introduction to Project Management
The same project can also be scheduled using the PM procedure, as shown in the
following statements. The resulting PM Window is shown in Output 1.6.6. The
advantage with using PROC PM is that you can use the PM Window to edit the
activity information, such as the durations, resource requirements, and so forth.
proc pm data=books resin=resource
out=pmsched resout=pmrout
date=1jan03d interval=week;
act act;
dur dur;
succ succ;
resource editor artist / per=avdate
avp rcp
rule=actprty
actprty=priority
delayanalysis;
id id task;
project subproj;
run;
Output 1.6.6. PM Window on Book Project
Example 1.7. Sequential Scheduling of Projects
47
Example 1.7. Sequential Scheduling of Projects
Suppose the schedule displayed in Output 1.6.4 is not acceptable; you want the rst
book to be nished as soon as possible and do not want resources to be claimed by
the second book at the cost of the rst book. One way to accomplish this is to enable
activities related to the second book to be split whenever the rst book demands a
resource currently in use by the second book. If you do not want activities to be split,
you can still accomplish your goal by sequential scheduling. The structure of the
input and output data sets enables you to schedule the two subprojects sequentially.
This example illustrates the sequential scheduling of subprojects Book 1 and Book
2. The following program rst schedules the subproject Book 1 using the resources
available. The resulting schedule is displayed in Output 1.7.1. The Usage data set
bk1out is also displayed in Output 1.7.1.
/* Schedule the higher priority project first */
proc cpm data=book1 resin=resource
out=bk1schd resout=bk1out
date=1jan03d interval=week;
act act;
dur dur;
succ succ;
resource editor artist / per=avdate avp rcp;
id id;
run;
48
Chapter 1. Introduction to Project Management
Output 1.7.1. Sequential Scheduling of Subprojects: Book 1
Schedule for sub-project BOOK1
Obs act succ dur id editor artist S_START
1 B1PEDT B1REV 1 Preliminary Edit 1 . 01JAN03
2 B1PEDT B1GRPH 1 Preliminary Edit 1 . 01JAN03
3 B1REV B1CEDT 2 Revise Book 1 . 08JAN03
4 B1GRPH B1CEDT 3 Graphics . 1 08JAN03
5 B1CEDT B1PRF 1 Copyedit Book 1 . 29JAN03
6 B1PRF B1PRNT 1 Proofread Book 1 . 05FEB03
7 B1PRNT 2 Print Book . . 12FEB03
Obs S_FINISH E_START E_FINISH L_START L_FINISH
1 07JAN03 01JAN03 07JAN03 01JAN03 07JAN03
2 07JAN03 01JAN03 07JAN03 01JAN03 07JAN03
3 21JAN03 08JAN03 21JAN03 15JAN03 28JAN03
4 28JAN03 08JAN03 28JAN03 08JAN03 28JAN03
5 04FEB03 29JAN03 04FEB03 29JAN03 04FEB03
6 11FEB03 05FEB03 11FEB03 05FEB03 11FEB03
7 25FEB03 12FEB03 25FEB03 12FEB03 25FEB03
Resource Usage for sub-project BOOK1
Obs _TIME_ Reditor Aeditor Rartist Aartist
1 01JAN03 1 0 0 1
2 08JAN03 1 0 1 0
3 15JAN03 1 0 1 0
4 22JAN03 0 1 1 0
5 29JAN03 1 0 0 1
6 05FEB03 1 0 0 1
7 12FEB03 0 1 0 1
8 19FEB03 0 1 0 1
9 26FEB03 0 1 0 1
The Usage data set produced by PROC CPM has two variables, Aeditor and Aartist,
showing the availability of the editor and the artist on each day of the project, after
scheduling subproject Book 1. This data set is used to create the data set remres,
listing the remaining resources available, which is then used as the Resource input
data set for scheduling the subproject Book 2. The following program shows the
DATA step and the invocation of PROC CPM.
The schedule for publishing Book 2 is displayed in Output 1.7.2. The Usage data
set bk2out is also displayed in Output 1.7.2. Note that this method of scheduling has
ensured that Book 1 is not delayed; however, the entire project has been delayed by
two more weeks, resulting in a total delay of six weeks.
/* Construct the Resource availability data set */
/* with proper resource names */
data remres;
set bk1out;
avdate=_time_;
editor=aeditor;
artist=aartist;
keep avdate editor artist;
format avdate date7.;
run;
Example 1.8. Project Cost Control
49
proc cpm data=book2 resin=remres
out=bk2schd resout=bk2out
date=1jan03d interval=week;
act act;
dur dur;
succ succ;
resource editor artist / per=avdate avp rcp;
id id;
run;
Output 1.7.2. Sequential Scheduling of Subprojects: Book 2
Schedule for sub-project BOOK2
Obs act succ dur id editor artist S_START
1 B2PEDT B2REV 2 Preliminary Edit 1 . 12FEB03
2 B2PEDT B2GRPH 2 Preliminary Edit 1 . 12FEB03
3 B2REV B2CEDT 2 Revise Book 1 . 26FEB03
4 B2GRPH B2CEDT 3 Graphics . 1 26FEB03
5 B2CEDT B2PRF 1 Copyedit Book 1 . 19MAR03
6 B2PRF B2PRNT 1 Proofread Book 1 . 26MAR03
7 B2PRNT 2 Print Book . . 02APR03
Obs S_FINISH E_START E_FINISH L_START L_FINISH
1 25FEB03 01JAN03 14JAN03 01JAN03 14JAN03
2 25FEB03 01JAN03 14JAN03 01JAN03 14JAN03
3 11MAR03 15JAN03 28JAN03 22JAN03 04FEB03
4 18MAR03 15JAN03 04FEB03 15JAN03 04FEB03
5 25MAR03 05FEB03 11FEB03 05FEB03 11FEB03
6 01APR03 12FEB03 18FEB03 12FEB03 18FEB03
7 15APR03 19FEB03 04MAR03 19FEB03 04MAR03
Resource Usage for sub-project BOOK2
Obs _TIME_ Reditor Aeditor Rartist Aartist
1 12FEB03 1 0 0 1
2 19FEB03 1 0 0 1
3 26FEB03 1 0 1 0
4 05MAR03 1 0 1 0
5 12MAR03 0 1 1 0
6 19MAR03 1 0 0 1
7 26MAR03 1 0 0 1
8 02APR03 0 1 0 1
9 09APR03 0 1 0 1
10 16APR03 0 1 0 1
Example 1.8. Project Cost Control
Cost control and accounting are important aspects of project management. Cost data
for a project may be associated with activities or groups of activities, or with re-
sources, such as personnel or equipment. For example, consider a project that consists
of several subprojects, each of which is contracted to a different company. From the
contracting companys point of view, each subproject can be treated as one cost item;
all the company needs to know is how much each subproject is going to cost. On the
other hand, another project may contain several activities, each of which requires two
types of labor, skilled and unskilled. The cost for each activity in the project may
have to be computed on the basis of how much skilled or unskilled labor that activ-
ity uses. In this case, activity and project costs are determined from the resources
50
Chapter 1. Introduction to Project Management
used. Further, for any project, there may be several ways in which costs need to be
summarized and accounted for. In addition to determining the cost of each individual
activity, you may want to determine periodic budgets for different departments that
are involved with the project or compare the actual costs that were incurred with the
budgeted costs.
It is easy to set up cost accounting systems using the output data sets produced by
PROC CPM, whether costs are associated with activities or with resources. In fact,
you can even treat cost as a consumable resource if you can estimate the cost per
day for each of the activities (see Chapter 2, The CPM Procedure, for details on
resource allocation and types of resources). This example illustrates such a method
for monitoring costs and shows how you can compute some of the standard cost
performance measures used in project management.
The following three measures can be used to determine if a project is running on
schedule and within budget (see Moder, Phillips, and Davis 1983, for a detailed dis-
cussion on project cost control):
Actual cost of work performed (ACWP) is the actual cost expended to perform
the work accomplished in a given period of time.
Budgeted cost of work performed (BCWP) is the budgeted cost of the work
completed in a given period of time.
Budgeted cost of work scheduled (BCWS) is the budgeted cost of the work
scheduled to be accomplished in a given period of time (if a baseline schedule
were followed).
Consider the survey example described earlier in this chapter. Suppose that it is
possible to estimate the cost per day for each activity in the project. The following
data set survcost contains the project data (activity, succ1succ3, id, duration)
and a variable named cost containing the cost per day in dollars. In order to compute
the BCWS for the project, you need to establish a baseline schedule. Suppose the
early start schedule computed by PROC CPM is chosen as the baseline schedule.
The Resource data set costavl establishes cost as a consumable resource, so that the
CPM procedure can be used to accumulate costs (using the CUMUSAGE option).
The following program invokes PROC CPM with the RESOURCE statement and
saves the Usage data set in survrout. The variable ecost in this Usage data set
contains the cumulative expense incurred for the baseline schedule; this is the same
as the budgeted cost of work scheduled (or BCWS) saved in the data set basecost.
Example 1.8. Project Cost Control
51
data survcost;
format id $20. activity $8. succ1-succ3 $8. ;
input id & activity & duration succ1 & succ2 & succ3 & cost;
datalines;
Plan Survey plan sur 4 hire per design q . 300
Hire Personnel hire per 5 trn per . . 350
Design Questionnaire design q 3 trn per select h print q 100
Train Personnel trn per 3 cond sur . . 500
Select Households select h 3 cond sur . . 300
Print Questionnaire print q 4 cond sur . . 250
Conduct Survey cond sur 10 analyze . . 200
Analyze Results analyze 6 . . . 500
;
data holidata;
format hol date7.;
hol = 4jul03d;
run;
data costavl;
input per & date7. otype $ cost;
format per date7.;
datalines;
. restype 2
1jul03 reslevel 12000
;
proc cpm date=1jul03d interval=weekday
data=survcost resin=costavl holidata=holidata
out=sched resout=survrout;
activity activity;
successor succ1-succ3;
duration duration;
holiday hol;
id id;
resource cost / period = per
obstype = otype cumusage;
run;
data basecost (keep = _time_ bcws);
set survrout;
bcws = ecost;
run;
Suppose that the project started as planned on July 1, 2003, but some of the activities
took longer than planned and some of the cost estimates were found to be incorrect.
The following data set, actual, contains updated information: the variables as and
af contain the actual start and nish times of the activities that have been completed
or are in progress. The variable actcost contains the revised cost per day for each
activity. The following program combines this information with the existing project
data and saves the result in the data set update, displayed in Output 1.8.1. The
Resource data set costavl2 (also displayed in Output 1.8.1) denes cost and actcost
as consumable resources.
52
Chapter 1. Introduction to Project Management
data actual;
format id $20. ;
input id & as & date9. af & date9. actcost;
format as af date7.;
datalines;
Plan Survey 1JUL03 8JUL03 275
Hire Personnel 9JUL03 15JUL03 350
Design Questionnaire 10JUL03 14JUL03 150
Train Personnel 16JUL03 17JUL03 800
Select Households 15JUL03 17JUL03 450
Print Questionnaire 15JUL03 18JUL03 250
Conduct Survey 21JUL03 . 200
;
data update;
merge survcost actual;
run;
title Activity Data Set UPDATE;
proc print;
run;
data costavl2;
input per & date7. otype $ cost actcost;
format per date7.;
datalines;
. restype 2 2
1jul03 reslevel 12000 12000
;
title Resource Data Set COSTAVL2;
proc print;
run;
Example 1.8. Project Cost Control
53
Output 1.8.1. Project Cost Control: Progress Update
Activity Data Set UPDATE
Obs id activity duration succ1
1 Plan Survey plan sur 4 hire per
2 Hire Personnel hire per 5 trn per
3 Design Questionnaire design q 3 trn per
4 Train Personnel trn per 3 cond sur
5 Select Households select h 3 cond sur
6 Print Questionnaire print q 4 cond sur
7 Conduct Survey cond sur 10 analyze
8 Analyze Results analyze 6
Obs succ2 succ3 cost as af actcost
1 design q 300 01JUL03 08JUL03 275
2 350 09JUL03 15JUL03 350
3 select h print q 100 10JUL03 14JUL03 150
4 500 16JUL03 17JUL03 800
5 300 15JUL03 17JUL03 450
6 250 15JUL03 18JUL03 250
7 200 21JUL03 . 200
8 500 . . .
Resource Data Set COSTAVL2
Obs per otype cost actcost
1 . restype 2 2
2 01JUL03 reslevel 12000 12000
Next, PROC CPM is used to revise the schedule by using the ACTUAL statement
to specify the actual start and nish times and the RESOURCE statement to specify
both the budgeted and the actual costs. The resulting schedule is saved in the data set
updsched (displayed in Output 1.8.2) and the budgeted and the actual cumulative
costs of the project (until the current date) are saved in the data set updtrout. These
cumulative costs represent the budgeted cost of work performed (BCWP) and the
actual cost of work performed (ACWP), respectively, and are saved in the data set
updtcost. The two data sets basecost and updtcost are then merged to create a
data set that contains the three measures: bcws, bcwp, and acwp. The resulting data
set is displayed in Output 1.8.3.
proc cpm date=1jul03d interval=weekday
data=update resin=costavl2
out=updsched resout=updtrout
holidata=holidata;
activity activity;
successor succ1-succ3;
duration duration;
holiday hol;
id id;
resource cost actcost / per = per
obstype = otype
maxdate = 21jul03d cumusage;
actual / a_start=as a_finish=af;
run;
54
Chapter 1. Introduction to Project Management
title Updated Schedule: Data Set UPDSCHED;
proc print data=updsched;
run;
data updtcost (keep = _time_ bcwp acwp);
set updtrout;
bcwp = ecost;
acwp = eactcost;
run;
/* Create a combined data set to contain the BCWS, BCWP, ACWP */
/* per day and the cumulative values for these costs. */
data costs;
merge basecost updtcost;
run;
title BCWS, BCWP, and ACWP;
proc print data=costs;
run;
Output 1.8.2. Project Cost Control: Updated Schedule
Updated Schedule: Data Set UPDSCHED
a d
c u
t r S
i s s s a T A
v u u u t A _
O i c c c i T D
b t c c c o U U i
s y 1 2 3 n S R d
1 plan sur hire per design q 4 Completed 5 Plan Survey
2 hire per trn per 5 Completed 5 Hire Personnel
3 design q trn per select h print q 3 Completed 3 Design Questionnaire
4 trn per cond sur 3 Completed 2 Train Personnel
5 select h cond sur 3 Completed 3 Select Households
6 print q cond sur 4 Completed 4 Print Questionnaire
7 cond sur analyze 10 In Progress . Conduct Survey
8 analyze 6 Pending . Analyze Results
A S E L
a A _ S _ E _ L _
c _ F _ F _ F _ F
t S I S I S I S I
c c T N T N T N T N
O o o A I A I A I A I
b s s R S R S R S R S
s t t T H T H T H T H
1 300 275 01JUL03 08JUL03 01JUL03 08JUL03 01JUL03 08JUL03 01JUL03 08JUL03
2 350 350 09JUL03 15JUL03 09JUL03 15JUL03 09JUL03 15JUL03 09JUL03 15JUL03
3 100 150 10JUL03 14JUL03 10JUL03 14JUL03 10JUL03 14JUL03 10JUL03 14JUL03
4 500 800 16JUL03 17JUL03 16JUL03 17JUL03 16JUL03 17JUL03 16JUL03 17JUL03
5 300 450 15JUL03 17JUL03 15JUL03 17JUL03 15JUL03 17JUL03 15JUL03 17JUL03
6 250 250 15JUL03 18JUL03 15JUL03 18JUL03 15JUL03 18JUL03 15JUL03 18JUL03
7 200 200 21JUL03 . 21JUL03 01AUG03 21JUL03 01AUG03 21JUL03 01AUG03
8 500 . . . 04AUG03 11AUG03 04AUG03 11AUG03 04AUG03 11AUG03
Example 1.8. Project Cost Control
55
Output 1.8.3. Project Cost Control: BCWS, BCWP, ACWP
BCWS, BCWP, and ACWP
Obs _TIME_ bcws bcwp acwp
1 01JUL03 0 0 0
2 02JUL03 300 300 275
3 03JUL03 600 600 550
4 07JUL03 900 900 825
5 08JUL03 1200 1200 1100
6 09JUL03 1650 1500 1375
7 10JUL03 2100 1850 1725
8 11JUL03 2550 2300 2225
9 14JUL03 3450 2750 2725
10 15JUL03 4350 3200 3225
11 16JUL03 5400 4100 4275
12 17JUL03 6150 5150 5775
13 18JUL03 6650 6200 7275
14 21JUL03 6850 6450 7525
15 22JUL03 7050 . .
16 23JUL03 7250 . .
17 24JUL03 7450 . .
18 25JUL03 7650 . .
19 28JUL03 7850 . .
20 29JUL03 8050 . .
21 30JUL03 8250 . .
22 31JUL03 8450 . .
23 01AUG03 8650 . .
24 04AUG03 9150 . .
25 05AUG03 9650 . .
26 06AUG03 10150 . .
27 07AUG03 10650 . .
28 08AUG03 11150 . .
29 11AUG03 11650 . .
The data set costs, containing the required cost information, is then used as input to
PROC GPLOT to produce a plot of the three cumulative cost measures. The plot is
shown in Output 1.8.4.
Note: BCWS, BCWP, and ACWP are three of the cost measures used as part
of Earned Value Analysis, which is an important component of the Cost/Schedule
Control Systems Criteria (referred to as C/SCSC) that was established in 1967 by
the Department of Defense (DOD) to standardize the reporting of cost and schedule
performance on major contracts. Refer to Fleming (1988) for a detailed discussion of
C/SCSC. Similar methods, such as the ones described in this example, can be used to
calculate all the relevant measures for analyzing cost and schedule performance.
56
Chapter 1. Introduction to Project Management
/* Plot the cumulative costs */
data costplot (keep=date dollars id);
set costs;
format date date7.;
date = _time_;
if bcws ^= . then do;
dollars = BCWS; id = 1; output;
end;
if bcwp ^= . then do;
dollars = BCWP; id = 2; output;
end;
if acwp ^= . then do;
dollars = ACWP; id = 3; output;
end;
run;
legend1 frame
value=(f=swiss c=black j=l f=swiss BCWS BCWP ACWP)
label=(f=swiss c=black);
axis1 width=2
order=(1jul03d to 1aug03d by week)
length=60 pct
value=(f=swiss c=black)
label=(f=swiss c=black);
axis2 width=2
order=(0 to 12000 by 2000)
length = 55 pct
value=(f=swiss c=black)
label=(f=swiss c=black);
symbol1 i=join v=none c=green w=4 l=1;
symbol2 i=join v=none c=blue w=4 l=2;
symbol3 i=join v=none c=red w=4 l=3;
title f=swiss c=black Comparison of Costs;
proc gplot data=costplot;
plot dollars * date = id / legend=legend1
haxis=axis1
vaxis=axis2;
run;
Example 1.9. Subcontracting Decisions
57
Output 1.8.4. Plot of BCWS, BCWP, and ACWP
Example 1.9. Subcontracting Decisions
Making decisions about subcontracting forms an important part of several medium-
to-large scale projects. For example, in the pharmaceutical industry, the analysis
of clinical trials may be a part of the drug development project that could either be
accomplished by the companys statistical group or be subcontracted to a statistical
consulting rm. The decision may hinge upon how busy the local statistical group is
with other projects that may delay the results of the analysis for the drug in question.
Further, there may be more than one rm that is a likely candidate for performing
the analysis. As a prerequisite for deciding whether to assign the analysis subproject
to an external rm, you need to obtain a bid in the form of estimates of the cost and
project duration from the competing rms as well as a corresponding estimate from
the in-house team.
The cost corresponding to each possible subcontracting rm may be a combination
of the actual costs (consulting fees and so on) and the tardiness of the project (tardi-
ness being measured as the time difference between when the results are expected to
be available and the target date for the availability of the results). The information
required could be provided in terms of Gantt charts and cost analysis charts. Using
this information, the project manager for the drug development project can use the
principles of decision analysis to determine whether to do the analysis in-house or
assign it to an outside consulting rm and to pick the rm to which the subcontract is
to be assigned. Some of these ideas are illustrated in the following example.
58
Chapter 1. Introduction to Project Management
Output 1.9.1. Input Data Sets for Decision Problem
Subcontracting Decision
The Stage Data Set
Obs _STNAME_ _STTYPE_ _OUTCOM_ _REWARD_ _SUCCES_
1 Assignment D In_House . Complete
2 Consult1 -20,000 Act_Finish
3 Consult2 -17,500 Act_Finish
4 Complete C On_Time . Cost
5 Delay -10,000 Cost
6 Act_Finish C Early .
7 Late .
8 Delay2 -1,000
9 Cost C High .
10 Low .
Subcontracting Decision
The Probability Data Set
Obs _GIVEN_ _EVENT_ _PROB_
1 High 0.50
2 Low 0.50
3 On_Time 0.60
4 Delay 0.40
5 Consult1 Early 0.60
6 Consult1 Late 0.35
7 Consult1 Delay2 0.05
8 Consult2 Early 0.50
9 Consult2 Late 0.40
10 Consult2 Delay2 0.10
Subcontracting Decision
The Payoffs Data Set
Obs _STATE1 _STATE2 _VALUE_
1 On_Time High -12,000
2 On_Time Low -9,500
3 Delay High -15,000
4 Delay Low -11,500
5 Early 3,500
6 Late 1,500
7 Delay2 0
The stages of the decision problem are identied by the STAGEIN= data set, stage,
displayed in Output 1.9.1. As a rst step, the drug company needs to decide whether
to perform the analysis in-house or to assign it to one of two consulting rms. If the
in-house team is chosen, the resulting stage is a chance node, called Complete, with
two possible outcomes: On-Time or Delay; if there is a delay, the resulting cost
to the drug company is $10, 000. For each of these two outcomes, there is a second
chance event corresponding to the cost of the analysis. For each of the two consulting
rms, the outcome can be one of three possibilities: Early, Late, or Delay2; if
there is a delay, the drug company imposes a delay penalty of $9, 000 on the rm,
resulting in a net reward of $1, 000 (penalty of $9, 000 minus the cost of $10, 000).
Example 1.9. Subcontracting Decisions
59
The PROBIN= data set, prob, identies the various probabilities associated with the
different possible outcomes at each of the chance events. The prob data set is also
displayed in Output 1.9.1.
The rewards (or payoffs) associated with each of the end stages are listed in the
PAYOFFS= data set, payoff (also listed in Output 1.9.1). For example, for the in-
house team, the high (low) cost associated with completing the analysis on time is
$12, 000 ($9, 500), and so on.
The following program invokes PROC DTREE to solve the decision problem. The
complete decision tree, displayed in Output 1.9.2, represents the various stages and
outcomes of the problem and identies the optimal decision. In this example, the
drug company should award the consulting contract to the second consulting rm as
indicated by the dashed line for the corresponding branch of the tree.
See Chapter 3, The DTREE Procedure, for details about the DTREE procedure.
title f=swiss "Subcontracting Decision";
goptions ftext=simplexu;
symbol1 f=marker v=P;
symbol2 f=marker v=U;
symbol3 f=marker v=A;
/* PROC DTREE statements */
proc dtree stagein=stage
probin=prob
payoffs=payoff
nowarning;
evaluate;
treeplot / graphics
compress ybetween=1 cell
lwidth=1 lwidthb=2 lstyleb=20
hsymbol=2 symbolc=1
symbold=2 symbole=3;
quit;
60
Chapter 1. Introduction to Project Management
Output 1.9.2. Decision Analysis
Project Management Systems
As illustrated in the Data Flow section on page 17 and the Examples section on
page 26, the procedures of SAS/OR software, when combined with the other parts
of the SAS System, provide a rich environment for developing customized project
management systems. Every company has its own set of requirements for howproject
data should be handled and for how costs should be accounted. The CPM, GANTT,
NETDRAW, and PM procedures, together with the other reporting, summarizing,
charting, and plotting procedures, are the basic building blocks that can be combined
in several different ways to provide the exact structure that you need. The interactive
PM procedure can be used as the primary editing interface for entering all activity
information for your projects. Further, the application building tools in the SAS
System can be used to cement the pieces together in a menu-driven application. You
can create easy-to-use applications enabling the user to enter information continually
and to obtain progress reports periodically.
Web-Based Scheduling Systems
61
The Projman Application
The Projman application is a user-friendly graphical user interface for performing
project management with the SAS System. Through the use of an interactive Gantt
chart window provided by the PM procedure, you can easily create and manage mul-
tiple projects.
Projman is accessed by invoking the projman command in the SAS windowing envi-
ronment or by selecting Solutions->Analysis->Project Management from the pri-
mary SAS menu. Projman enables you to dene multiple projects, information about
which are stored in a project dictionary data set. This project dictionary provides a
convenient way to manage all the data sets associated with each project.
Projman also provides a variety of project reports. These reports include Gantt charts,
network diagrams, calendars, and tabular listings as well as resource usage and cost
reports. You can modify these reports to add your own personalized reports to the
application.
For details about the Projman application, see Chapter 7, The Projman Application.
Web-Based Scheduling Systems
The examples in this chapter describe several scenarios that illustrate the different
ways in which the project management procedures can be used to dene, manage,
and monitor projects. As described in the previous sections, the SAS System can
be used to create comprehensive Decision Support systems or project management
systems, in particular, using the procedures described in this book. With the avail-
ability of SAS/IntrNet software, you can also create Web-based project management
or scheduling systems where the browser is used to display schedules and resource
usage information that is updated using the CPM procedures scheduling engine.
Examples of such Web-based applications are available at SAS Institutes ex-
ternal Web site at the following url: http://support.sas.com/sassamples/demos/
supplychain/demos. In particular, the Enterprise-Wide Resource Management
(EWRM) demo uses several of the ideas described in this chapter and illustrated in
the examples throughout this book to create an application that schedules the tasks
required for the maintenance of aircraft engines at a hypothetical service facility.
Note: The EWRM Web demo is a client-server application driven from your
desktop and running at SAS Institute in Cary, NC. You can access the demo
from SAS Institutes Supply Chain Web site (http://support.sas.com/sassamples/
demos/supplychain/demos/ewrm/ewrm
Project
data to a form that is readable by the PM procedure. MDBTOPM converts Microsoft
Project 98 data, and MP2KTOPM converts Microsoft Project 2000 data. The macros
generate the necessary SAS data sets, determine the values of the relevant options,
and invoke an instance of the PM procedure with the converted project data. For
details about the macros, see the Microsoft Project Data Conversion section on
page 722 in Chapter 6, The PM Procedure.
References
Cohen, M. (1990), Decision Analysis in Project Management, PMNetwork, IV, 3,
3740.
Fleming, Q. W. (1988), Cost/Schedule Control Systems Criteria: The Management
Guide to C/SCSC, Chicago: Probus Publishing Company.
Moder, J. J., Phillips, C. R., and Davis, E. W. (1983), Project Management with
CPM, PERT and Precedence Diagramming, New York: Van Nostrand Reinhold
Company.
SAS Institute Inc. (1993), SAS/OR Software: Project Management Examples, Cary,
NC: SAS Institute Inc.
Williams, G. A. and Boyd, W. L. (1990), Decision Support Systems and Project
Management, PMNetwork, IV, 3, 3136.
Chapter 2
The CPM Procedure
Chapter Contents
OVERVIEW . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
GETTING STARTED . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
SYNTAX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
Functional Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
PROC CPM Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
ACTIVITY Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
ACTUAL Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
ALIGNDATE Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
ALIGNTYPE Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
BASELINE Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
CALID Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
DURATION Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
HEADNODE Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
HOLIDAY Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
ID Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
PROJECT Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
RESOURCE Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
SUCCESSOR Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
TAILNODE Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
DETAILS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
Scheduling Subject to Precedence Constraints . . . . . . . . . . . . . . . . 106
Using the INTERVAL= Option . . . . . . . . . . . . . . . . . . . . . . . . 107
Nonstandard Precedence Relationships . . . . . . . . . . . . . . . . . . . . 108
Time-Constrained Scheduling . . . . . . . . . . . . . . . . . . . . . . . . . 110
Finish Milestones . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
OUT= Schedule Data Set . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
Multiple Calendars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
Baseline and Target Schedules . . . . . . . . . . . . . . . . . . . . . . . . 121
Progress Updating . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
Resource-Driven Durations and Resource Calendars . . . . . . . . . . . . . 125
Resource Usage and Allocation . . . . . . . . . . . . . . . . . . . . . . . . 126
RESOURCEOUT= Usage Data Set . . . . . . . . . . . . . . . . . . . . . . 142
RESOURCESCHED= Resource Schedule Data Set . . . . . . . . . . . . . 145
Multiproject Scheduling . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
64
Chapter 2. The CPM Procedure
Macro Variable
ORCPM
. . . . . . . . . . . . . . . . . . . . . . . . . . 149
Input Data Sets and Related Variables . . . . . . . . . . . . . . . . . . . . . 150
Missing Values in Input Data Sets . . . . . . . . . . . . . . . . . . . . . . . 152
FORMAT Specication . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
Computer Resource Requirements . . . . . . . . . . . . . . . . . . . . . . 154
EXAMPLES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
Example 2.1. Activity-on-Node Representation . . . . . . . . . . . . . . . . 156
Example 2.2. Activity-on-Arc Representation . . . . . . . . . . . . . . . . 159
Example 2.3. Meeting Project Deadlines . . . . . . . . . . . . . . . . . . . 162
Example 2.4. Displaying the Schedule on a Calendar . . . . . . . . . . . . . 164
Example 2.5. Precedence Gantt Chart . . . . . . . . . . . . . . . . . . . . . 166
Example 2.6. Changing Duration Units . . . . . . . . . . . . . . . . . . . . 167
Example 2.7. Controlling the Project Calendar . . . . . . . . . . . . . . . . 171
Example 2.8. Scheduling around Holidays . . . . . . . . . . . . . . . . . . 174
Example 2.9. CALEDATA and WORKDATA Data Sets . . . . . . . . . . . 179
Example 2.10. Multiple Calendars . . . . . . . . . . . . . . . . . . . . . . 184
Example 2.11. Nonstandard Relationships . . . . . . . . . . . . . . . . . . 194
Example 2.12. Activity Time Constraints . . . . . . . . . . . . . . . . . . . 199
Example 2.13. Progress Update and Target Schedules . . . . . . . . . . . . 201
Example 2.14. Summarizing Resource Utilization . . . . . . . . . . . . . . 207
Example 2.15. Resource Allocation . . . . . . . . . . . . . . . . . . . . . . 211
Example 2.16. Using Supplementary Resources . . . . . . . . . . . . . . . 218
Example 2.17. INFEASDIAGNOSTIC Option and Aggregate Resource Type223
Example 2.18. Variable Activity Delay . . . . . . . . . . . . . . . . . . . . 229
Example 2.19. Activity Splitting . . . . . . . . . . . . . . . . . . . . . . . 236
Example 2.20. Alternate Resources . . . . . . . . . . . . . . . . . . . . . . 240
Example 2.21. PERT Assumptions and Calculations . . . . . . . . . . . . . 247
Example 2.22. Scheduling Course - Teacher Combinations . . . . . . . . . 250
Example 2.23. Multiproject Scheduling . . . . . . . . . . . . . . . . . . . . 255
Example 2.24. Resource-Driven Durations and Resource Calendars . . . . . 263
Example 2.25. Resource-Driven Durations and Alternate Resources . . . . . 274
Example 2.26. Multiple Alternate Resources . . . . . . . . . . . . . . . . . 279
Example 2.27. Auxiliary Resources and Alternate Resources . . . . . . . . 281
Example 2.28. Use of the SETFINISHMILESTONE Option . . . . . . . . . 283
Example 2.29. Negative Resource Requirements . . . . . . . . . . . . . . . 290
Example 2.30. Auxiliary Resources and Negative Requirements . . . . . . . 292
Example 2.31. Resource-Driven Durations and Negative Requirements . . . 295
Statement and Option Cross-Reference Tables . . . . . . . . . . . . . . . . 298
REFERENCES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301
Chapter 2
The CPM Procedure
Overview
The CPM procedure can be used for planning, controlling, and monitoring a project.
A typical project consists of several activities that may have precedence and time con-
straints. Some of these activities may already be in progress; some of them may fol-
low different work schedules. All of the activities may compete for scarce resources.
PROC CPM enables you to schedule activities subject to all of these constraints.
PROC CPM enables you to dene calendars and specify holidays for the different
activities so that you can schedule around holidays and vacation periods. Once a
project has started, you can monitor it by specifying current information or progress
data that is used by PROC CPM to compute an updated schedule. You can compare
the new schedule with a baseline (or target) schedule.
For projects with scarce resources, you can determine resource-constrained sched-
ules. PROC CPM enables you to choose from a wide variety of options so that you
can control the scheduling process. Thus, you may choose to delay project comple-
tion time or use supplementary levels of resources, or alternate resources, if they are
available.
All project information is contained in SAS data sets. The input data sets used by
PROC CPM are as follows:
The Activity data set contains all activity-related information such as activity
name, precedence information, calendar used by the activity, progress infor-
mation, baseline (or target schedule) information, resource requirements, time
constraints, and any other information that you want to identify with each ac-
tivity.
The Resource data set species resource types, resource availabilities, resource
priorities, and alternate resources.
The Workday data set and the Calendar data set together enable you to specify
any type of work pattern during a week and within each day of the week.
The Holiday data set enables you to associate standard holidays and vacation
periods with each calendar.
The output data sets are as follows:
The Schedule data set contains the early, late, baseline, resource-constrained,
and actual schedules and any other activity-related information that is calcu-
lated by PROC CPM.
66
Chapter 2. The CPM Procedure
The Resource Schedule data set contains the schedules for each resource used
by an activity.
The Usage data set contains the resource usage for each of the resources used
in the project.
See Chapter 6, The PM Procedure, for an interactive procedure that enables you to
use a Graphical User Interface to enter and edit project information.
Getting Started
The basic steps necessary to schedule a project are illustrated using a simple example.
Consider a software development project in which an applications developer has the
software nished and ready for preliminary testing. In order to complete the project,
several activities must take place. Certain activities cannot start until other activities
have nished. For instance, the preliminary documentation must be written before it
can be revised and edited and before the Quality Assurance department (QA) can test
the software. Such constraints among the activities (namely, activity B can start after
activity A has nished) are referred to as precedence constraints. Given the prece-
dence constraints and estimated durations of the activities, you can use the critical
path method to determine the shortest completion time for the project.
Figure 2.1. Activity-On-Arc Network
Getting Started
67
The rst step in determining project completion time is to capture the relationships
between the activities in a convenient representation. This is done by using a network
diagram. Two types of network diagrams are popular for representing a project.
Activity-On-Arc (AOA) or Activity-On-Edge (AOE) diagrams show the activ-
ities on the arcs or edges of the network. Figure 2.1 shows the AOA represen-
tation for the software project. This method of representing a project is known
also as the arrow diagramming method (ADM). For projects represented in the
AOA format, PROC CPM requires the use of the following statements:
PROC CPM options ;
TAILNODE variable ;
HEADNODE variable ;
DURATION variable ;
Activity-On-Node (AON) or Activity-On-Vertex (AOV) diagrams show the ac-
tivities on nodes or vertices of the network. Figure 2.2 shows the AON repre-
sentation of the project. This method is known also as the precedence dia-
gramming method (PDM). The AON representation is more exible because it
enables you to specify nonstandard precedence relationships between the ac-
tivities (for example, you can specify that activity B starts ve days after the
start of activity A). PROC CPM requires the use of the following statements to
schedule projects that are represented using the AON format:
PROC CPM options ;
ACTIVITY variable ;
SUCCESSOR variables ;
DURATION variable ;
68
Chapter 2. The CPM Procedure
Figure 2.2. Activity-On-Node Network
The AON representation of the network is used in the remainder of this section to
illustrate some of the features of PROC CPM. The project data are input to PROC
CPM using a SAS data set. The basic project information is conveyed to PROC
CPM through the ACTIVITY, SUCCESSOR, and DURATION statements. Each
observation of the Activity data set species an activity in the project, its duration,
and its immediate successors. PROCCPMenables you to specify all of the immediate
successors in the same observation, or you can have multiple observations for each
activity, listing each successor in a separate observation. (Multiple variables in the
SUCCESSOR statement are used here.) PROC CPM enables you to use long activity
names. In this example, shorter names are used for the activities to facilitate data
entry; a variable, Descrpt, is used to specify a longer description for each activity.
Among other things, the procedure determines
the minimum time in which the project can be completed
the set of activities that is critical to the completion of the project in the mini-
mum amount of time
No displayed output is produced. However, the results are saved in an output data set
(the Schedule data set) that is shown in Figure 2.3.
The code for the entire program is as follows.
Getting Started
69
data software;
format Descrpt $20. Activity $8.
Succesr1-Succesr2 $8. ;
input Descrpt & Duration Activity $
Succesr1 $ Succesr2 $ ;
datalines;
Initial Testing 20 TESTING RECODE .
Prel. Documentation 15 PRELDOC DOCEDREV QATEST
Meet Marketing 1 MEETMKT RECODE .
Recoding 5 RECODE DOCEDREV QATEST
QA Test Approve 10 QATEST PROD .
Doc. Edit and Revise 10 DOCEDREV PROD .
Production 1 PROD . .
;
proc cpm data=software
out=intro1
interval=day
date=01mar04d;
id descrpt;
activity activity;
duration duration;
successor succesr1 succesr2;
run;
title Project Schedule;
proc print data=intro1;
run;
Project Schedule
Obs Activity Succesr1 Succesr2 Duration Descrpt
1 TESTING RECODE 20 Initial Testing
2 PRELDOC DOCEDREV QATEST 15 Prel. Documentation
3 MEETMKT RECODE 1 Meet Marketing
4 RECODE DOCEDREV QATEST 5 Recoding
5 QATEST PROD 10 QA Test Approve
6 DOCEDREV PROD 10 Doc. Edit and Revise
7 PROD 1 Production
Obs E_START E_FINISH L_START L_FINISH T_FLOAT F_FLOAT
1 01MAR04 20MAR04 01MAR04 20MAR04 0 0
2 01MAR04 15MAR04 11MAR04 25MAR04 10 10
3 01MAR04 01MAR04 20MAR04 20MAR04 19 19
4 21MAR04 25MAR04 21MAR04 25MAR04 0 0
5 26MAR04 04APR04 26MAR04 04APR04 0 0
6 26MAR04 04APR04 26MAR04 04APR04 0 0
7 05APR04 05APR04 05APR04 05APR04 0 0
Figure 2.3. Software Project Plan
70
Chapter 2. The CPM Procedure
In addition to the variables specied in the ACTIVITY, SUCCESSOR, DURATION,
and ID statements, the output data set contains the following new variables.
E
START
species the earliest time an activity can begin, subject to any time constraints and
the completion time of the preceding activity.
E
FINISH
species the earliest time an activity can be nished, assuming it starts at E
START.
L
START
species the latest time an activity can begin so that the project is not delayed.
L
FINISH
species the latest time an activity can be nished without delaying the project.
T
FLOAT
species the amount of exibility in the starting of a specic activity without delaying
the project:
T
FLOAT = L
START E
START = L
FINISH E
FINISH
F
FLOAT
species the difference between the early nish time of the activity and the early start
time of the activitys immediate successors.
In Figure 2.3 the majority of the tasks have a total oat value of 0. These events
are critical; that is, any delay in these activities will cause the project to be delayed.
Some of the activities have slack present, which means that they can be delayed by
that amount without affecting the project completion date. For example, the activ-
ity MEETMKT has a slack period of 19 days because there are 19 days between
01MAR04 and 20MAR04.
The INTERVAL= option in the PROC CPM statement enables you to specify the
durations of the activities in one of several possible units including days, weeks,
months, hours, and minutes. In addition, you can schedule activities around weekends
and holidays. (To skip weekends, you specify INTERVAL=WEEKDAY.) You can
also choose different patterns of work during a day or a week (for example, holidays
on Friday and Saturday) and different sets of holidays for the different activities in
the project. A calendar consists of a set of work schedules for a typical week and
a set of holidays. PROC CPM enables you to dene any number of calendars and
associate different activities with different calendars.
In the previous example, you saw that you could schedule your project by choosing a
project start date. You can also specify a project nish date if you have a deadline to
be met and you need to determine the latest start times for the different activities in the
project. You can set constraints on start or nish dates for specic activities within a
given project as well. For example, testing the software may have to be delayed until
the testing group nishes another project that has a higher priority. PROC CPM can
schedule the project subject to such restrictions through the use of the ALIGNDATE
and ALIGNTYPE statements. See Example 2.12 for more information on the use of
the ALIGNDATE and ALIGNTYPE statements.
Getting Started
71
For a project that is already in progress, you can incorporate the actual schedule of
the activities (some activities may already be completed while others may still be in
progress) to obtain a progress update. You can save the original schedule as a baseline
schedule and use it to compare against the current schedule to determine if any of the
activities have taken longer than anticipated.
Quite often the resources needed to perform the activities in a project are available
only in limited quantities and may cause certain activities to be postponed due to
unavailability of the required resources. You can use PROC CPM to schedule the
activities in a project subject to resource constraints. A wide range of options enables
you to control the scheduling process. For example, you can specify resource or ac-
tivity priorities, set constraints on the maximum amount of delay that can be tolerated
for a given activity, enable activities to be preempted, specify alternate resources that
can be used instead of scarce resources, or indicate secondary levels of resources that
can be used when the primary levels are insufcient.
When an activity requires multiple resources, it is possible that each resource may
follow a different calendar and each may require varying amounts of work. PROC
CPM enables you to dene resource-driven durations for the activities. You can also
specify calendars for the resources. In either of these situations it is possible that
each resource used by an activity may have its own individual schedule. PROC CPM
enables you to save the resource schedules for the different activities in a Resource
Schedule data set, the RESOURCESCHED= data set.
In addition to obtaining a resource-constrained schedule in an output data set,
you can save the resource utilization summary in another output data set, the
RESOURCEOUT= data set. Several options enable you to control the amount of
information saved in this data set.
The CPM procedure enables you to dene activities in a multiproject environment
with multiple levels of nesting. You can specify a PROJECT variable that identies
the name or number of the project to which each activity belongs.
All the options available with the CPM procedure are discussed in detail in the fol-
lowing sections. Several examples illustrate most of the features.
72
Chapter 2. The CPM Procedure
Syntax
The following statements are used in PROC CPM:
PROC CPM options ;
ACTIVITY variable ;
ACTUAL / actual options ;
ALIGNDATE variable ;
ALIGNTYPE variable ;
BASELINE / baseline options ;
CALID variable ;
DURATION / duration options ;
HEADNODE variable ;
HOLIDAY variable / holiday options ;
ID variables ;
PROJECT variable / project options ;
RESOURCE variables / resource options ;
SUCCESSOR variables / lag options ;
TAILNODE variable ;
Functional Summary
The following tables outline the options available for the CPM procedure classied
by function.
Table 2.1. Activity Splitting Specications
Description Statement Option
split in-progress activities at TIMENOW ACTUAL TIMENOWSPLT
max. number of segments variable RESOURCE MAXNSEGMT=
min. segment duration variable RESOURCE MINSEGMTDUR=
enable splitting RESOURCE SPLITFLAG
Table 2.2. Baseline or Target Schedule Specications
Description Statement Option
baseline nish date variable BASELINE B
FINISH=
baseline start date variable BASELINE B
START=
schedule to compare with baseline BASELINE COMPARE=
schedule to use as baseline BASELINE SET=
schedule to update baseline BASELINE UPDATE=
Functional Summary
73
Table 2.3. Calendar Specications
Description Statement Option
calendar variable CALID
holiday variable HOLIDAY
holiday duration variable HOLIDAY HOLIDUR=
holiday nish variable HOLIDAY HOLIFIN=
Table 2.4. Data Set Specications
Description Statement Option
calendar input data set PROC CPM CALEDATA=
activity input data set PROC CPM DATA=
holiday input data set PROC CPM HOLIDATA=
schedule output data set PROC CPM OUT=
resource availability input data set PROC CPM RESOURCEIN=
resource schedule output data set PROC CPM RESOURCESCHED=
resource usage output data set PROC CPM RESOURCEOUT=
workday input data set PROC CPM WORKDATA=
Table 2.5. Duration Control Specications
Description Statement Option
workday length PROC CPM DAYLENGTH=
workday start PROC CPM DAYSTART=
duration unit PROC CPM INTERVAL=
duration multiplier PROC CPM INTPER=
treatment of milestone PROC CPM SETFINISHMILESTONE
duration variable DURATION
nish variable DURATION FINISH=
override specied duration DURATION OVERRIDEDUR
start variable DURATION START=
work variable RESOURCE WORK=
Table 2.6. Lag Specications
Description Statement Option
alphanumeric lag duration calendar SUCCESSOR ALAGCAL=
lag variables SUCCESSOR LAG=
numeric lag duration calendar SUCCESSOR NLAGCAL=
Table 2.7. Miscellaneous Options
Description Statement Option
suppress warning messages PROC CPM SUPPRESSOBSWARN
x L
START
include free oat RESOURCE F
FLOAT
set unscheduled S
START and S
START
exclude early start schedule RESOURCE NOE
START
exclude free oat RESOURCE NOF
FLOAT
exclude late start schedule RESOURCE NOL
START
exclude resource variables RESOURCE NORESOURCEVARS
exclude total oat RESOURCE NOT
FLOAT
include resource variables RESOURCE RESOURCEVARS
include total oat RESOURCE T
FLOAT
set unscheduled S
START and S
FINISH to
missing
RESOURCE UNSCHEDMISS
update unscheduled S
START, S
FINISH=
actual start variable ACTUAL A
START=
assume automatic completion ACTUAL AUTOUPDT
enable actual time to fall in a non-work period ACTUAL FIXASTART
do not assume automatic completion ACTUAL NOAUTOUPDT
percentage complete variable ACTUAL PCTCOMP=
remaining duration variable ACTUAL REMDUR=
show oat for all activities ACTUAL SHOWFLOAT
current date ACTUAL TIMENOW=
Table 2.13. Resource Variable Specications
Description Statement Option
resource variables RESOURCE
observation type variable RESOURCE OBSTYPE=
resource availability date/time variable RESOURCE PERIOD=
alternate resource specication variable RESOURCE RESID=
work variable RESOURCE WORK=
Table 2.14. Resource Allocation Control Options
Description Statement Option
delay variable RESOURCE ACTDELAY=
activity priority variable RESOURCE ACTIVITYPRTY=
use alternate resources before supplementary
levels
RESOURCE ALTBEFORESUP
wait until L
RESOURCE AROUTCAL=
include availability prole for each resource RESOURCE AVPROFILE
cumulative usage for consumable resources RESOURCE CUMUSAGE
include early start prole for each resource RESOURCE ESPROFILE
exclude unscheduled activities in prole RESOURCE EXCLUNSCHED
include unscheduled activities in prole RESOURCE INCLUNSCHED
save observations for total usage RESOURCE TOTUSAGE
include late start prole for each resource RESOURCE LSPROFILE
maximum value of
TIME
RESOURCE MAXDATE=
maximum number of observations RESOURCE MAXOBS=
minimum value of
TIME
RESOURCE MINDATE=
numeric calendar for
TIME
RESOURCE NROUTCAL=
include resource constrained prole RESOURCE RCPROFILE
unit of difference between consecutive
TIME
values
RESOURCE ROUTINTERVAL=
difference between consecutive
TIME
values
RESOURCE ROUTINTPER=
use a continuous calendar for
TIME
RESOURCE ROUTNOBREAK
Table 2.16. RESOURCESCHED= Data Set Options
Description Statement Option
add activity or resource calendar RESOURCE ADDCAL
include WBS Code PROJECT RSCHEDWBS
include order variables PROJECT RSCHEDORDER
id variables RESOURCE RSCHEDID=
Table 2.17. Time Constraint Specications
Description Statement Option
alignment date variable ALIGNDATE
alignment type variable ALIGNTYPE
project start date PROC CPM DATE=
project nish date PROC CPM FBDATE=
nish before DATE= value PROC CPM FINISHBEFORE
PROC CPM Statement
77
PROC CPM Statement
PROC CPM options ;
The following options can appear in the PROC CPM statement.
ADDACT
ADDALLACT
EXPAND
indicates that an observation is to be added to the Schedule output data set (and the
Resource Schedule output data set) for each activity that appears as a value of the
variables specied in the SUCCESSOR or PROJECT statements without appearing
as a value of the variable specied in the ACTIVITY statement. If the PROJECT
statement is used, and the activities do not have a single common parent, an ob-
servation is also added to the Schedule data set containing information for a single
common parent dened by the procedure.
CALEDATA=SAS-data-set
CALENDAR=SAS-data-set
identies a SAS data set that species the work pattern during a standard week for
each of the calendars that are to be used in the project. Each observation of this data
set (also referred to as the Calendar data set) contains the name or the number of the
calendar being dened in that observation, the names of the shifts or work patterns
used each day, and, optionally, a standard workday length in hours. For details on the
structure of this data set, see the Multiple Calendars section on page 115. The work
shifts referred to in the Calendar data set are dened in the Workday data set. The
calendars dened in the Calendar data set can be identied with different activities in
the project.
COLLAPSE
creates only one observation per activity in the output data set when the input data
set for a network in AON format contains multiple observations for the same activity.
Note that this option is allowed only if the network is in AON format.
Often, the input data set may have more than one observation per activity (especially
if the activity has several successors). If you are interested only in the schedule
information about the activity, there is no need for multiple observations in the output
data set for this activity. Use the COLLAPSE option in this case.
DATA=SAS-data-set
names the SAS data set that contains the network specication and activity informa-
tion. If the DATA= option is omitted, the most recently created SAS data set is used.
This data set (also referred to in this chapter as the Activity data set) contains all of
the information that is associated with each activity in the network.
DATE=date
species the SAS date, time, or datetime that is to be used as an alignment date
for the project. If neither the FINISHBEFORE option nor any other alignment op-
tions are specied, then the CPM procedure schedules the project to start on date. If
date is a SAS time value, the value of the INTERVAL= parameter should be HOUR,
MINUTE, or SECOND; if it is a SAS date value, interval should be DAY, WEEKDAY,
78
Chapter 2. The CPM Procedure
WORKDAY, WEEK, MONTH, QTR, or YEAR; and if it is a SAS datetime value,
interval should be DTWRKDAY, DTDAY, DTHOUR, DTMINUTE, DTSECOND,
DTWEEK, DTMONTH, DTQTR, or DTYEAR.
DAYLENGTH=daylength
species the length of the workday. On each day, work is scheduled starting at the
beginning of the day as specied in the DAYSTART= option and ending daylength
hours later. The DAYLENGTH= value should be a SAS time value. The default value
of daylength is 24 if the INTERVAL= option is specied as DTDAY, DTHOUR,
DTMINUTE, or DTSECOND, and the default value of daylength is 8 if the
INTERVAL= option is specied as WORKDAY or DTWRKDAY. If
INTERVAL=DAY or WEEKDAY and the value of daylength is less than 24,
then the schedule produced is in SAS datetime values. For other values of the
INTERVAL= option, the DAYLENGTH= option is ignored.
DAYSTART=daystart
species the start of the workday. The DAYSTART= value should be a SAS time
value. This parameter should be specied only when interval is one of the following:
DTDAY, WORKDAY, DTWRKDAY, DTHOUR, DTMINUTE, or DTSECOND; in
other words, this parameter should be specied only if the schedule produced by the
CPM procedure is in SAS datetime values. The default value of daystart is 9 a.m. if
INTERVAL is WORKDAY; otherwise, the value of daystart is equal to the time part
of the SAS datetime value specied for the DATE= option.
FBDATE=fbdate
species a nish-before date that can be specied in addition to the DATE= option. If
the FBDATE= option is not given but the FINISHBEFORE option is specied, then
fbdate = date. Otherwise, fbdate is equal to the project completion date. If fbdate
is given in addition to the DATE= and FINISHBEFORE options, then the minimum
of the two dates is used as the required project completion date. See the Scheduling
Subject to Precedence Constraints section on page 106 for details on how the proce-
dure uses the date and fbdate to compute the early and late start schedules.
FINISHBEFORE
species that the project be scheduled to complete before the date given in the DATE=
option.
FIXFINISH
species that all nish tasks are to be constrained by their respective early nish
times. In other words, the late nish times of all nish tasks do not oat to the project
completion time.
HOLIDATA=SAS-data-set
HOLIDAY=SAS-data-set
identies a SAS data set that species holidays. These holidays can be associated
with specic calendars that are also identied in the HOLIDATA= data set (also re-
ferred to as the Holiday data set). The HOLIDATA= option must be used with a
HOLIDAY statement that species the variable in the SAS data set that contains the
start time of holidays. Optionally, the data set can include a variable that species the
length of each holiday or a variable that identies the nish time of each holiday (if
PROC CPM Statement
79
the holidays are longer than one day). For projects involving multiple calendars, this
data set can also include the variable specied by the CALID statement that identies
the calendar to be associated with each holiday. See the Multiple Calendars section
on page 115 for further information regarding holidays and multiple calendars.
INTERVAL=interval
requests that each unit of duration be measured in interval units. Possible values for
interval are DAY, WEEK, WEEKDAY, WORKDAY, MONTH, QTR, YEAR, HOUR,
MINUTE, SECOND, DTDAY, DTWRKDAY, DTWEEK, DTMONTH, DTQTR,
DTYEAR, DTHOUR, DTMINUTE, and DTSECOND. The default value is based
on the format of the DATE= parameter. See the Using the INTERVAL= Option
section on page 107 for further information regarding this option.
INTPER=period
requests that each unit of duration be equivalent to period units of duration. The
default value is 1.
NACTS=nacts
species the number of activities for which memory is allocated in core by the pro-
cedure. If the number of activities exceeds nacts, the procedure uses a utility data set
for storing the activity array. The default value for nacts is set to nobs, if the network
is specied in AOA format, and to nobs(nsucc+1), if the network is specied in
AON format, where nobs is the number of observations in the Activity data set and
nsucc is the number of variables specied in the SUCCESSOR statement.
NADJ=nadj
species the number of precedence constraints (adjacencies) in the project network.
If the number of adjacencies exceeds nadj, the procedure uses a utility data set for
storing the adjacency array. The default value of nadj is set to nacts if the network is
in AON format, and it is set to nacts2 if the network is in AOA format.
NNODES=nnodes
species the size of the symbolic table used to look up the activity names (node
names) for the network specication in AON (AOA) format. If the number of distinct
names exceeds nnodes, the procedure uses a utility data set for storing the tree used
for the table lookup. The default value for nnodes is set to nobs2 if the network is
specied in AOA format and to nobs(nsucc+1) if the network is specied in AON
format, where nobs is the number of observations in the Activity data set and nsucc
is the number of variables specied in the SUCCESSOR statement.
NOUTIL
species that the procedure should not use utility data sets for memory management.
By default, the procedure resorts to the use of utility data sets and swaps between core
memory and utility data sets as necessary if the number of activities or precedence
constraints or resource requirements in the input data sets is larger than the number
of each such entity for which memory is initially allocated in core. Specifying this
option causes the procedure to increase the memory allocation instead of using a
utility data set; if the problem is too large to t in core memory, PROC CPM will
stop with an error message.
80
Chapter 2. The CPM Procedure
NRESREQ=nres
species the number of distinct resource requirements corresponding to all activities
and resources in the project. The default value of nres is set to nobsnresvar 0.25,
where nobs is the number of observations in the Activity data set, and nresvar is the
number of RESOURCE variables in the Activity data set.
OUT=SAS-data-set
species a name for the output data set that contains the schedule determined by
PROC CPM. This data set (also referred to as the Schedule data set) contains all of
the variables that were specied in the Activity data set to dene the project. Every
observation in the Activity data set has a corresponding observation in this output
data set. If PROC CPM is used to determine a schedule that is not subject to any
resource constraints, then this output data set contains the early and late start sched-
ules; otherwise, it also contains the resource-constrained schedule. See the OUT=
Schedule Data Set section on page 113 for information about the names of the new
variables in the data set. If the OUT= option is omitted, the SAS system creates a
data set and names it according to the DATAn naming convention.
RESOURCEIN=SAS-data-set
RESIN=SAS-data-set
RIN=SAS-data-set
RESLEVEL=SAS-data-set
names the SAS data set that contains the levels available for the different resources
used by the activities in the project. This data set also contains information about
the type of resource (replenishable or consumable), the calendar associated with each
resource, the priority for each resource, and lists, for each resource, all the alternate
resources that can be used as a substitute. In addition, this data set indicates whether
or not the resource rate affects the duration. The specication of the RESIN= data set
(also referred to as the Resource data set) indicates to PROC CPM that the schedule
of the project is to be determined subject to resource constraints. For further infor-
mation about the format of this data set, see the RESOURCEIN= Input Data Set
section on page 126.
If this option is specied, you must also use the RESOURCE statement to identify
the variable names for the resources to be used for resource-constrained scheduling.
In addition, you must specify the name of the variable in this data set (using the
PERIOD= option in the RESOURCE statement) that contains the dates from which
the resource availabilities in each observation are valid. Furthermore, the data set
must be sorted in order of increasing values of this period variable.
RESOURCEOUT=SAS-data-set
RESOUT=SAS-data-set
ROUT=SAS-data-set
RESUSAGE=SAS-data-set
names the SAS data set in which you can save resource usage proles for each of
the resources specied in the RESOURCE statement. This data set is also referred
to as the Usage data set. In the Usage data set, you can save the resource usage by
time period for the early start, late start, and resource-constrained schedules, and the
surplus level of resources remaining after resource allocation is performed.
PROC CPM Statement
81
By default, it provides the usage proles for the early and late start schedules if re-
source allocation is not performed. If resource allocation is performed, this data set
also provides usage proles for the resource-constrained schedule and a prole of the
level of remaining resources.
You can control the types of proles to be saved by using the ESPROFILE (early
start usage), LSPROFILE (late start usage), RCPROFILE (resource-constrained us-
age), or AVPROFILE (resource availability after resource allocation) options in the
RESOURCE statement. You can specify any combination of these four options.
You can also specify the ALL option to indicate that all four options (ESPROFILE,
LSPROFILE, RCPROFILE, AVPROFILE) are to be in effect. For details about
variable names and the interpretation of the values in this data set, see the section
RESOURCEOUT= Usage Data Set on page 142.
RESOURCESCHED=SAS-data-set
RESSCHED=SAS-data-set
RSCHEDULE=SAS-data-set
RSCHED=SAS-data-set
names the SAS data set in which you can save the schedules for each resource used
by any activity. This option is valid whenever the RESOURCE statement is used to
specify any resource requirements. The resulting data set is especially useful when
resource-driven durations or resource calendars cause the resources used by an activ-
ity to have different schedules.
SETFINISHMILESTONE
species that milestones (zero duration activities) should have the same start and n-
ish times as the nish time of their predecessor. In other words, this option enables
milestones that mark the end of the preceding activity to coincide with its nish time.
By default, if a milestone M is a successor to an activity that nishes at the end of
the day (say 15Mar2004), the start and nish times for the milestone are specied
as the beginning of the next day (16Mar2004). This corresponds to the denition of
start times in the CPM procedure: all start times indicate the beginning of the date
specied. For zero duration activities, the nish time is dened to be the same as
the start time. The SETFINISHMILESTONE option species that the start and nish
times for the milestone M should be specied as 15Mar2004, with the interpretation
that the milestones schedule corresponds to the end of the day. There may be excep-
tions to this denition if there are special alignment constraints on the milestone. For
details, see the Finish Milestones section on page 111.
SUPPRESSOBSWARN
turns off the display of warnings and notes for every observation with invalid or miss-
ing specications.
WORKDATA=SAS-data-set
WORKDAY=SAS-data-set
identies a SAS data set that denes the work pattern during a standard working day.
Each numeric variable in this data set (also referred to as the Workday data set) is
assumed to denote a unique shift pattern during one working day. The variables must
82
Chapter 2. The CPM Procedure
be formatted as SAS time values and the observations are assumed to specify, alter-
nately, the times when consecutive shifts start and end. See the Multiple Calendars
section on page 115 for a description of this data set.
XFERVARS
indicates that all relevant variables are to be copied from the Activity data set to the
Schedule data set. This includes all variables used in the ACTUAL statement, the
ALIGNDATE and ALIGNTYPE statements, the SUCCESSOR statement, and the
RESOURCE statement.
ACTIVITY Statement
ACTIVITY variable;
ACT variable;
The ACTIVITY statement is required when data are input in an AON format; this
statement identies the variable that contains the names of the nodes in the net-
work. The activity associated with each node has a duration equal to the value of
the DURATION variable. The ACTIVITY variable can be character or numeric be-
cause it is treated symbolically. Each node in the network must be uniquely dened.
The ACTIVITY statement is also supported in the Activity-on-Arc format. The
ACTIVITY variable is used to uniquely identify the activity specied between two
nodes of the network. In the AOA format, if the ACTIVITY statement is not speci-
ed, each observation in the Activity data set is treated as a new activity.
ACTUAL Statement
ACTUAL / options ;
The ACTUAL statement identies variables in the Activity data set that contain
progress information about the activities in the project. For a project that is already in
progress, you can describe the actual status of any activity by specifying the activitys
actual start, actual nish, remaining duration, or percent of work completed. At least
one of the four variables (A
START, A
START, A
FINISH, A
FINISH=variable
AF=variable
identies a variable in the Activity data set that species the actual nish times of
activities that are already completed. The actual nish time of an activity must be
less than TIMENOW.
A
START=variable
AS=variable
identies a variable in the Activity data set that species the actual start times of
activities that are in progress or that are already completed. Note that the actual start
time of an activity must be less than TIMENOW.
AUTOUPDT
requests that PROC CPM should assume automatic completion (or start) of activities
that are predecessors to activities already completed (or in progress). For example, if
activity B is a successor of activity A, and B has an actual start time (or actual nish
time or both) specied, while A has missing values for both actual start and actual
nish times, then the AUTOUPDT option causes PROC CPM to assume that A must
have already nished. PROC CPM then assigns activity A an actual start time and
an actual nish time consistent with the precedence constraints. The AUTOUPDT
option is the default.
ESTIMATEPCTC
ESTPCTC
ESTPCTCOMP
ESTPROG
indicates that a variable named PCT
START and A
FINISH variables
or computed on the basis of the REMDUR or PCTCOMP variables and TIMENOW)
are assumed to have started; all other activities have an implicit start time that is
84
Chapter 2. The CPM Procedure
greater than or equal to TIMENOW. This option requires you to enter the progress
information for all the activities that have started or are complete; an activity is as-
sumed to be pending until one of the progress variables indicates that it has started.
PCTCOMP=variable
PCTCOMPLETE=variable
PCOMP=variable
identies a variable in the Activity data set that species the percentage of the work
that has been completed for the current activity. The values for this variable must be
between 0 and 100. A value of 0 for this variable means that the current activity has
not yet started. A value of 100 means that the activity is already complete. Once
again, the value of the TIMENOW= option is used as a reference point to resolve the
values specied for the PCTCOMP variable. See the Progress Updating section on
page 122 for more information.
REMDUR=variable
RDURATION=variable
RDUR=variable
identies a variable in the Activity data set that species the remaining duration of
activities that are in progress. The values of this variable must be nonnegative: a
value of 0 for this variable means that the activity in that observation is completed,
while a value greater than 0 means that the activity is not yet complete (the remaining
duration is used to revise the estimate of the original duration). The value of the
TIMENOW parameter is used to determine an actual start time or an actual nish
time or both for activities based on the value of the remaining duration. See the
Progress Updating section on page 122 for further information.
SHOWFLOAT
This option in the ACTUAL statement indicates that PROC CPM should allow activ-
ities that are completed or in progress to have nonzero oat. By default, all activities
that are completed or in progress have the late start schedule set to be equal to the
early start schedule and thus have both total oat and free oat equal to 0. If the
SHOWFLOAT option is specied, the late start schedule is computed for in-progress
and completed activities using the precedence and time constraints during the back-
ward pass.
TIMENOW=timenow
CURRDATE=timenow
species the SAS date, time, or datetime value that is used as a reference point to
resolve the values of the remaining duration and percent completion times when the
ACTUAL statement is used. It can be thought of as the instant at the beginning of the
specied date, when a snapshot of the project is taken; the actual start times or nish
times or both are specied for all activities that have started or have been completed
by the end of the previous day. If an ACTUAL statement is used without specication
of the TIMENOW= option, the default value is set to be the time period following the
maximum of all the actual start and nish times that have been specied; if there are
no actual start or nish times, then TIMENOW is set to be equal to the current date.
See the Progress Updating section on page 122 for further information regarding
the TIMENOW= option and the ACTUAL statement.
ALIGNTYPE Statement
85
TIMENOWSPLT
indicates that activities that are in progress at TIMENOW can be split at TIMENOW
if they cause resource infeasibilities. During resource allocation, any activities with
values of E
START less than TIMENOW are scheduled even if there are not enough
resources (a warning message is printed to the log if this is the case). This is true even
for activities that are in progress. The TIMENOWSPLT option permits an activity to
be split into two segments at TIMENOW, allowing the second segment of the activity
to be scheduled later when resource levels permit. See the Activity Splitting section
on page 135 for information regarding activity segments. Note that activities with an
alignment type of MS or MF are not allowed to be split; also, activities without
resource requirements will not be split.
ALIGNDATE Statement
ALIGNDATE variable ;
DATE variable ;
ADATE variable ;
The ALIGNDATE statement identies the variable in the Activity data set that speci-
es the dates to be used to constrain each activity to start or nish on a particular date.
The ALIGNDATE statement is used in conjunction with the ALIGNTYPE statement,
which species the type of alignment. A missing value for the variables specied in
the ALIGNDATE statement indicates that the particular activity has no restriction
imposed on it.
PROC CPM requires that if the ALIGNDATE statement is used, then all start activ-
ities (activities with no predecessors) have nonmissing values for the ALIGNDATE
variable. If any start activity has a missing ALIGNDATE value, it is assumed to start
on the date specied in the PROC CPM statement (if such a date is given) or, if no
date is given, on the earliest specied start date of all start activities. If none of the
start activities has a start date specied and a project start date is not specied in the
PROC CPM statement, the procedure stops execution and returns an error message.
See the Time-Constrained Scheduling section on page 110 for information on how
the variables specied in the ALIGNDATE and ALIGNTYPE statements affect the
schedule of the project.
ALIGNTYPE Statement
ALIGNTYPE variable ;
ALIGN variable ;
ATYPE variable ;
The ALIGNTYPE statement is used to specify whether the date value in the
ALIGNDATE statement is the earliest start date, the latest nish date, and so forth,
for the activity in the observation. The values allowed for the variable specied in the
ALIGNTYPE statement are specied in Table 2.18.
86
Chapter 2. The CPM Procedure
Table 2.18. Valid Values for the ALIGNTYPE Variable
Value Type of Alignment
SEQ Start equal to
SGE Start greater than or equal to
SLE Start less than or equal to
FEQ Finish equal to
FGE Finish greater than or equal to
FLE Finish less than or equal to
MS Mandatory start equal to
MF Mandatory nish equal to
If an ALIGNDATE statement is specied without an ALIGNTYPE statement, all of
the activities are assumed to have an aligntype of SGE. If an activity has a nonmiss-
ing value for the ALIGNDATE variable and a missing value for the ALIGNTYPE
variable, then the aligntype is assumed to be SGE. See the Time-Constrained
Scheduling section on page 110 for information on how the ALIGNDATE and
ALIGNTYPE variables affect project scheduling.
BASELINE Statement
BASELINE / options ;
The BASELINE statement enables you to save a specic schedule as a baseline or
target schedule and compare another schedule, such as an updated schedule or re-
source constrained schedule, against it. The schedule that is to be saved as a baseline
can be specied either by explicitly identifying two numeric variables in the input
data set as the B
START and B
START and B
START
and B
FINISH variables in the Activity data set does not initiate baseline processing.
The following options can be specied in the BASELINE statement after a slash (/).
B
FINISH=variable
BF=variable
species the numeric-valued variable in the Activity data set that sets B
FINISH.
B
START=variable
BS=variable
species the numeric-valued variable in the Activity data set that sets B
START.
BASELINE Statement
87
COMPARE=schedule
compares a specic schedule (EARLY, LATE, RESOURCE or ACTUAL) in the
Activity data set with the baseline schedule. The COMPARE option is valid only
if the input data set already has a B
START and a B
VAR and F
VAR and F
START and B
FINISH vari-
ables. The procedure sets B
START and B
START and B
START and
B
START, S
START, . . . , and
so on. They cannot be used to set the B
START and B
START and A
FINISH or S
START and S
START=A
START,
B
FINISH=A
START and B
START
and B
FINISH on the basis of the specied schedules only when the values of the
baseline variables are missing in the Activity data set. The UPDATE option is valid
only if the Activity data set already has B
START and B
in each data set (a warning message is then printed to the log). In the
Activity data set, this variable species the calendar used by the activity in the given
observation. Each calendar in the project is dened using the Workday, Calendar, and
Holiday data sets. Each observation of the Calendar data set denes a standard work
week through the shift patterns as dened by the Workday data set and a standard
day length; these values are associated with the calendar identied by the value of the
calendar variable in that observation. Likewise, each observation of the Holiday data
set denes a holiday for the calendar identied by the value of the calendar variable.
If there is no calendar variable in the Activity data set, all activities are assumed
to follow the default calendar. If there is no calendar variable in the Holiday data
set, all of the holidays specied are assumed to occur in all the calendars. If there
is no calendar variable in the Calendar data set, the rst observation is assumed to
dene the default work week (which is also followed by any calendar that might be
dened in the Holiday data set), and all subsequent observations are ignored. See the
Multiple Calendars section on page 115 for further information.
DURATION Statement
DURATION variable / options ;
DUR variable ;
The DURATIONstatement identies the variable in the Activity data set that contains
the length of time necessary to complete the activity. If the network is input in AOA
format, then the variable identies the duration of the activity denoted by the arc
joining the TAILNODE and the HEADNODE. If the network is input in AON format,
then the variable identies the duration of the activity specied in the ACTIVITY
statement. The variable specied must be numeric. The DURATION statement must
be specied. The values of the DURATION variable are assumed to be in interval
units, where interval is the value of the INTERVAL= option.
If you want the procedure to compute the durations of the activities based on specied
start and nish times, you can specify the start and nish times in the Activity data set,
identied by the variables specied in the START= and FINISH= options. By default,
the computed duration is used only if the value of the DURATION variable is missing
for that activity. Note that the duration is computed in units of the INTERVAL=
parameter, taking into account the calendar dened for the activity.
In addition to specifying a xed duration for an activity, you can specify the amount
of work required (in units of the INTERVAL parameter) from each resource for a
given activity. The WORK variable enables you to specify resource-driven durations
HOLIDAY Statement
89
for an activity; these (possibly different) durations are used to calculate the length of
time required for the activity to be completed.
The following options can be specied in the DURATION statement after a slash (/).
FINISH=variable
species a variable in the Activity data set that is to be used in conjunction with the
START variable to determine the activitys duration.
START=variable
species a variable in the Activity data set that is to be used in conjunction with the
FINISH variable to determine the activitys duration.
OVERRIDEDUR
species that if the START= and FINISH= values are not missing, the duration com-
puted from these values is to be used in place of the duration specied for the activity.
In other words, the computed duration is used in place of the duration specied for
the activity.
HEADNODE Statement
HEADNODE variable ;
HEAD variable ;
TO variable ;
The HEADNODE statement is required when data are input in AOA format. This
statement species the variable in the Activity data set that contains the name of the
node on the head of an arrow in the project network. This node is identied with
the event that signals the end of an activity on that arc. The variable specied can
be either a numeric or character variable because the procedure treats this variable
symbolically. Each node must be uniquely dened.
HOLIDAY Statement
HOLIDAY variable / options;
HOLIDAYS variable / options;
The HOLIDAY statement species the names of variables used to describe non-
workdays in the Holiday data set. PROC CPM accounts for holidays only when the
INTERVAL= option has one of the following values: DAY, WORKDAY, WEEKDAY,
DTDAY, DTWRKDAY, DTHOUR, DTMINUTE, or DTSECOND. The HOLIDAY
statement must be used with the HOLIDATA= option in the PROC CPM statement.
Recall that the HOLIDATA= option identies the SAS data set that contains a list of
the holidays and non-workdays around which you schedule your project. Holidays
are dened by specifying the start of the holiday (the HOLIDAY variable) and either
the length of the holiday (the HOLIDUR variable) or the nish time of the holiday
(the HOLIFIN variable). The HOLIDAY variable is mandatory with the HOLIDAY
statement; the HOLIDUR and HOLIFIN variables are optional.
The HOLIDAY and HOLIFIN variables must be formatted as SAS date or datetime
variables. If no format is associated with a HOLIDAY variable, it is assumed to be
90
Chapter 2. The CPM Procedure
formatted as a SAS date value. If the schedule of the project is computed as datetime
values (which is the case if INTERVAL is DTDAY, WORKDAY, and so on), the
holiday variables are interpreted as follows:
If the HOLIDAY variable is formatted as a date value, then the holiday is as-
sumed to start at the value of the DAYSTART= option on the day specied in
the observation and to end d units of interval later (where d is the value of the
HOLIDUR variable and interval is the value of the INTERVAL= option).
If the HOLIDAY variable is formatted as a datetime value, then the holiday is
assumed to start at the date and time specied and to end d units of interval
later.
The HOLIDUR and HOLIFIN variables are specied using the following options in
the HOLIDAY statement:
HOLIDUR=variable
HDURATION=variable
identies a variable in the Holiday data set that species the duration of the holiday.
The INTERVAL= option specied on the PROC CPM statement is used to interpret
the value of the holiday duration variables. Thus, if the duration of a holiday is
specied as 2 and the value of the INTERVAL= option is WEEKDAY, the length of
the holiday is interpreted as two weekdays.
HOLIFIN=variable
HOLIEND=variable
identies a variable in the Holiday data set that species the nish time of the holiday
dened in that observation. Note that if a particular observation contains both the
duration as well as the nish time of the holiday, only the nish time is used; the
duration is ignored.
ID Statement
ID variables ;
The ID statement identies variables not specied in the TAILNODE, HEADNODE,
ACTIVITY, SUCCESSOR, or DURATION statements that are to be included in the
Schedule data set. This statement is useful for carrying any relevant information
about each activity from the Activity data set to the Schedule data set.
PROJECT Statement
PROJECT variable / options;
PARENT variables / options;
The PROJECT statement species the variable in the Activity data set that identi-
es the project to which an activity belongs. This variable must be of the same type
and length as the variable dened in the ACTIVITY statement. A project can also
be treated as an activity with precedence and time constraints. In other words, any
value of the PROJECT variable can appear as a value of the ACTIVITY variable,
PROJECT Statement
91
and it can have specications for the DURATION, ALIGNDATE, ALIGNTYPE,
ACTUAL, RESOURCE, and SUCCESSOR variables. However, some of the inter-
pretations of these variables for a project (or supertask) may be different from the
corresponding interpretation for an activity at the lowest level. See the Multiproject
Scheduling section on page 146 for an explanation.
The following options can be specied in the PROJECT statement after a slash (/).
AGGREGATEPARENTRES
AGGREGATEP
RES
AGGREGPR
indicates that the resource requirements for all supertasks are to be used only for
aggregation purposes and not for resource-constrained scheduling.
DESCENDING
DESC
indicates that, in addition to the ascending sort variables (ES
ASC, LS
ASC, and
SS
ASC) that are requested by the ESORDER, LSORDER, and SSORDER options,
the corresponding descending sort variables (ES
DESC, LS
DESC, and SS
DESC,
respectively) are also to be added to the Schedule output data set.
ESORDER
ESO
indicates that a variable named ES
START.
IGNOREPARENTRES
IGNOREP
RES
IGNOREPR
indicates that the resource requirements for all supertasks are to be ignored.
LSORDER
LSO
indicates that a variable named LS
START and E
DUR, where
PROJ
DUR = E
FINISH - E
START
then the SEPCRIT option sets
L
FINISH E
START + PROJ
DUR
while the USEPROJDUR option sets
L
FINISH E
START + DUR
where DUR is the duration specied for the subproject in the Activity data set.
WBSCODE
WBS
ADDWBS
indicates that the CPM procedure is to compute a WBS code for the activities in the
project using the project hierarchy structure specied. This code is computed for each
activity and stored in the variable WBS
variable
in the Usage data set.
AVPROFILE
AVP
AVL
creates one variable in the Usage data set corresponding to each variable in the
RESOURCE statement. These new variables denote the amount of resources re-
maining after resource allocation. This option is ignored if resource allocation is not
performed.
AWAITDELAY
forces PROC CPM to wait until L
START+delay.
This option can be used to force activities with insufcient resources to start at
L
variable.
DELAY=delay
species the maximum amount by which an activity can be delayed due to lack of
resources. If E
START=5JUN04).
If the activity cannot be scheduled even on 7JUN04, then PROC CPM tries to sched-
ule it by using supplementary levels of resources, if available, or by using alternate re-
sources, if possible. If resources are still not sufcient, the procedure stops with an er-
ror message. The default value of the DELAY= option is assumed to be +INFINITY.
DELAYANALYSIS
SLIPINF
causes the addition of three new variables to the Schedule data set. The variables
are R
DELAY, DELAY
R and SUPPL
R. The R
START and the time when an activity rst enters the list of activities that are
available to be scheduled. (See the Scheduling Method section on page 131 for
a denition of this waiting list of activities.) Note that R
START E
START.
If several resources are insufcient, causing a delay in the activity, DELAY
R is the
name of the resource that rst causes an activity to be postponed.
The variable SUPPL
R contains the name of the rst resource that is used above the
primary level in order for an activity to be scheduled at S
START.
ESPROFILE
ESP
ESS
creates one variable in the Usage data set corresponding to each variable in the
RESOURCE statement. Each new variable denotes the resource usage based on the
early start schedule for the corresponding resource variable.
96
Chapter 2. The CPM Procedure
E
START
requests that the E
START and E
START and S
FINISH variables. This option is the default and can be turned off
using the NOE
START option.
EXCLUNSCHED
excludes the resource consumption corresponding to unscheduled activities from the
daily resource usage reported for each time period in the Usage data set. Note that
the Usage data set contains a variable named Rresname for each resource variable
resname. For each observation in this data set, each such variable contains the total
amount of resource (rate of usage for a consumable resource) used by all the activi-
ties that are active at the time period corresponding to that observation. By default,
this calculation includes even activities that are still unscheduled when resource con-
strained scheduling is stopped either by the STOPDATE= option or due to resource
infeasibilities. The EXCLUNSCHED option enables the exclusion of activities that
are still unscheduled. Note that the unscheduled activities are assumed to start as per
the early start schedule (unless the UPDTUNSCHED option is specied).
FILLUNSCHED
FILLMISSING
lls in S
START and S
START and S
START and
E
FINISH times for these activities. If the UPDTUNSCHED option is also speci-
ed, the procedure uses updated values.
F
FLOAT
requests that the Schedule data set include the F
START
requests that the L
START and L
START and S
FINISH variables. This option is the default and can be turned off
using the NOL
START option.
MAXDATE=maxdate
species the maximum value of the
TIME
START
requests that the E
START and E
START option
is ignored.
NOF
FLOAT
requests that the F
FLOAT is
always included in the Schedule data set.
NOL
START
requests that the Schedule data set does not include the late start schedule, namely,
the L
START and L
START. Also, if
resource allocation is not performed, the NOL
FLOAT
requests that the T
FLOAT is
always included in the Schedule data set.
NROUTCAL=calnum
species the number of the calendar to be used for incrementing the
TIME
variable
in the Usage data set.
OBSTYPE=variable
species a character variable in the Resource data set that contains the type identier
for each observation. Valid values for this variable are RESLEVEL, RESTYPE,
RESUSAGE, RESPRTY, SUPLEVEL, ALTRATE, ALTPRTY, RESRCDUR,
CALENDAR, MULTALT, MINARATE, and AUXRES. If OBSTYPE= is not
specied, then all observations in the data set are assumed to denote the levels of the
resources, and all resources are assumed to be replenishable and constraining.
PERIOD=variable
PER=variable
identies the variable in the RESOURCEIN= data set that species the date from
which a specied level of the resource is available for each observation with the
OBSTYPE variable equal to RESLEVEL. It is an error if the PERIOD= variable
has a missing value for any observation specifying the levels of the resources or if the
Resource data set is not sorted in increasing order of the PERIOD= variable.
100
Chapter 2. The CPM Procedure
RCPROFILE
RCP
RCS
creates one variable in the Usage data set corresponding to each variable in the
RESOURCE statement. Each new variable denotes the resource usage based on the
resource-constrained schedule for the corresponding resource variable. This option
is ignored if resource allocation is not performed.
RESCALINTERSECT
RESCALINT
RCI
species that an activity can be scheduled only during periods that are common work-
ing times for all resource calendars (corresponding to the resources used by that ac-
tivity) and the activitys calendar. This option is valid only if multiple calendars are
in use and if calendars are associated with individual resources. Use this option with
caution; if an activity uses resources that have mutually disjoint calendars, that activ-
ity can never be scheduled. For example, if one resource works a night shift while
another resource works a day shift, the two calendars do not have any common work-
ing time.
Note that only primary resources are included in the intersection; any alternate or
auxiliary resources are not included when determining the common working calendar
for the activity.
If you do not specify the RESCALINTERSECT option, and resources have indepen-
dent calendars, then the procedure schedules each resource using its own calendar.
Thus, an activity can have one resource working on a ve-day calendar, while an-
other resource is working on a seven-day calendar.
RESID=variable
species a variable in the RESOURCEIN= data set that indicates the name of the
resource variable for which alternate resource information or auxiliary resource in-
formation is being specied in that observation.
Observations that indicate alternate resources are identied by the values ALTRATE
and ALTPRTY for the OBSTYPE variable. These values indicate whether the ob-
servation species a rate of substitution or a priority for substitution; the value of
the RESID variable in such an observation indicates the particular resource for which
alternate resource information is specied in that observation. Note that the specica-
tion of the RESID= option triggers the use of alternate resources. See the Specifying
Alternate Resources section on page 137 for further information.
Observations indicating auxiliary resources are identied by the value AUXRES for
the OBSTYPE variable. Such observations specify the name of the primary resource
as the value of the RESID variable and the rate of auxiliary resources needed for
every unit of the primary resource as values of the other resource variables. See the
Auxiliary Resources section on page 141 for further information.
RESOURCE Statement
101
RESOURCEVARS
RESVARSOUT
requests that the variables specied in the RESOURCE statement be included in the
Schedule data set. These include the RESOURCE variables identifying the resource
requirements, the activity priority variable, the activity delay variable, and any vari-
ables specifying activity splitting information. This option is the default and can be
turned off by the NORESVARSOUT option.
ROUTINTERVAL=routinterval
STEPINT=routinterval
species the units to be used to determine the time interval between two successive
values of the
TIME
START and S
START and
E
FLOAT
requests that the Schedule data set include the T
variable for the next observation. The total usage is computed taking
into account the relevant activity and resource calendars. Note that, by default, the
observations in the Usage data set specify the rate of usage for each resource at the
beginning of the current time period. The TOTUSAGE option species the product
of the rate and the time interval between two successive observations. To get both the
rate and the product, use the APPEND option.
SUCCESSOR Statement
103
UNSCHEDMISS
sets the S
START and S
START and S
START and S
FINISH times.
WORK=variable
identies a variable in the Activity data set that species the total amount of work re-
quired by one unit of a resource. This work is represented in units of the INTERVAL
parameter. The procedure uses the rate specied for the resource variable to compute
the duration of the activity for that resource. Thus, if the value of the WORK vari-
able is 10, and the value of the resource variable R1 is 2, then the activity requires
5 interval units for the resource R1. For details, see the Resource-Driven Durations
and Resource Calendars section on page 125.
SUCCESSOR Statement
SUCCESSOR variables / lag options ;
SUCC variables / lag options ;
The SUCCESSOR statement is required when data are input in an AON format. This
statement species the variables that contain the names of the immediate successor
nodes (activities) to the ACTIVITY node. These variables must be of the same type
and length as those dened in the ACTIVITY statement.
If the project does not have any precedence relationships, it is not necessary to use
the SUCCESSOR statement. Thus, you can specify only the ACTIVITY statement
without an accompanying SUCCESSOR statement.
If the precedence constraints among the activities have some nonstandard relation-
ships, you can specify these using the LAG options. The following is a list of LAG
options.
ALAGCAL=calname
species the name of the calendar to be used for all lags. The default value for this
option is the DEFAULT calendar.
LAG=variables
species the variables in the Activity data set used to identify the lag relationship
(lag type, duration, and calendar) between the activity and its successor. The LAG
variables must be character variables. You can specify as many LAG variables as
there are SUCCESSOR variables; each SUCCESSOR variable is matched with the
corresponding LAG variable. You must specify the LAG variables enclosed in paren-
theses. In a given observation, the ith LAG variable species the type of relation
104
Chapter 2. The CPM Procedure
between the current activity (as specied by the ACTIVITY variable) and the activity
specied by the ith SUCCESSOR variable. If there are more LAG variables than
SUCCESSOR variables, the extra LAG variables are ignored; conversely, if there are
fewer LAG variables, the extra SUCCESSOR variables are all assumed to indicate
successors with a standard (nish-to-start) relationship.
In addition to the type of relation, you can also specify a lag duration and a lag
calendar in the same variable. The relation
lag
3 Ignored
A B SS
ORCPM
section on page 149. Table 2.24 in the Input Data Sets and Related
Variables section on page 150 lists all the variables used by the CPM procedure
and the data sets that contain them. Table 2.25 in the Missing Values in Input Data
Sets section on page 152 lists all of the variables in the different input data sets
and describes how PROC CPM treats missing values corresponding to each of them.
106
Chapter 2. The CPM Procedure
Finally, the FORMAT Specication section on page 153 underlines the importance
of associating the correct FORMAT specication with all the date-type variables, and
the Computer Resource Requirements section on page 154 indicates the storage
and time requirements of the CPM procedure.
Scheduling Subject to Precedence Constraints
The basic function of the CPM procedure is to determine a schedule of the activities
in a project subject to precedence constraints among them. The minimum amount of
information that is required for a successful invocation of PROC CPM is the network
information specied either in AON or AOA formats and the duration of each activity
in the network. The INTERVAL= option species the units of duration, and the
DATE= option species a start date for the project. If a start date is not specied for
the project, the schedule is computed as unformatted numerical values with a project
start date of 0. The DATE= option can be a SAS date, time, or datetime value (or
a number) and can be used to specify a start date for the project. In addition to the
start date of the project, you can specify a desired nish date for the project using the
FBDATE= option.
PROC CPM computes the early start schedule as well as the late start schedule for the
project. The project start date is used as the starting point for the calculation of the
early start schedule, while the project completion date is used in the computation of
the late start schedule. The early start time (E
START) is computed as L
FLOAT) is dened as
the maximum delay that can be allowed in an activity without delaying a successor
activity. Total oat (T
START or A
START
FS nish-to-start pef + ld
SS start-to-start pes + ld
SF start-to-nish pes + ld durB
FF nish-to-nish pef + ld durB
Note that the addition of the lag durations (ld) is in units following the lag calendar lc;
the subtraction of durB is in units of the activity Bs calendar. The backward pass to
determine the late start schedule is modied in a similar way to include lag durations
and calendars.
110
Chapter 2. The CPM Procedure
Time-Constrained Scheduling
You can use the DATE= and FBDATE= options in the PROC CPM statement (or
the DATE= option in conjunction with the FINISHBEFORE option) to impose start
and nish dates on the project as a whole. Often, you want to impose start or n-
ish constraints on individual activities within the project. The ALIGNDATE and
ALIGNTYPE statements enable you to do so. For each activity in the project, you
can specify a particular date (as the value of the ALIGNDATE variable) and whether
you want the activity to start on or nish before that date (by specifying one of sev-
eral alignment types as the value of the ALIGNTYPE variable). PROC CPM uses all
these dates in the computation of the early and late start schedules.
The following explanation best illustrates the restrictions imposed on the start or n-
ish times of an activity by the different types of alignment allowed. Let d denote
the value of the ALIGNDATE variable for a particular activity and let dur be the ac-
tivitys duration. If minsdate and maxfdate are used to denote the earliest allowed
start date and the latest allowed nish date, respectively, for the activity, then Table
2.22 illustrates the values of minsdate and maxfdate as a function of the value of the
ALIGNTYPE variable.
Once the minsdate and maxfdate dates have been calculated for all of the activities
in the project, the values of minsdate are used in the computation of the early start
schedule and the values of maxfdate are used in the computation of the late start
schedule.
Table 2.22. Determining Alignment Date Values with the ALIGNTYPE Statement
Keywords Alignment Type minsdate maxfdate
SEQ start equal d d + dur
SGE start greater than or equal d + innity
SLE start less than or equal innity d + dur
FEQ nish equal d dur d
FGE nish greater than or equal d dur + innity
FLE nish less than or equal innity d
MS mandatory start d d + dur
MF mandatory nish d dur d
For the rst six alignment types in Table 2.22, the value of minsdate species a lower
bound on the early start time and the value of maxfdate species an upper bound on
the late nish time of the activity. The early start time (E
START) of an activity is
computed as the maximum of its minsdate and the early nish times (E
FINISH)
of all its predecessors (E
FINISH=E
START) is computed as L
FINISH)
for each of the other activities in the network is computed as the minimum of its
maxfdate and the L
START time if there are constraints on the start times of certain activities in the
network (or constraints on the nish times of some successor activities) that make the
target completion date infeasible. In such cases, some of the activities in the network
have negative values for T
START, L
START, E
FINISH, L
FINISH, T
FLOAT, and
F
FLOAT.
If a resource-constrained schedule is obtained, however, the Schedule data set
contains two new variables named S
START and S
FINISH; the T
FLOAT and
F
FLOAT variables are omitted. You can request the omission of the E
START and
E
START
and L
DELAY, DELAY
R and SUPPL
R.
If resource-driven durations or resource calendars are in effect, the start and nish
times shown in the Schedule data set are computed as the minimum of the start times
for all resources for that activity and the maximum of the nish times for all resources
for that activity, respectively. For details see the Resource-Driven Durations and
Resource Calendars section on page 125.
If an ACTUAL statement is specied, the Schedule data set also contains the four
variables A
START, A
FINISH, A
START, A
FINISH,
E
START, E
FINISH, L
DUR
species the actual duration of the activity. This variable is included in the Schedule
data set only if the ACTUAL statement is used. The value for this variable is missing
unless the activity is completed and may be different from the duration of the activity
as specied by the DURATION variable. It is based on the values of the progress
variables. See the Progress Updating section on page 122 for further details.
A
FINISH
species the actual nish time of the activity, either as specied in the Activity data
set or as computed by PROC CPM on the basis of the progress variables specied.
114
Chapter 2. The CPM Procedure
This variable is included in the Schedule data set only if the ACTUAL statement is
used.
A
START
species the actual start time of the activity, either as specied in the Activity data set
or as computed by PROC CPM on the basis of the progress variables specied. This
variable is included in the Schedule data set only if the ACTUAL statement is used.
E
FINISH
species the completion time if the activity is started at the early start time.
E
START
species the earliest time the activity can be started. This is the maximum of the
maximum early nish time of all predecessor activities and any lower bound placed
on the start time of this activity by the alignment constraints.
F
FLOAT
species the free oat time, which is the difference between the early nish time of
the activity and the minimum early start time of the activitys immediate successors.
Consequently, it is the maximum delay that can be tolerated in the activity without
affecting the scheduling of a successor activity. The values of this variable are calcu-
lated in units of the INTERVAL= parameter.
L
FINISH
species the latest completion time of the activity. This is the minimum of the min-
imum late start time of all successor activities and any upper bound placed on the
nish time of the activity by the alignment constraints.
L
START
species the latest time the activity can be started. This is computed from the activ-
itys latest nish time.
S
FINISH
species the resource-constrained nish time of the activity. If resources are insuf-
cient and the procedure cannot schedule the activity, the value is set to missing, unless
the FILLUNSCHED option is specied.
S
START
species the resource-constrained start time of the activity. If resources are insuf-
cient and the procedure cannot schedule the activity, the value is set to missing, unless
the FILLUNSCHED option is specied.
STATUS
species the current status of the activity. This is a character valued variable. Possible
values for the status of an activity are Completed, In Progress, Infeasible or Pending;
the meanings are self-evident. If the project is scheduled subject to resource con-
straints, activities that are Pending are classied as Pending or Infeasible depending
on whether or not PROC CPM is able to determine a resource-constrained schedule
for the activity.
T
FLOAT
species the total oat time, which is the difference between the activity late n-
Multiple Calendars
115
ish time and early nish time. Consequently, it is the maximum delay that can be
tolerated in performing the activity and still complete the project on schedule. An
activity is said to be on the critical path if T
CAL
,
MON
,
TUE
,
WED
,
THU
,
FRI
, and
SAT
are used to indicate the work pattern that is followed on each day of the week. Valid
values for these variables are HOLIDAY, WORKDAY or, any shift variable name
dened in the Workday data set.
Note: A missing value for any of these variables is assumed to denote that the work
pattern for the corresponding day is the same as for the default calendar.
When interval is specied as DTDAY, WORKDAY, or DTWRKDAY, it is necessary
to know the length of a standard working day in order to be able to compute the
schedules consistently. For example, a given calendar may have an eight-hour day on
Monday, Tuesday, and Wednesday and a seven-hour day on Thursday and Friday. If
a given activity following that calendar has a duration of four days, does it mean that
its duration is equal to 8 4 = 32 hours or 7 4 = 28 hours? To avoid ambiguity,
a numeric variable named D
CAL
) can be used in this data set to identify the calendar to which each holiday
refers. A missing value for the HOLIDAY variable in an observation causes that
Multiple Calendars
119
observation to be ignored. If both the HOLIDUR and the HOLIFIN variables have
missing values in a given observation, the holiday is assumed to start at the date
and time specied for the HOLIDAY variable and last one unit of interval where the
INTERVAL= option has been specied as interval. If a given observation has valid
values for both the HOLIDUR and HOLIFIN variables, only the HOLIFIN variable
is used so that the holiday is assumed to start and end as specied by the HOLIDAY
and HOLIFIN variables, respectively. A missing value for the CALID variable causes
the holiday to be included in all of the calendars, including the default.
The HOLIDUR variable is a natural way of expressing vacation times as n workdays,
and the HOLIFIN variable is more useful for dening standard holiday periods, such
as the CHRISTMAS holiday from24DEC03 to 26DEC03 (both days inclusive). Note
that the HOLIDUR variable is assumed to be in units of interval and the procedure
uses the particular work pattern structure for the given calendar to compute the length
(nish time) of the holiday.
For example, consider the following Holiday data:
HOLISTA HOLIDUR HOLIFIN _CAL_
24DEC03 . 26DEC03 .
01JAN04 1 . 1
19JAN04 . . 2
29JAN04 3 . 2
29JAN04 3 . 3
Suppose calendars 1, 2, and 3 and the default calendar have been de-
ned as described earlier in the description of the Calendar and Workday data
sets. Recall that in this example INTERVAL=DTDAY, DAYSTART=09:00T, and
DAYLENGTH=08:00T. Because the schedule is computed as SAS datetime values
(since INTERVAL=DTDAY), the holiday values (specied here as SAS date values)
are converted to SAS datetime values. The rst observation in the Holiday data set
has a missing value for
CAL
START, A
START, A
FINISH, and A
DUR refer to
the values calculated by PROC CPM for the corresponding new variables added to
the Schedule data set.
The following is a list of some of the conventions used by PROC CPM in calculating
the revised duration:
If both as and af are specied, the revised duration is computed as the time,
excluding non-working periods, between as and af; in the Schedule data set, the
variable A
FINISH
to af.
If as is specied without af, PROC CPM uses remdur to compute the revised
duration as the sum of the elapsed duration and the remaining duration.
If as is specied and both af and remdur are missing, the revised duration is
computed on the basis of the elapsed duration and pctc.
If as is specied and af, remdur and pctc are not specied, the duration is not
revised. If the time lapse between as and TIMENOW is greater than or equal to
the duration of the activity, it is assumed to have nished at the appropriate time
(as + dur) and the Schedule data set has the appropriate values for A
START,
A
FINISH, and A
DUR.
If as is missing and af is valid, PROC CPM determines as on the basis of af
and the specied duration (remdur and pctc, if specied, are ignored.)
If as and af are both missing, the revised duration is determined on the basis of
remdur and pctc. If the activity has started (if pctc > 0 or remdur < dur), as is
set appropriately, and if it has also nished (which is the case if pctc = 100 or
remdur = 0), af is also set.
Using the preceding rules, PROC CPM attempts to determine actual start and nish
times for as many activities as possible using the information given for each activity.
The next question is: What about activities that have missing values for the actual
start and nish times? Suppose a given activity has a valid value for A
START
and is currently in progress. It seems logical for successors of this activity to have
missing values for A
START and A
START
and A
FINISH values for all activities that precede activities which have already
started. NOAUTOUPDT implies that only those activities that have explicit progress
information conrming their status are assumed to be in progress or completed; all
other activities are assumed to have an implicit start date that is greater than or equal
124
Chapter 2. The CPM Procedure
to TIMENOW. In other words, NOAUTOUPDT assumes that the precedence con-
straints may be overridden by the actual data. The default option is AUTOUPDT.
The scheduling algorithm treats the actual start and nish times as follows:
If A
START
during the forward pass, and the E
START +
the revised duration.
If A
FINISH or A
FINISH and the revised duration. This rule causes the late
start schedule to be the same as the early start schedule for completed or in-
progress activities. Thus, T
FLOAT and F
START is less than TIMENOW for an activity (and thus it is also the
same as A
COMP that contains the percent completion time for each activity in the
project.
Resource-Driven Durations and Resource Calendars
125
Resource-Driven Durations and Resource Calendars
The DURATION variable enables you to specify a xed duration for an activity.
The CPM procedure then assumes that all the resources for that activity are required
throughout the duration of that activity; further, the activity is assumed to follow the
work pattern specied by the activitys calendar. Suppose that there are multiple re-
sources required by an activity, each following a different calendar and each requiring
varying amounts of work. For example, a programming task may require 50 hours of
a programmers time and 20 hours of a testers time. Further, the programmer may
work full time on the tasks, while the tester, due to other commitments, may work
only half time on the same activity. The scheduling could be further complicated if
the tester and the programmer followed different calendars. Situations of this type
can be modeled using resource-driven durations and resource calendars.
The WORK variable in the Activity data set species the total amount of work re-
quired by one unit of a resource. Unlike the DURATION variable, which represents
a xed duration for an activity for all its resources, the WORK variable drives the
duration for each resource required by the activity using the resource rate specied.
You can specify different amounts of work for different resources by using different
observations to specify rates and total work for the different resources. Consider the
following data from an Activity data set:
ACT WORK PGMR TESTER
1 50 1 .
1 20 . .5
2 15 1 1
PGMR and TESTER are resource variables specifying the rate at which the respec-
tive resource is required (used) for the particular activity; WORK species the to-
tal number of hours (assuming that the INTERVAL parameter has been specied as
HOUR) of work required by each resource that has a rate specied in that observa-
tion. Thus, Activity 1 requires 50 hours of the resource PGMR and 20 hours of the
resource TESTER, while activity 2 requires 15 hours of each of the two resources.
Using the rates for the resources specied in the preceding data, the procedure deter-
mines the resource durations for activity 1 to be 50 hours for PGMR and 40 hours
for TESTER. Likewise, the resource durations for both resources are 15 hours for
activity 2.
In the forward and backward pass calculations, the procedure computes the sched-
ules for each resource and sets the activitys start (nish) time to be the minimum
(maximum) of the start (nish) times for all the resources.
Some activities may have a xed duration for some resources and a resource-driven
duration for other resources. For such activities, use the DURATION variable to
specify the xed duration and the WORK variable to specify the total amount of
work required for the activity. If a particular observation has values specied for
both the WORK and DURATION variables, use the resource type information in the
Resource data set (described in the RESOURCEIN= Input Data Set section on page
126) to determine if the resource drives the duration of the activity.
126
Chapter 2. The CPM Procedure
Recall that the CALID variable in the Activity data set species the calendar that is
used by each activity in the project. In addition, you can also associate calendars with
the resources in the project. Resource calendars are specied in the Resource data set.
However, the CALID variable must be numeric for you to associate calendars with
resources; in other words, the calendars must be identied by numbers and not names.
Resource Usage and Allocation
Often the activities in a project use several resources. If you assume that these re-
sources are available in unlimited quantities, then the only restrictions on the start
and nish times of the activities in the project are those imposed by precedence con-
straints and dates specied for alignment of the activities. In most practical situations,
however, there are limitations on the availability of resources; as a result, neither the
early start schedule nor the late start schedule (nor any intermediate schedule for that
matter) may be feasible. In such cases, the project manager is faced with the task of
scheduling the activities in the project subject to constraints on resource availability
in addition to the precedence constraints and constraints on the start and nish times
of certain activities in the project. This problem is known as resource allocation.
You can use PROCCPMto schedule the activities in a project subject to resource con-
straints. To perform resource allocation, you must specify the resource requirements
for each activity in the project and also specify the amount of resources available on
each day under consideration. The resource requirements are given in the Activity
data set, with the variable names identied to PROC CPM through the RESOURCE
statement. The levels of resources available on different dates, as well as other in-
formation regarding the resources, such as the type of resource, the priority of the
resource, and so forth, are obtained from the RESOURCEIN= data set.
Specifying resource requirements is described in detail in the Specifying Resource
Requirements section on page 130, and the description of the format of the Resource
data set is given in the RESOURCEIN= Input Data Set section on page 126, which
follows. The Scheduling Method section on page 131 describes how you can use
the SCHEDRULE= and DELAY= options (and other options) in conjunction with
certain special observations in the Resource data set to control the process of resource
allocation to suit your needs. Subsequent sections describe the different scheduling
rules, supplementary resources, activity splitting, progress updating, and alternate
resources.
RESOURCEIN= Input Data Set
The RESOURCEIN= data set (referred to as the Resource data set) contains all of
the necessary information about the resources that are to be used by PROC CPM to
schedule the project. Typically, the Resource data set contains the resource variables
(numeric), a type identier variable (character) that identies the type of information
in each observation, a period variable (numeric and usually a SAS time, date, or
datetime variable), and a RESID variable that is used to specify alternate resources
and auxiliary resources.
The value of the type identier variable in each observation tells CPM how to
interpret that observation. Valid values for this variable are RESLEVEL, RESTYPE,
Resource Usage and Allocation
127
RESUSAGE, RESPRTY, SUPLEVEL, ALTPRTY, ALTRATE, RESRCDUR,
CALENDAR, MULTALT, MINARATE, and AUXRES. If the value of the type
identier variable in a particular observation is RESLEVEL, then that observation
contains the levels available for each resource from the time specied in the period
variable. Missing values are not allowed for the period variable in an observation
containing the levels of the resources. Note that, for consumable resources, the
observation indicates the total availability and not the increase in the availability.
Likewise, for replenishable resources, the observation indicates the new level and not
the change in the level of the resource.
Each resource can be classied as either consumable or replenishable. A consum-
able resource is one that is used up by the job (such as bricks or money), while a
replenishable resource becomes available again once a job using it is over (such as
manpower or machinery). If the value of the type identier variable is RESTYPE,
then that observation identies the nature (consumable or replenishable) of the re-
source. The observation contains a value 1 for a replenishable resource and a value 2
for a consumable one. A missing value in this observation is treated as 1. In fact, if
there is no observation in the Resource data set with the type identier variable equal
to RESTYPE, then all resources are assumed to be replenishable.
Sometimes, it may be useful to include resources in the project that are to be used
only for aggregation purposes. You can indicate that a given resource is to be used
for aggregation, and not for resource allocation, by specifying the values 3 or 4, de-
pending on whether the resource is replenishable or consumable. In other words, use
3 for replenishable aggregate resources and 4 for consumable aggregate resources.
Consumable resources are assumed to be used continuously throughout the dura-
tion of the activity at the rate specied in the Activity data set (as described in the
Specifying Resource Requirements section on page 130). For example, when you
specify a rate of 100 per day for bricks, the CPM procedure assumes that the activity
consumes bricks at the constant rate of 100 per day. Sometimes, you may wish to
allocate all of the resource at the beginning or end of an activity. For example, you
may pay an advance at the start of a contracted activity while the full payment is
made when the activity is completed. You can indicate such a prole of usage for a
consumable resource using the keyword RESUSAGE for the value of the type iden-
tier variable. Valid values for the resource variables in such an observation are 0, 1,
and 2. A value 0 indicates that the resource is used continuously at the specied rate
throughout the activitys duration, a value 1 indicates that the resource is required at
the beginning of the activity, and a value 2 species that the resource is used at the
end of the activity. A missing value in this observation is treated as 0.
One of the scheduling rules that can be specied using the SCHEDRULE= option is
RESPRTY, which requires ordering the resources according to some priority (details
are given in the Scheduling Rules section on page 133). If this option is used, there
must be an observation in the Resource data set with the type identier variable taking
the value RESPRTY. This observation species the ordering of the resources.
If the type identier variable is given as SUPLEVEL, the observation denotes the
amount of extra resource that is available for use throughout the duration of the
project. This extra resource is used only if the activity cannot be scheduled with-
128
Chapter 2. The CPM Procedure
out delaying it beyond its late start time. See the Secondary Levels of Resources
section on page 134 for details about the use of supplementary levels of resources in
conjunction with the DELAY= and ACTDELAY= options.
If the type identier variable is specied as ALTRATE, ALTPRTY, or AUXRES,
the Resource data set must also have a RESID variable that is used to identify the
name of a resource for which the current observation lists the possible alternate re-
sources or the required auxiliary resources. See the Specifying Alternate Resources
section on page 137 and the Auxiliary Resources section on page 141 for details.
If the value of the type identier variable is RESRCDUR, that observation species
the effect of the resource on an activitys duration. Valid values for the resource vari-
ables in such an observation are 0, 1, and 2. A value 0 indicates that the resource uses
a xed duration (specied by the DURATION variable); in other words, the activitys
duration is not affected by changing the rate of the resource. A value 1 indicates that
the WORK variable for an activity species the total amount of work required by the
resource that is used to calculate the time required by the resource to complete its
work on that activity; such a resource is referred to as a driving resource. The value 2
indicates a third type of resource; such a resource (referred to as a spanning resource)
is required throughout the activitys duration, no matter which resource is working
on it. For example, an activity might require 10 percent of a supervisor, or the use
of a particular room, throughout its duration. For such an activity, the duration used
for the spanning resource is computed after determining the span of the activity for
all the other resources.
If the value of the type identier variable is CALENDAR, that observation species
the calendar that is followed by each resource. If no calendar is specied for a given
resource, the relevant activitys calendar is used instead. Note that this use of the
calendar requires that the calendar variable in the Activity and other data sets be
numeric.
If the value of the type identier variable is MULTALT, that observation indicates
which resources can have multiple alternate resources. The value 1 for a resource
variable in the observation indicates that multiple alternates are allowed for that
resource, and a value 0 indicates that multiple alternates are not allowed. See the
Specifying Multiple Alternates section on page 138 for details.
If the value of the type identier variable is MINARATE, that observation indicates
the minimum rate of substitution for each resource, whenever multiple alternates are
used. Note that the MINARATE values specied in this observation are used only
if the MULTIPLEALTERNATES option is specied or if the Resource data set has
an observation with the type identier value of MULTALT.
The period variable must have nonmissing values for observations specifying the
levels of the resources (that is, with type identier equal to RESLEVEL). However,
the period variable does not have any meaning when the type identier variable has
any value other than RESLEVEL; if the period variable has nonmissing values in
these observations, it is ignored. The Resource data set must be sorted in order of
increasing values of the period variable.
Multiple observations are allowed for each type of observation. If there is a conict
Resource Usage and Allocation
129
in the values specied, only the rst nonmissing value is honored; for example, if
there are two observations of the type RESTYPE and a resource variable has value
1 in the rst and 2 in the second of these observations, the resource type is assumed to
be 1 (replenishable). On the other hand, if the value is missing in the rst observation
but set to 2 in the second, the resource type is assumed to be 2 (consumable).
A resource is available at the specied level from the time given in the rst observa-
tion with a nonmissing value for the resource. Its level changes (to the new value)
whenever a new observation is encountered with a nonmissing value, and the date of
change is the date specied in this observation.
The following examples illustrate the details about the Resource data set. Consider
the following Resource data:
OBS OBSTYPE DATE WORKERS BRICKS PAYMENT ADVANCE
1 RESTYPE . 1 2 2 2
2 RESUSAGE . . 0 2 1
3 RESPRTY . 10 10 10 10
4 SUPLEVEL . 1 . . .
5 RESLEVEL 1JUL04 . 1000 2000 500
6 RESLEVEL 5JUL04 4 . . .
7 RESLEVEL 9JUL04 . 1500 . .
There are four resources in these data, WORKERS, BRICKS, PAYMENT, and
ADVANCE. The variable OBSTYPE is the type identier, and the variable DATE
is the period variable. The rst observation (because OBSTYPE has value
RESTYPE) indicates that WORKERS is a replenishable resource while the other
three resources are consumable. The second observation indicates the usage prole
for the consumable resources: the resource BRICKS is used continuously throughout
the duration of an activity, while the resource PAYMENT is required at the end of the
activity and the resource ADVANCE is needed at the start of the activity. The third
observation indicates that all the resources have equal priority. In the fourth observa-
tion, a value 1 under WORKERS indicates that a supplementary level of 1 worker
is available if necessary, while no reserve is available for the resources BRICKS,
PAYMENT, and ADVANCE.
The next three observations indicate the resource availability prole. The resource
WORKERS is unavailable until July 5, 2004, when the level jumps from 0 to 4
and remains at that level through the end of the project. The resource BRICKS is
available from July 1, 2004, at level 1000, while the resource levels for PAYMENT,
and ADVANCE are 2000 and 500, respectively. On July 9, an additional 500 bricks
are made available to increase the total availability to 1500. Note that missing values
in observations 5 and 6 indicate that there is no change in the availability for the
respective resources.
As another example, suppose that you want to treat BRICKSas an aggregate resource
(one that is not to be included in resource allocation). Then consider the following
data from a Resource data set:
130
Chapter 2. The CPM Procedure
OBSTYPE BRICKS PAINTER SUPERV
RESTYPE 4 1 1
RESRCDUR 0 1 2
CALENDAR 1 0 0
The rst observation indicates that the resource BRICKS is consumable and is to be
used only for aggregation while the other two resources are replenishable and are to
be treated as constrained resources during resource allocation.
The second observation, with the keyword RESRCDUR, species the effect of the
resource on an activitys duration. The value 0 for the resource BRICKS implies
that this resource does not affect the duration of an activity. On the other hand, the
value 1 identies the resource PAINTER as a driving resource; this means that by
increasing the number of painters, an activitys duration can be decreased. Note that
the procedure uses this information about the nature of the resource only if a par-
ticular observation in the Activity data set has valid values for both the WORK and
DURATION variables. Otherwise, if you specify a value only for the WORK vari-
able, the procedure assumes that the resource specications in that observation drive
the activitys duration. Likewise, if you specify a value only for the DURATION vari-
able, the procedure assumes that the resources specied in that observation require a
xed duration.
In the Resource data set specications, the second observation also identies the
resource SUPERV to be of the spanning type. In other words, such a resource is
required by an activity whenever any of the other resources are working on the same
activity. Thus, if you add more painters to an activity, thereby reducing its duration,
the supervisor (a spanning resource) will be needed for a shorter time.
The third observation indicates the calendar to be used in calculating the activitys
start and nish times for the particular resource. If you do not specify a calendar, the
procedure uses the activitys calendar.
Specifying Resource Requirements
To perform resource allocation or to summarize the resource utilization, you must
specify the amount of resources required by each activity. In this section, the format
for this specication is described. The amount required by each activity for each
of the resources listed in the RESOURCE statement is specied in the Activity data
set. The requirements for each activity are assumed to be constant throughout the
activitys duration. A missing value for a resource variable in the Activity data set
indicates that the particular resource is not required for the activity in that observation.
The interpretation of the specication depends on whether or not the resource is re-
plenishable. Suppose that the value for a given resource variable in a particular obser-
vation is x. If the resource is replenishable, it indicates that x units of the resource
are required throughout the duration of the activity specied in that observation. On
the other hand, if the resource is consumable, it indicates that the specied resource is
consumed at the rate of x units per unit interval, where interval is the value specied
in the INTERVAL= option in the PROC CPM statement. For example, consider the
following specication:
Resource Usage and Allocation
131
OBS ACTIVITY DUR WORKERS BRICKS
1 A 5 . 100
2 B 4 2 .
Here, ACTIVITY denotes the activity under consideration, DUR is the duration in
days (assuming that INTERVAL=DAY), and the resource variables are WORKERS
and BRICKS. A missing value for WORKERS in observation 1 indicates that ac-
tivity A does not need the resource WORKERS, while the same is true for the
resource BRICKS and activity B. You can assume that the resource WORKERS
has been identied as replenishable, and the resource BRICKS has been identied as
consumable in a Resource data set. Thus, a value 100 for the consumable resource
BRICKS indicates that 100 bricks per day are required for each of the 5 days of the
duration of activity A, and a value 2 for the replenishable resource WORKERS
indicates that 2 workers are required throughout the duration (4 days) of activity B.
Recall that consumable resources can be further identied as having a special usage
prole, indicating that the requirement is only at the beginning or end of an activity.
See the Variable Usage Prole for Consumable Resources section on page 145 for
details.
Negative Resource Requirements
The CPM procedure enables you to specify negative resource requirements. A nega-
tive requirement indicates that a resource is produced instead of consumed. Typically,
this interpretation is valid only for consumable resources. For example, a brick-
making machine may produce bricks at the rate of 1000 units per hour which are then
available for consumption by other tasks in the project. To indicate that a resource is
produced (and not consumed) by an activity, specify the rate of usage for the resource
as a negative number. For example, to indicate that a machine produces boxed cards
at the rate of 5000 boxes per day, set the value of the resource, NUMBOXES, to
-5000.
Scheduling Method
PROC CPM uses the serial-parallel (serial in time and parallel in activities)
method of scheduling. In this section, the basic scheduling algorithm is described.
(Modications to the algorithm if an ACTUAL statement is used, if activity split-
ting is allowed, or if alternate resources are specied, are described later.) The basic
algorithm proceeds through the following steps:
1. An initial tentative schedule describing the early and late start and nish times
is determined without taking any resource constraints into account. This sched-
ule does, however, reect any restrictions placed on the start and nish times
by the use of the ALIGNDATE and ALIGNTYPE statements. As much as
possible, PROC CPM tries to schedule each activity to start at its E
START
time (e
start + delay,
the procedure tries to schedule the activity to start at time using supplementary
levels of the resources (if there is an observation in the Resource data set speci-
fying supplementary levels of resources); otherwise, it is postponed. (Note that
if the AWAITDELAY option is specied, and there are not enough resources
at time, the activity is not scheduled at time using supplementary resources).
If time is equal to or greater than the value of l
start is
set to the next change date in the availability of resources). time is advanced to
the minimum e
FINISH time.
LST
species that the activities in the waiting list are sorted in the order of increasing
L
START time. Thus, this option causes activities that are closer to being critical to
be scheduled rst. This is the default rule.
134
Chapter 2. The CPM Procedure
RESPRTY
species that PROC CPM should sort the activities in the waiting list in the order
of increasing values of the resource priority for the most important resource used by
each activity. In order for this scheduling rule to be valid, there must be an observation
in the Resource data set identied by the value RESPRTY for the type identier
variable and specifying priorities for the resources. PROC CPM uses these priority
values (once again, low values indicate high priority) to order the activities; then, the
activities in the waiting list are ordered according to the highest priority resource used
by them. In other words, the CPM procedure uses the resource priorities to assign
priorities to the activities in the project; these activity priorities are then used to order
the activities in the waiting list (in increasing order). If this option is specied, and
there is no observation in the Resource data set specifying the resource priorities,
PROC CPM ignores the specication for the SCHEDRULE= option and uses the
default scheduling rule, LST, instead.
SHORTDUR
species that the activities in the waiting list are sorted in the order of increasing
durations. Thus, PROC CPM tries to schedule activities with shorter durations rst.
Secondary Levels of Resources
There are two factors that you can use to control the process of scheduling subject to
resource constraints: time and resources. In some applications, time is the most im-
portant factor, and you may be willing to use extra resources in order to meet project
deadlines; in other applications, you may be willing to delay the project comple-
tion by an arbitrary amount of time if insufcient resources warrant doing so. The
DELAY= and ACTDELAY= options and the availability of supplementary resources
enable you to choose either method or a combination of the two approaches.
In the rst case, where you do not want the project to be delayed, specify the avail-
ability of supplementary resources in the Resource data set and set DELAY=0. In
the latter case, where extra resources are unavailable and you are willing to delay
project completion time, set the DELAY= option to some very large number or leave
it unspecied (in which case it is assumed to be + INFINITY). You can achieve a
combination of both effects (using supplementary levels and setting a limit on the
delay allowed) by specifying an intermediate value for the DELAY= option and in-
cluding an observation in the Resource data set with supplementary levels.
You can also use the INFEASDIAGNOSTIC option which is equivalent to specify-
ing innite supplementary levels for all the resources under consideration. In this
case, the DELAY= value is assumed to equal the default value of +INFINITY, unless
it is specied otherwise. See Example 2.17, INFEASDIAGNOSTIC Option and
Aggregate Resource Type, for an illustration.
Note that the DELAY= option presupposes that all the activities can be subjected to
the same amount of delay. In some situations, you may want to control the amount of
delay for each activity on the basis of some criterion, say the amount of oat present
in the activity. The ACTDELAY= option enables you to specify a variable amount of
delay for each activity.
Resource Usage and Allocation
135
Resource-Driven Durations and Resource Allocation
If resource-driven durations or resource calendars are specied, the procedure com-
putes the start and nish times for each resource separately for each activity. An
activity is considered to be completed only when all the resources have completed
their work on that activity. Thus, an activitys start (nish) time is computed as the
minimum (maximum) of the start (nish) times for all the resources used by that
activity.
During resource-constrained scheduling, an activity enters the list of activities waiting
for resources when all its precedence constraints have been satised. As before, this
list is ordered using the scheduling rule specied. At this point, a tentative start
and nish time is computed for each of the resources required by the activity using
the resources duration and calendar. An attempt is made to schedule all of this
activitys resources at these calculated times using the available resources. If the
attempt is successful, the activity is scheduled to start at the given time with the
appropriate resource schedule times, and the required resources are reduced from
the resource availabilities. Otherwise, the procedure attempts to schedule the next
activity in the list of activities waiting for resources. When all activities have been
considered at the given time, the procedure continues to the next event and continues
the allocation process. Note that, at a given point of time, the procedure schedules
the activity only if all the required resources are available for that activity to start at
that time (or at the nearest time per that resources calendar), unless you specify the
INDEPENDENTALLOC option.
The INDEPENDENTALLOC option enables each resource to be scheduled indepen-
dently for the activity. Thus, when an activity enters the list of activities waiting
for resources, each resource requirement is considered independently, and a partic-
ular resource can be scheduled for that activity even if none of the other resources
are available. However, the spanning type of resources must always be available
throughout the activitys duration. Note that the activity is considered to be nished
(and its successors can start) only after all the resources for that activity have been
scheduled. Note also that this option is valid even if all activities have xed durations
and calendars are not associated with resources.
Activity Splitting
As mentioned in the Scheduling Method section on page 131, PROC CPM as-
sumes that activities cannot be preempted once they have started. Thus, an activity is
scheduled only if it can be assured of enough resources throughout its entire duration.
Sometimes, you may be able to make better use of the resources by allowing activities
to be split. PROC CPM enables you to specify the maximum number of segments
that an activity can be split into as well as the minimum duration of any segment of
the activity. Suppose that for a given activity, d is its duration, maxn is the maximum
number of segments allowed, and dmin is the minimum duration allowed for a seg-
ment. If one or the other of these values is not given, it is calculated appropriately
based on the duration of the activity.
136
Chapter 2. The CPM Procedure
The scheduling algorithm described earlier is modied as follows:
In Step 2, the procedure tries to schedule the entire activity (call it A) if it is
critical. Otherwise, PROC CPM schedules, if possible, only the rst part (say
A1) of the activity (of length dmin). The remainder of the activity (call it A2,
of length d dmin ) is added to the waiting list to be scheduled later. When it
is A2s turn to be scheduled, it is again a candidate for splitting if the values of
maxn and dmin allow it, and if it is not critical. This process is repeated until
the entire activity has been scheduled.
While ordering the activities in the waiting list, in case of a tie, the split seg-
ments of an activity are given priority over unsplit activities. Note that some
scheduling rules could lead to more splitting than others.
Activities that have an alignment type of MS or MF imposed on them by the
ALIGNTYPE variable are not split.
Note that splitting may not always reduce project completion time; it is designed to
make better use of resources. In particular, if there are gaps in resource availability,
it allows activities to be split and scheduled around the gaps, thus using the resources
more efciently.
If activity splitting is allowed, a new variable is included in the Schedule data set
called SEGMT
NO is set to missing.
For split activities, the number of observations output is one more than the number of
disjoint segments created.
The rst observation corresponding to such an activity has SEGMT
NO set to miss-
ing, and the S
START and S
NO, S
START,
S
START and S
FINISH are the resource-constrained start and nish times for this
segment, and DURATION is the duration of this segment.
Actual Dates and Resource Allocation
The resource-constrained scheduling algorithm uses the early start schedule as the
base schedule to determine possible start times for activities in the project. If an
ACTUAL statement is used in the invocation of PROC CPM, the early start schedule
(as well as the late start schedule) reects the progress information that is specied
for activities in the project, and thus affects the resource constrained schedule also.
Further, activities that are already completed or in progress are scheduled at their ac-
tual start without regard to resource constraints. If the resource usage prole for such
Resource Usage and Allocation
137
activities indicates that the resources are insufcient, a warning is printed to the log,
but the activities are not postponed beyond their actual start time. The Usage data set
contains negative values for the availability of the insufcient resources. These extra
amounts are assumed to have come from the supplementary levels of the resources (if
such a reservoir existed); for details on supplementary resources, see the Secondary
Levels of Resources section on page 134.
If activity splitting is allowed (through the specication of the MINSEGMTDUR or
MAXNSEGMT variable or the SPLITFLAG or TIMENOWSPLT option), activities
that are currently in progress may be split at TIMENOW if resources are insufcient;
then the second segment of the split activity is added to the list of activities that need
to be scheduled subject to resource constraints. Starting from TIMENOW, all activ-
ities that are still unscheduled are treated as described in the Scheduling Method
section on page 131.
Specifying Alternate Resources
PROC CPM enables you to identify alternate resources that can be substituted for
any given resource that is insufcient. Thus, for example, you can specify that if
programmer John is unavailable for a given task, he can be substituted by programmer
David or Robert. This information is passed to PROC CPM through the Resource
data set.
As with other aspects of the Resource data set, each observation is identied by
a keyword indicating the type of information in that observation. Two keywords,
ALTRATE and ALTPRTY, enable you to specify the rate of substitution and a pri-
oritization of the alternate resources when a resource has more than one substitution
(lower value indicates higher priority). Further, a new variable (identied to PROC
CPM through the RESID= option) is used to identify the resource for which alter-
nates are being specied in the current observation. Consider the following Resource
data:
OBS OBSTYPE RES_NAME RES_DATE JOHN DAVID ROBERT
1 RESTYPE . 1 1.0 1.0
2 ALTRATE JOHN . 1 0.5 0.5
3 ALTPRTY JOHN . 1 2.0 3.0
4 RESLEVEL 15JUL04 1 1.0 1.0
In these Resource data, the second observation indicates that John can be substi-
tuted by David or Robert; however, either David or Robert can accomplish Johns
tasks with half the effort. In other words, if an activity requires 1 unit of John, it
can also be accomplished with 0.5 units of David. Also, the third observation, with
OBSTYPE=ALTPRTY, indicates that if John is unavailable, PROC CPM should
rst try to use David and if he, too, is unavailable, then should use Robert. This set
up enables a wide range of control for specifying alternate resources.
In other words, the mechanism for specifying alternate resources is as follows: for
each resource, specify a list of possible alternatives along with a conversion rate and
an order in which the alternatives are to be considered. In the Resource data set, add
138
Chapter 2. The CPM Procedure
another variable (identied by the RESID= option) to specify the name of the re-
source variable for which alternatives are being specied (the variable RES
NAME
in the preceding example).
Let OBSTYPE=ALTRATE for the observation that species the rate of conversion
for each possible alternate resource (missing implies the particular resource cannot
be substituted). For resources that drive an activitys duration, the specication of
the alternate rate is used as a multiplier of the resource-driven duration. See the
Resource-Driven Durations and Alternate Resources section on page 140 for de-
tails.
Let OBSTYPE=ALTPRTY for the observation that species a prioritization for the
resources.
Note that all substitute resources must be of the same type (replenishable or con-
sumable) as the primary resource. The specication of the RESID= option triggers
the use of alternate resources. If alternate resources are used, the Schedule data set
contains new variables that specify the actual resources that are used; the names of
these variables are obtained by prexing the resource names by U. When activi-
ties are allowed to be split and alternate resources are allowed, different segments
of the activity can use a different set of resources. If this is the case, the Schedule
data set contains a different observation for every segment that uses a different set
of resources, even if these segments are contiguous in time. Note that contiguous
segments, even if they use different sets of resources, are not treated as true splits for
the purpose of counting the number of splits allowed for the activity.
By default, multiple resources cannot be used to substitute for a single resource. To
enable multiple alternates, use the MULTIPLEALTERNATES option or add an obser-
vation to the Resource data set identifying which resources allow multiple alternates.
For details, see the Specifying Multiple Alternates section on page 138.
See Example 2.20 for an illustration of the use of alternate resources.
Specifying Multiple Alternates
As described in the Specifying Alternate Resources section on page 137, you can
use the Resource data set to specify alternate resources for any given resource. You
can specify a rate of substitution and a priority for substitution. However, the CPM
procedure will not use multiple alternate resources to substitute for a given resource.
For example, suppose that an activity needs two programmers and the available pro-
grammers (alternate resources) are John and Mary. By default, the CPM procedure
cannot assign both John and Mary to the activity to fulll the resource requirement
of two programmers.
However, this type of substitution is useful to effectively model group resources or
skill pools. To enable substitution of multiple alternates for a single resource, use
the MULTIPLEALTERNATES option in the RESOURCE statement. This option
enables all resources that have alternate specications (through observations of the
type ALTRATE or ALTPRTY in the Resource data set) to use multiple alternates.
You can rene this feature to selectively allow multiple substitution or set a minimum
rate of substitution, by adding special observations to the Resource data set. As with
Resource Usage and Allocation
139
other aspects of the Resource data set, the specications related to multiple alternates
are identied by observations with special keywords, MULTALT and MINARATE.
Let OBSTYPE=MULTALT for the observation that identies which resources can
have multiple alternates. Valid values for such an observation are 0 and 1: 0
indicates that the resource cannot be substituted by multiple resources, and 1 indi-
cates that it can be substituted by multiple resources. If the Resource data set contains
such an observation, the MULTIPLEALTERNATES option is ignored and the values
specied in the observation are used to allow multiple substitutions for only selected
resources.
Let OBSTYPE=MINARATE for the observation that indicates the minimum rate
of substitution for each resource. For example, you may not want a primary resource
requirement of 1.5 programmers, to be satised by 5 different alternate programmers
at a rate of 0.3 each. To ensure that the minimum rate of substitution is 0.5, specify
the value for the resource variable, PROGRAMMER, as 0.5 in the observation with
OBSTYPE=MINARATE. In other words, use this observation if you do not wish
to split an activitys resource requirement across several alternate resources with a
very small rate of utilization per resource.
Consider the following Resource data:
OBS OBSTYPE RES_NAME RES_DATE JOHN DAVID ROBERT
1 RESTYPE . 1 1 1
2 ALTRATE JOHN . 1 2 2
3 MULTALT . . 1 . .
4 MINARATE . . 0.5 . .
5 RESLEVEL 15JUL04 0 1.0 1.0
In these Resource data, observations 3 and 4 control the use of multiple alternates.
They specify that a requirement for John can be substituted with multiple alternates.
Further, if multiple alternates are used instead of John, do not allocate them in units
less than 0.5. Note also that observation 2 indicates that David and Robert require
twice the effort to accomplish Johns tasks. Thus, if an activity requires 1 unit of
John, and he is unavailable, the CPM procedure will require 2 units of David (or
Robert) to substitute for John. However, only 1 unit each of David and Robert is
available. If multiple alternates are not allowed, the resource allocation algorithm
will fail. However, since the resource John does allow multiple substitution, the
activity can be scheduled with 1 unit of David and 1 unit of Robert (each substituting
for 1/2 of the requirement for John).
Allowing multiple alternates for a single resource raises an interesting question:
When distributing the resource requirements across multiple alternatives, should the
primary resource be included in the list of multiple alternates? For instance, in the
preceding example, if the resource level for John is 0.5 (in observation 5), should
the activity use John at rate 0.5 and assign the remainder to one (or more) of the alter-
nate resources? Or, should the primary resource be excluded from the list of possible
alternates? You can choose either behavior for the primary resource by specifying 1
(for inclusion) or 0 (for exclusion) in the observation with OBSTYPE=ALTRATE
140
Chapter 2. The CPM Procedure
that corresponds to the primary resource (with RES
NAME=JOHN.
Resource-Driven Durations and Alternate Resources
The Specifying Alternate Resources section on page 137 describes the use of the
RESID= option and the observations of type ALTRATE and ALTPRTY in the
Resource data set to control the use of alternate resources during resource alloca-
tion. The behavior described in that section refers to the substitution of resources
for resources that have a xed duration. Alternate resources can also be specied for
resources that drive an activitys duration. However, the specication of the alternate
rate is interpreted differently: it is used as a multiplier of the resource-driven duration.
For example, consider the following Resource data:
OBS OBSTYPE RES_NAME RES_DATE JOHN DAVID ROBERT
1 RESTYPE . . 1 1 1
2 RESRCDUR . . 1 1 1
3 ALTRATE JOHN . 1 2 2
4 ALTPRTY JOHN . 1 2 3
5 RESLEVEL . 15JUL04 . 1.0 1.0
In these Resource data, the second observation indicates that all the resources are
driving resources. The third observation indicates that John can be substituted by
David or Robert; however, either David or Robert will require twice as long to ac-
complish Johns tasks for resource-driven activities. Thus, in contrast to the xed-
duration activities, the ALTRATE specication changes the duration of the alternate
resource, not the rate of use.
For instance, consider the following activity with the specied values for the
DURATION and WORK variables and the resource requirement for John:
OBS ACTIVITY DURATION WORK JOHN DAVID ROBERT
1 Act1 3 10 1 . .
Activity Act1 requires 10 days of work from John, indicating that the resource-
driven duration for Act1 is 10 days. However, from the preceding Resource data,
John is not available, but can be substituted by David or Robert, who will require
twice as long to accomplish the work. So, if Act1 is scheduled using either one of the
alternate resources, its resource-driven duration will be 20 days.
Resource Usage and Allocation
141
Auxiliary Resources
Sometimes, the use of a certain resource may require simultaneous use of other re-
sources. For example, use of a crane will necessitate the use of a crane operator. In
other words, if an activity needs the resource, CRANE, it will also need a correspond-
ing resource, CRANEOP. Such requirements can be easily modeled by adding both
CRANE and CRANEOP to the list of resources required by the activity.
However, when alternate resources are used, the problem becomes more complex.
For example, suppose an activity requires a CRANE and there are two possible
cranes that can be used, CRANE1 and CRANE2. You can specify CRANE1 and
CRANE2 as the alternate resources for CRANE. Suppose further that each of the
two cranes has a specic operator, CRANEOP1 and CRANEOP2, respectively.
Specifying CRANEOP1 and CRANEOP2 separately as alternates for CRANEOP
will not necessarily guarantee that CRANEOP1 (or CRANEOP2) is used as the alter-
nate for CRANEOP in conjunction with the use of the corresponding CRANE1 (or
CRANE2).
You can model such a situation by the use of Auxiliary resource specication: specify
CRANEOP1 and CRANEOP2 as auxiliary resources for CRANE1 and CRANE2,
respectively. Auxiliary resources are specied through the Resource data set, using
observations identied by the keyword AUXRES for the value of the OBSTYPE
variable. For an observation of this type, the RESIDvariable species the name of the
primary resource. (This is similar to the specication of ALTRATE and ALTPRTY.)
Once auxiliary resources are specied in the Resource data set, it is sufcient to spec-
ify only the primary resource requirements in the Activity data set. In this situation,
for example, it is sufcient to require a CRANE for the activity in the Activity data
set.
In the Resource data set, add a new observation type, AUXRES, which will specify
the auxiliary resources that are needed for each primary resource. For an observation
of this type, the RESID variable species the name of the primary resource. The
value for each auxiliary resource indicates the rate at which it is required whenever
the primary resource is used. You will also need to specify CRANE1 and CRANE2
as the alternate resources for CRANE in the Resource data set.
When scheduling the activity, PROC CPM will schedule CRANE1 (or CRANE2) as
the alternate only if both CRANE1 and CRANEOP1 (or CRANE2 and CRANEOP2)
are available.
For instance, the preceding example will have the following Resource data set:
OBSTYPE RESID PER CRANE CRANE1 CRANE2 CRANEOP1 CRANEOP2
AUXRES CRANE1 . . . . 1 .
AUXRES CRANE2 . . . . . 1
ALTRATE CRANE . . 1 1 . .
RESLEVEL . 10JUL04 . 1 1 1 1
142
Chapter 2. The CPM Procedure
RESOURCEOUT= Usage Data Set
The RESOURCEOUT= data set (referred to as the Usage data set) contains infor-
mation about the resource usage for the resources specied in the RESOURCE state-
ment. The options ALL, AVPROFILE, ESPROFILE, LSPROFILE, and RCPROFILE
(each is discussed earlier in the RESOURCE Statement section on page 93) control
the number of variables that are to be created in this data set. The ROUTINTERVAL=
and ROUTINTPER= options control the number of observations that this data set
is to contain. Of the options controlling the number of variables, AVPROFILE
and RCPROFILE are allowed only if the procedure is used to obtain a resource-
constrained schedule.
The Usage data set always contains a variable named
TIME
TIME
, RWORKERS,
AWORKERS, RBRICKS, and ABRICKS. Suppose further that routinterval is DAY
and routintper is 1. The Usage data set contains the following observations:
_TIME_ RWORKERS AWORKERS RBRICKS ABRICKS
1JUL04 0 0 100 1000
2JUL04 0 0 100 900
3JUL04 0 0 100 800
4JUL04 0 0 100 700
5JUL04 2 2 100 600
6JUL04 2 2 0 500
7JUL04 2 2 0 500
8JUL04 2 2 0 500
9JUL04 0 4 0 1000
On each day of activity As duration, the resource BRICKS is consumed at the rate of
100 bricks per day. At the beginning of the rst day (July 1, 2004), all 1000 bricks are
144
Chapter 2. The CPM Procedure
still available. Note that each day the availability drops by 100 bricks, which is the
rate of consumption. On July 5, activity B is scheduled to start. On the four days
starting with July 5, the value of RWORKERS is 2, indicating that 2 workers are
used on each of those days leaving an available supply of 2 workers (AWORKERS
is equal to 2 on all 4 days).
If ROUTINTPER is set to 2, and the CUMUSAGE option is used, then the observa-
tions would be as follows:
_TIME_ RWORKERS AWORKERS RBRICKS ABRICKS
1JUL04 0 0 0 1000
3JUL04 0 0 200 800
5JUL04 2 2 400 600
7JUL04 2 2 500 500
9JUL04 0 4 500 1000
Note that the value of RBRICKS indicates the cumulative usage of the resource
BRICKS through the beginning of the date specied by the value of the variable
TIME
START, E
shows
146
Chapter 2. The CPM Procedure
the total amount of work required by the resource for the activity in that observation.
The variable R
RATE shows the rate of usage of the resource for the relevant activ-
ity. Note that for driving resources, the variable
DUR
is computed as (WORK /
R
RATE).
If you specify an ACTUAL statement, the Resource Schedule data set also contains
the STATUS variable indicating whether the resource has completed work on the
activity, is in progress, or is still pending.
Multiproject Scheduling
The CPM procedure enables you to dene activities in a multiproject environment
with multiple levels of nesting. You can specify a PROJECT variable that iden-
ties the name or number of the project to which each activity belongs. The
PROJECT variable must be of the same type and length as the ACTIVITY variable.
Further, each project can be considered as an activity, enabling you to specify prece-
dence constraints, alignment dates, or progress information for the different projects.
Precedence constraints can be specied between two projects, between activities in
the same or different projects, or between a project and activities in another project.
The PROJECT variable enables you to specify the name of the project to which each
activity belongs. Each project can in turn be treated as an activity that belongs to a
bigger project. Thus, the (PROJECT, ACTIVITY) pair of variables enables you to
specify multiple levels of nesting using a hierarchical structure for the (task, super-
task) relationship.
In the following discussion, the terms superproject, supertask, parent task, ancestor
task, project, or subproject refer to a composite task (a task composed of other tasks).
A lowest level task (one which has no subtasks under it) is referred to as a child task,
descendent task, a leaf task, or a regular task.
You can assign most of the activity attributes to a supertask; however, some of the
interpretations may be different. The signicant differences are listed as follows.
Activity Duration
Even though a supertask has a value specied for the DURATION variable, the nish
time of the supertask may not necessarily be equal to the (start time + duration). The
start and nish times of a parent task (supertask) always encompass the span of all its
subtasks. In other words, the start (nish) time of a supertask is the minimum start
(maximum nish) time of all its subtasks.
The specied DURATION for a supertask is used only if the USEPROJDUR option
is specied; this variable is used to compute an upper bound on the late nish time of
the project. In other words, you can consider the duration of a supertask as a desired
duration that puts a constraint on its nish time.
Note: You cannot specify resource-driven durations for supertasks.
Precedence Constraints
You cannot specify a Start-to-Finish or Finish-to-Finish type of precedence constraint
when the Successor task is a supertask. Such a constraint is ignored, and a warning
is written to the log.
Multiproject Scheduling
147
Time Constraints
The CPM procedure supports all the customary time constraints for a supertask.
However, since the supertask does not really have an inherent duration, some of the
constraints may lead to unexpected results.
For example, a constraint of the type SLE (Start Less than or Equal to) on a leaf task
uses the tasks duration to impose a maximum late nish time for the task. However,
for a supertask, the duration is determined by the span of all its subtasks, which
may depend on the activities calendars. The CPM procedure uses an estimate of
the supertasks duration computed on the basis of the precedence constraints to de-
termine the maximum nish time for the supertask using the date specied for the
SLE constraint. Such a constraint may not translate to the correct upper bound on the
supertasks nish time if the project has multiple calendars. Note that the presence of
multiple calendars could change the computed duration of the supertask depending
on the starting date of the supertask. Thus, in general, it is better to specify SGE
(Start Greater than or Equal to) or FLE (Finish Less than or Equal to) constraints on
supertasks.
Note that alignment constraints of the type SGE or FLE percolate down the project
hierarchy. For example, if there is an SGE specication on a supertask, then all the
subtasks of this supertask must also start on or after the specied date.
Mandatory constraints (either of the type MS or MF) are used to set xed start and n-
ish times on the relevant task. Such constraints are checked for consistency between
a parent task and all its descendants.
Progress Information
You can enter progress information for supertasks in the same way as you do for
leaf tasks. The procedure attempts to reconcile inconsistencies between the actual
start and nish times of a parent and its children. However, it is sufcient (and less
ambiguous) to enter progress information only about the tasks at the lowest level.
Resource Requirements
You can specify resource requirements for supertasks in the same way as you do
for regular tasks. However, the supertask is scheduled in conjunction with all its
subtasks. In other words, a leaf task is scheduled only when its resources and the
resources for all its ancestors are available in sufcient quantity. Thus, a supertask
needs to have enough resources throughout the schedule of any of its subtasks; in
fact, the supertask needs to have enough resources throughout its entire span. In
other words, a supertasks resource requirements are treated as spanning.
In addition to the above treatment of a supertasks resources, there are two other
resource scheduling options available for handling the resource requirements of
supertasks. You can use the AGGREGATEPARENTRES option in the PROJECT
statement to indicate that a supertasks resource requirements are to be used only for
aggregation. In other words, resource allocation is performed taking into account
the resource requirements of only the leaf tasks. Alternately, you can choose
to ignore any resource requirements specied for supertasks by specifying the
IGNOREPARENTRES option. Note the difference between the
AGGREGATEPARENTRES and IGNOREPARENTRES options. The rst
148
Chapter 2. The CPM Procedure
option includes the supertasks requirements while computing the aggregate re-
source usage, while the second option is equivalent to setting all parent resource
requirements to 0.
Resource-Driven Durations
Any WORK specication is ignored for a parent task. Note that resources required
for a supertask cannot drive the duration of the task; a supertasks duration is driven
by all its subtasks. Note that each leaf task can still be resource driven.
Schedule Computation
The project hierarchy and all the precedence constraints (between leaf tasks, between
supertasks, or between a supertask and a leaf task) are taken into consideration when
the project schedule is computed. A task (parent or leaf) can be scheduled only when
its precedences and all its parents precedences are satised.
During the forward pass of the scheduling algorithm, all independent start tasks (leaf
tasks or supertasks with no predecessors) are initialized to the project start date. Once
a supertasks precedences (if any) are satised, all its subtasks whose precedences
have been satised are added to the list of activities that can be scheduled. The early
start times for the subtasks are initialized to the early start time of the supertask and
are then updated, taking into account the precedence constraints and any alignment
constraints on the activities.
Once all the subtasks are scheduled, a supertasks early start and nish times are set
to the minimum early start and maximum early nish, respectively, of all its subtasks.
The late start schedule is computed using a backward pass through the project net-
work, considering the activities in a reverse order from the forward pass. The late
schedule is computed starting with the last activity (activities) in the project; the late
nish time for each such activity is set to the master projects nish date. By de-
fault, the master projects nish date is the maximum of the early nish dates of all
the activities in the master project (if a FINISHBEFORE date is specied with the
FBDATE option, this date is used as the starting point for the backward calculations).
During the backward pass, the late nish time of a supertask is determined by
the precedence constraints and any alignment specication on the supertask. You
can specify a nish constraint on a supertask by using the ALIGNDATE and
ALIGNTYPE variables, or by using the SEPCRIT or USEPROJDUR option.
If a nish constraint is specied using the ALIGNDATE and ALIGNTYPE speci-
cations, the L
149
Schedule Data Set
If a PROJECT variable is specied, the Schedule data set contains the PROJECT
variable as well as two new variables called PROJ
LEV.
The PROJ
FINISH - E
FINISH - L
DUR. If a
resource-constrained schedule is produced by PROC CPM, the project duration is
computed using the resource constrained start and nish times of the superproject; in
other words, in this case PROJ
DUR = (S
FINISH - S
START).
The PROJ
LEV variable species the depth of each activity from the root of the
project hierarchy tree. The root of the tree has PROJ
ASC, ES
DESC, LS
ASC, LS
DESC, SS
ASC, and SS
DESC, that
indicate a sorting order for activities in the output data set. For example, the variable
ES
ASC enables you to sort the output data set in such a way that the activities within
each superproject are ordered according to increasing early start time.
Macro Variable
ORCPM
INFEASIBLE
BADDATA
ERROR
MEMORY
ERROR
IO
ERROR
SEMANTIC
ERROR
SYNTAX
ERROR
CPM
BUG
UNKNOWN
ERROR
150
Chapter 2. The CPM Procedure
This information can be used when PROC CPM is one step in a larger program that
needs to determine whether the procedure terminated successfully or not. Because
ORCPM
is a standard SAS macro variable, it can be used in the ways that all
macro variables can be used.
Input Data Sets and Related Variables
The CPM procedure uses activity, resource, and holiday data from several different
data sets with key variable names being used to identify the appropriate informa-
tion. Table 2.24 lists all of the variables associated with each input data set and their
interpretation by the CPM procedure. The variables are grouped according to the
statement that they are identied in. Some variables use default names and are not
required to be identied in any statement.
Table 2.24. PROC CPM Input Data Sets and Associated Variables
Data Set Statement Variable Name Interpretation
CALEDATA CALID CALID Calendar corresponding
to work pattern
Default D
SUN
SAT
SUN
SAT
0: if corresponding successor
variable value is not missing
MAXNSEGMT calculated from MINSEGMTDUR
MINSEGMTDUR 0.2 * DURATION
PCTCOMP see Progress Updating for details
PROJECT activity is at highest level
REMDUR see Progress Updating for details
RESOURCE 0
START value ignored
FORMAT Specication
153
Table 2.25. (continued)
Data Set Variable Value Used / Assumption Made /
Action Taken
SUCCESSOR value ignored
TAILNODE input error: procedure stops with error message
WORK resources use xed duration
HOLIDATA CALID holiday applies to all calendars dened
HOLIDAY observation ignored
HOLIDUR ignored if HOLIFIN is not missing;
1, otherwise
HOLIFIN ignored if HOLIDUR is not missing;
HOLIDAY + (1 unit of INTERVAL), otherwise
RESOURCEIN OBSTYPE RESLEVEL
PERIOD input error if OBSTYPE is RESLEVEL,
otherwise ignored
RESID observation ignored
RESOURCE 1.0, if OBSTYPE is RESTYPE
innity, if OBSTYPE is RESPRTY
0.0, if OBSTYPE is RESUSAGE
0.0, if OBSTYPE is SUPLEVEL
0.0, if OBSTYPE is RESLEVEL and this
is the rst observation of this type
otherwise, equal to value in previous
observation
WORKDATA any numeric 00:00, if rst observation
variable 24:00, otherwise
FORMAT Specication
As can be seen from the description of all of the statements and options used by
PROC CPM, the procedure handles SAS date, time, and datetime values in several
ways: as time constraints on the activities, holidays specied as date or datetime
values, periods of resource availabilities, actual start and nish times, and several
other options that control the scheduling of the activities in time. The procedure tries
to reconcile any differences that may exist in the format specications for the different
variables. For example, if holidays are formatted as SAS date values while alignment
constraints are specied in terms of SAS datetime values, PROC CPM converts all
of the holidays to SAS datetime values suitably. However, the procedure needs to
know how the variables are to be interpreted (as SAS date, datetime, or time values)
in order for this reconciliation to be correct. Thus, it is important that you always use
a FORMAT statement explicitly for each SAS date, time, or datetime variable that is
used in the invocation of PROC CPM.
154
Chapter 2. The CPM Procedure
Computer Resource Requirements
There is no inherent limit on the size of the project that can be scheduled with the
CPM procedure. The number of activities and precedences, as well as the number
of resources are constrained only by the amount of memory available. Naturally,
there needs to be a sufcient amount of core memory available in order to invoke and
initialize the SAS system. As far as possible, the procedure attempts to store all the
data in core memory.
However, if the problem is too large to t in core memory, the procedure resorts to
the use of utility data sets and swaps between core memory and utility data sets as
necessary, unless the NOUTIL option is specied. The procedure uses the NACTS=,
NADJ=, NNODES=, and NRESREQ= options to determine approximate problem
size. If these options are not specied, the procedure estimates default values on the
basis of the number of observations in the Activity data set. See the Syntax section
on page 72 for default specications.
The storage requirement for the data area required by the procedure is proportional to
the number of activities and precedence constraints in the project and depends on the
number of resources required by each activity. The time required depends heavily on
the number of resources that are constrained and on how tightly constrained they are.
Examples
This section contains examples that illustrate several features of the CPM procedure.
Most of the available options are used in at least one example. Two tables, Table 2.28
and Table 2.29, at the end of this section list all the examples in this chapter and the
options and statements in the CPM procedure that are illustrated by each example.
A simple project concerning the manufacture of a widget is used in most of the ex-
amples in this section. Example 2.22 deals with a nonstandard application of PROC
CPM and illustrates the richness of the modeling environment that is available with
the SAS System. The last few examples use different projects to illustrate multi-
project scheduling and resource-driven durations. resource calendars and negative
resource requirements.
There are 14 activities in the widget manufacturing project. Example 2.1 and
Example 2.2 illustrate a basic project network that is built upon by succeeding ex-
amples. The tasks in the project can be classied by the division or department that
is responsible for them.
Table 2.26 lists the detailed names (and corresponding abbreviations) of all the ac-
tivities in the project and the department that is responsible for each one. As in any
typical project, some of these activities must be completed before others. For exam-
ple, the activity Approve Plan must be done before any of the activities Drawings,
Anal. Market, and Write Specs, can start. Table 2.27 summarizes the relation-
ships among the tasks and gives the duration in days to complete each task. This
table shows the relationship among tasks by listing the immediate successors to each
task.
Examples
155
Table 2.26. Widget Manufacture: Activity List
Task Department Activity Description
Approve Plan Planning Finalize and Approve Plan
Drawings Engineering Prepare Drawings
Anal. Market Marketing Analyze Potential Markets
Write Specs Engineering Write Specications
Prototype Engineering Build Prototype
Mkt. Strat. Marketing Develop Marketing Concept
Materials Manufacturing Procure Raw Materials
Facility Manufacturing Prepare Manufacturing Facility
Init. Prod. Manufacturing Initial Production Run
Evaluate Testing Evaluate Product In-House
Test Market Testing Mail Product to Sample Market
Changes Engineering Engineering Changes
Production Manufacturing Begin Full Scale Production
Marketing Marketing Begin Full Scale Marketing
Table 2.27. Widget Manufacture: Precedence Information
Task Dur Successor Successor Successor
Approve Plan 10 Drawings Anal. Market Write Specs
Drawings 20 Prototype
Anal. Market 10 Mkt. Strat.
Write Specs 15 Prototype
Prototype 30 Materials Facility
Mkt. Strat. 25 Test Market Marketing
Materials 60 Init. Prod.
Facility 45 Init. Prod.
Init. Prod. 30 Test Market Marketing Evaluate
Evaluate 40 Changes
Test Market 30 Changes
Changes 15 Production
Production 0
Marketing 0
The relationship among the tasks can be represented by the network in Figure 2.6.
The diagram was produced by the NETDRAW procedure. The code used is the same
as in Example 5.11 in Chapter 5, The NETDRAW Procedure, although the colors
may be different.
156
Chapter 2. The CPM Procedure
Example 2.1. Activity-on-Node Representation
Figure 2.6. Network Showing Task Relationships in Activity-on-Node Format
The following DATA step reads the project network in AON format into a SAS
data set named WIDGET. The data set contains the minimum amount of informa-
tion needed to invoke PROC CPM, namely, the ACTIVITY variable, one or more
SUCCESSOR variables, and a DURATION variable. PROC CPM is invoked, and
the Schedule data set is displayed using the PRINT procedure in Output 2.1.1. The
Schedule data set produced by PROC CPM contains the solution in canonical units,
without reference to any calendar date or time. For instance, the early start time of
the rst activity in the project is the beginning of period 0 and the early nish time is
the beginning of period 5.
/* Activity-on-Node representation of the project */
data widget;
format task $12. succ1-succ3 $12.;
input task & days succ1 & succ2 & succ3 & ;
datalines;
Approve Plan 5 Drawings Anal. Market Write Specs
Drawings 10 Prototype . .
Anal. Market 5 Mkt. Strat. . .
Write Specs 5 Prototype . .
Prototype 15 Materials Facility .
Mkt. Strat. 10 Test Market Marketing .
Example 2.1. Activity-on-Node Representation
157
Materials 10 Init. Prod. . .
Facility 10 Init. Prod. . .
Init. Prod. 10 Test Market Marketing Evaluate
Evaluate 10 Changes . .
Test Market 15 Changes . .
Changes 5 Production . .
Production 0 . . .
Marketing 0 . . .
;
/* Invoke PROC CPM to schedule the project specifying the */
/* ACTIVITY, DURATION and SUCCESSOR variables */
proc cpm;
activity task;
duration days;
successor succ1 succ2 succ3;
run;
title Widget Manufacture: Activity-On-Node Format;
title2 Critical Path;
proc print;
run;
Output 2.1.1. Critical Path
Widget Manufacture: Activity-On-Node Format
Critical Path
E L
E _ L _ T F
_ F _ F _ _
s s s S I S I F F
t u u u d T N T N L L
O a c c c a A I A I O O
b s c c c y R S R S A A
s k 1 2 3 s T H T H T T
1 Approve Plan Drawings Anal. Market Write Specs 5 0 5 0 5 0 0
2 Drawings Prototype 10 5 15 5 15 0 0
3 Anal. Market Mkt. Strat. 5 5 10 35 40 30 0
4 Write Specs Prototype 5 5 10 10 15 5 5
5 Prototype Materials Facility 15 15 30 15 30 0 0
6 Mkt. Strat. Test Market Marketing 10 10 20 40 50 30 30
7 Materials Init. Prod. 10 30 40 30 40 0 0
8 Facility Init. Prod. 10 30 40 30 40 0 0
9 Init. Prod. Test Market Marketing Evaluate 10 40 50 40 50 0 0
10 Evaluate Changes 10 50 60 55 65 5 5
11 Test Market Changes 15 50 65 50 65 0 0
12 Changes Production 5 65 70 65 70 0 0
13 Production 0 70 70 70 70 0 0
14 Marketing 0 50 50 70 70 20 20
Alternately, if you know that the project is to start on December 1, 2003, then you
can determine the project schedule with reference to calendar dates by specifying the
DATE= option in the PROC CPM statement. The default unit of duration is assumed
to be DAY. The architecture of PROC CPM enables you to include any number of
additional variables that are relevant to the project. Here, for example, you may want
to include more descriptive activity names and department information. The data
set DETAILS contains more information about the project that is merged with the
WIDGET data set to produce the WIDGETN data set. The ID statement is useful to
158
Chapter 2. The CPM Procedure
carry information through to the output data set. Output 2.1.2 displays the resulting
output data set.
data details;
format task $12. dept $13. descrpt $30. ;
input task & dept $ descrpt & ;
label dept = "Department"
descrpt = "Activity Description";
datalines;
Approve Plan Planning Finalize and Approve Plan
Drawings Engineering Prepare Drawings
Anal. Market Marketing Analyze Potential Markets
Write Specs Engineering Write Specifications
Prototype Engineering Build Prototype
Mkt. Strat. Marketing Develop Marketing Concept
Materials Manufacturing Procure Raw Materials
Facility Manufacturing Prepare Manufacturing Facility
Init. Prod. Manufacturing Initial Production Run
Evaluate Testing Evaluate Product In-House
Test Market Testing Mail Product to Sample Market
Changes Engineering Engineering Changes
Production Manufacturing Begin Full Scale Production
Marketing Marketing Begin Full Scale Marketing
;
/* Combine project network data with additional details */
data widgetn;
merge widget details;
run;
/* Schedule using PROC CPM, identifying the variables */
/* that specify additional project information */
/* and set project start date to be December 1, 2003 */
proc cpm data=widgetn date=1dec03d;
activity task;
successor succ1 succ2 succ3;
duration days;
id dept descrpt;
run;
proc sort;
by e_start;
run;
options ls=90;
title2 Project Schedule;
proc print;
id descrpt;
var dept e_: l_: t_float f_float;
run;
Example 2.2. Activity-on-Arc Representation
159
Output 2.1.2. Critical Path: Activity-On-Node Format
Widget Manufacture: Activity-On-Node Format
Project Schedule
E L
d E _ L _ T F
e _ F _ F _ _
s S I S I F F
c d T N T N L L
r e A I A I O O
p p R S R S A A
t t T H T H T T
Finalize and Approve Plan Planning 01DEC03 05DEC03 01DEC03 05DEC03 0 0
Prepare Drawings Engineering 06DEC03 15DEC03 06DEC03 15DEC03 0 0
Analyze Potential Markets Marketing 06DEC03 10DEC03 05JAN04 09JAN04 30 0
Write Specifications Engineering 06DEC03 10DEC03 11DEC03 15DEC03 5 5
Develop Marketing Concept Marketing 11DEC03 20DEC03 10JAN04 19JAN04 30 30
Build Prototype Engineering 16DEC03 30DEC03 16DEC03 30DEC03 0 0
Procure Raw Materials Manufacturing 31DEC03 09JAN04 31DEC03 09JAN04 0 0
Prepare Manufacturing Facility Manufacturing 31DEC03 09JAN04 31DEC03 09JAN04 0 0
Initial Production Run Manufacturing 10JAN04 19JAN04 10JAN04 19JAN04 0 0
Evaluate Product In-House Testing 20JAN04 29JAN04 25JAN04 03FEB04 5 5
Test Product in Sample Market Testing 20JAN04 03FEB04 20JAN04 03FEB04 0 0
Begin Full Scale Marketing Marketing 20JAN04 20JAN04 09FEB04 09FEB04 20 20
Engineering Changes Engineering 04FEB04 08FEB04 04FEB04 08FEB04 0 0
Begin Full Scale Production Manufacturing 09FEB04 09FEB04 09FEB04 09FEB04 0 0
Example 2.2. Activity-on-Arc Representation
Figure 2.7. Network Showing Task Relationships in Activity-on-Arc Format
160
Chapter 2. The CPM Procedure
The problem discussed in Example 2.1 can also be described in an AOA format.
The network is illustrated in Figure 2.7. Note that the network has an arc labeled
Dummy, which is required to accurately capture all the precedence relationships.
Dummy arcs are often needed when representing scheduling problems in AOA for-
mat.
The following DATA step saves the network description in a SAS data set,
WIDGAOA. The data set contains the minimum amount of information required by
PROC CPM for an activity network in AOA format, namely, the TAILNODE and
HEADNODE variables, which indicate the direction of each arc in the network and
the DURATION variable which gives the length of each task. In addition, the data
set also contains a variable identifying the name of the task associated with each
arc. This variable, task, can be identied to PROC CPM using the ACTIVITY state-
ment. Note that PROC CPM treats each observation in the data set as a new task,
thus enabling you to specify multiple arcs between a pair of nodes. In this example,
for instance, both the tasks Drawings and Write Specs connect the nodes 2 and
3; likewise, both the tasks Materials and Facility connect the nodes 5 and 7. If
multiple arcs are not allowed, you would need more dummy arcs in this example.
However, the dummy arc between nodes 8 and 6 is essential to the structure of the
network and cannot be eliminated.
As in Example 2.1, the data set DETAILS containing additional activity information,
can be merged with the Activity data set and used as input to PROCCPMto determine
the project schedule. For purposes of display (in Gantt charts, and so on) the dummy
activity has been given a label, Production Milestone. Output 2.2.1 displays the
project schedule.
/* Activity-on-Arc representation of the project */
data widgaoa;
format task $12. ;
input task & days tail head;
datalines;
Approve Plan 5 1 2
Drawings 10 2 3
Anal. Market 5 2 4
Write Specs 5 2 3
Prototype 15 3 5
Mkt. Strat. 10 4 6
Materials 10 5 7
Facility 10 5 7
Init. Prod. 10 7 8
Evaluate 10 8 9
Test Market 15 6 9
Changes 5 9 10
Production 0 10 11
Marketing 0 6 12
Dummy 0 8 6
;
Example 2.2. Activity-on-Arc Representation
161
data details;
format task $12. dept $13. descrpt $30.;
input task & dept $ descrpt & ;
label dept = "Department"
descrpt = "Activity Description";
datalines;
Approve Plan Planning Finalize and Approve Plan
Drawings Engineering Prepare Drawings
Anal. Market Marketing Analyze Potential Markets
Write Specs Engineering Write Specifications
Prototype Engineering Build Prototype
Mkt. Strat. Marketing Develop Marketing Concept
Materials Manufacturing Procure Raw Materials
Facility Manufacturing Prepare Manufacturing Facility
Init. Prod. Manufacturing Initial Production Run
Evaluate Testing Evaluate Product In-House
Test Market Testing Mail Product to Sample Market
Changes Engineering Engineering Changes
Production Manufacturing Begin Full Scale Production
Marketing Marketing Begin Full Scale Marketing
Dummy . Production Milestone
;
data widgeta;
merge widgaoa details;
run;
/* The project is scheduled using PROC CPM */
/* The network information is conveyed using the TAILNODE */
/* and HEADNODE statements. The ID statement is used to */
/* transfer project information to the output data set */
proc cpm data=widgeta date=1dec03d out=save;
tailnode tail;
headnode head;
duration days;
activity task;
id dept descrpt;
run;
proc sort;
by e_start;
run;
options ls=90;
title Widget Manufacture: Activity-On-Arc Format;
title2 Project Schedule;
proc print;
id descrpt;
var dept e_: l_: t_float f_float;
run;
162
Chapter 2. The CPM Procedure
Output 2.2.1. Critical Path: Activity-on-Arc Format
Widget Manufacture: Activity-On-Arc Format
Project Schedule
E L
d E _ L _ T F
e _ F _ F _ _
s S I S I F F
c d T N T N L L
r e A I A I O O
p p R S R S A A
t t T H T H T T
Finalize and Approve Plan Planning 01DEC03 05DEC03 01DEC03 05DEC03 0 0
Prepare Drawings Engineering 06DEC03 15DEC03 06DEC03 15DEC03 0 0
Analyze Potential Markets Marketing 06DEC03 10DEC03 05JAN04 09JAN04 30 0
Write Specifications Engineering 06DEC03 10DEC03 11DEC03 15DEC03 5 5
Develop Marketing Concept Marketing 11DEC03 20DEC03 10JAN04 19JAN04 30 30
Build Prototype Engineering 16DEC03 30DEC03 16DEC03 30DEC03 0 0
Procure Raw Materials Manufacturing 31DEC03 09JAN04 31DEC03 09JAN04 0 0
Prepare Manufacturing Facility Manufacturing 31DEC03 09JAN04 31DEC03 09JAN04 0 0
Initial Production Run Manufacturing 10JAN04 19JAN04 10JAN04 19JAN04 0 0
Evaluate Product In-House Testing 20JAN04 29JAN04 25JAN04 03FEB04 5 5
Mail Product to Sample Market Testing 20JAN04 03FEB04 20JAN04 03FEB04 0 0
Begin Full Scale Marketing Marketing 20JAN04 20JAN04 09FEB04 09FEB04 20 20
Production Milestone 20JAN04 20JAN04 20JAN04 20JAN04 0 0
Engineering Changes Engineering 04FEB04 08FEB04 04FEB04 08FEB04 0 0
Begin Full Scale Production Manufacturing 09FEB04 09FEB04 09FEB04 09FEB04 0 0
Example 2.3. Meeting Project Deadlines
This example illustrates the use of the project nish date (using the FBDATE= option)
to specify a deadline on the project. In the following program it is assumed that the
project data are saved in the data set WIDGAOA. PROC CPM is rst invoked with
the FBDATE= option. Output 2.3.1 shows the resulting schedule. Note that the entire
schedule is shifted in time (as compared to the schedule in Output 2.2.1) so that the
end of the project is on March 1, 2004. The second part of the program species
a project start date in addition to the project nish date using both the DATE= and
FBDATE= options. The schedule displayed in Output 2.3.2 shows that all of the
activities have a larger oat than before due to the imposition of a less stringent target
date.
proc cpm data=widgaoa
fbdate=1mar04d interval=day;
tailnode tail;
headnode head;
duration days;
id task;
run;
proc sort;
by e_start;
run;
Example 2.3. Meeting Project Deadlines
163
options ps=60 ls=78;
title Meeting Project Deadlines;
title2 Specification of Project Finish Date;
proc print;
id task;
var e_: l_: t_float f_float;
run;
proc cpm data=widgaoa
fbdate=1mar04d
date=1dec03d interval=day;
tailnode tail;
headnode head;
duration days;
id task;
run;
proc sort;
by e_start;
run;
title2 Specifying Project Start and Completion Dates;
proc print;
id task;
var e_: l_: t_float f_float;
run;
Output 2.3.1. Meeting Project Deadlines: FBDATE= Option
Meeting Project Deadlines
Specification of Project Finish Date
task E_START E_FINISH L_START L_FINISH T_FLOAT F_FLOAT
Approve Plan 22DEC03 26DEC03 22DEC03 26DEC03 0 0
Drawings 27DEC03 05JAN04 27DEC03 05JAN04 0 0
Anal. Market 27DEC03 31DEC03 26JAN04 30JAN04 30 0
Write Specs 27DEC03 31DEC03 01JAN04 05JAN04 5 5
Mkt. Strat. 01JAN04 10JAN04 31JAN04 09FEB04 30 30
Prototype 06JAN04 20JAN04 06JAN04 20JAN04 0 0
Materials 21JAN04 30JAN04 21JAN04 30JAN04 0 0
Facility 21JAN04 30JAN04 21JAN04 30JAN04 0 0
Init. Prod. 31JAN04 09FEB04 31JAN04 09FEB04 0 0
Evaluate 10FEB04 19FEB04 15FEB04 24FEB04 5 5
Test Market 10FEB04 24FEB04 10FEB04 24FEB04 0 0
Marketing 10FEB04 10FEB04 01MAR04 01MAR04 20 20
Dummy 10FEB04 10FEB04 10FEB04 10FEB04 0 0
Changes 25FEB04 29FEB04 25FEB04 29FEB04 0 0
Production 01MAR04 01MAR04 01MAR04 01MAR04 0 0
164
Chapter 2. The CPM Procedure
Output 2.3.2. Meeting Project Deadlines: DATE= and FBDATE= Options
Meeting Project Deadlines
Specifying Project Start and Completion Dates
task E_START E_FINISH L_START L_FINISH T_FLOAT F_FLOAT
Approve Plan 01DEC03 05DEC03 22DEC03 26DEC03 21 0
Drawings 06DEC03 15DEC03 27DEC03 05JAN04 21 0
Anal. Market 06DEC03 10DEC03 26JAN04 30JAN04 51 0
Write Specs 06DEC03 10DEC03 01JAN04 05JAN04 26 5
Mkt. Strat. 11DEC03 20DEC03 31JAN04 09FEB04 51 30
Prototype 16DEC03 30DEC03 06JAN04 20JAN04 21 0
Materials 31DEC03 09JAN04 21JAN04 30JAN04 21 0
Facility 31DEC03 09JAN04 21JAN04 30JAN04 21 0
Init. Prod. 10JAN04 19JAN04 31JAN04 09FEB04 21 0
Evaluate 20JAN04 29JAN04 15FEB04 24FEB04 26 5
Test Market 20JAN04 03FEB04 10FEB04 24FEB04 21 0
Marketing 20JAN04 20JAN04 01MAR04 01MAR04 41 41
Dummy 20JAN04 20JAN04 10FEB04 10FEB04 21 0
Changes 04FEB04 08FEB04 25FEB04 29FEB04 21 0
Production 09FEB04 09FEB04 01MAR04 01MAR04 21 21
Example 2.4. Displaying the Schedule on a Calendar
This example shows how you can use the output from CPM to display calendars
containing the critical path schedule and the early start schedule. The example uses
the network described in Example 2.2 and assumes that the data set SAVE contains
the project schedule. The following program invokes PROC CALENDAR to produce
two calendars; the rst calendar in Output 2.4.1 displays only the critical activities in
the project, while the second calendar in Output 2.4.2 displays all the activities in the
project. In both invocations of PROC CALENDAR, a WHERE statement is used to
display only the activities that are scheduled to nish in December.
proc cpm data=widgaoa out=save
date=1dec03d interval=day;
tailnode tail;
headnode head;
duration days;
id task;
run;
proc sort data=save out=crit;
where t_float=0;
by e_start;
run;
title Printing the Schedule on a Calendar;
title2 Critical Activities in December;
Example 2.4. Displaying the Schedule on a Calendar
165
/* print the critical act. calendar */
proc calendar schedule
data=crit;
id e_start;
where e_finish <= 31dec03d;
var task;
dur days;
run;
/* sort data for early start calendar */
proc sort data=save;
by e_start;
/* print the early start calendar */
title2 Early Start Schedule for December;
proc calendar schedule data=save;
id e_start;
where e_finish <= 31dec03d;
var task;
dur days;
run;
Output 2.4.1. Project Calendar: Critical Activities
Printing the Schedule on a Calendar
Critical Activities in December
---------------------------------------------------------------------------------------------------
| |
| December 2003 |
| |
|-------------------------------------------------------------------------------------------------|
| Sunday | Monday | Tuesday | Wednesday | Thursday | Friday | Saturday |
|-------------+-------------+-------------+-------------+-------------+-------------+-------------|
| | 1 | 2 | 3 | 4 | 5 | 6 |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| |+===========================Approve Plan============================+|+=Drawings== |
|-------------+-------------+-------------+-------------+-------------+-------------+-------------|
| 7 | 8 | 9 | 10 | 11 | 12 | 13 |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| ===========================================Drawings============================================ |
|-------------+-------------+-------------+-------------+-------------+-------------+-------------|
| 14 | 15 | 16 | 17 | 18 | 19 | 20 |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| ========Drawings=========+|+=============================Prototype============================= |
|-------------+-------------+-------------+-------------+-------------+-------------+-------------|
| 21 | 22 | 23 | 24 | 25 | 26 | 27 |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| ===========================================Prototype=========================================== |
|-------------+-------------+-------------+-------------+-------------+-------------+-------------|
| 28 | 29 | 30 | 31 | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| ===============Prototype===============+| | | | |
---------------------------------------------------------------------------------------------------
166
Chapter 2. The CPM Procedure
Output 2.4.2. Project Calendar: All Activities
Printing the Schedule on a Calendar
Early Start Schedule for December
---------------------------------------------------------------------------------------------------
| |
| December 2003 |
| |
|-------------------------------------------------------------------------------------------------|
| Sunday | Monday | Tuesday | Wednesday | Thursday | Friday | Saturday |
|-------------+-------------+-------------+-------------+-------------+-------------+-------------|
| | 1 | 2 | 3 | 4 | 5 | 6 |
| | | | | | | |
| | | | | | |+Write Specs |
| | | | | | |+Anal. Marke |
| |+===========================Approve Plan============================+|+=Drawings== |
|-------------+-------------+-------------+-------------+-------------+-------------+-------------|
| 7 | 8 | 9 | 10 | 11 | 12 | 13 |
| | | | | | | |
| =====================Write Specs=====================+| | | |
| ====================Anal. Market=====================+|+==============Mkt. Strat.============== |
| ===========================================Drawings============================================ |
|-------------+-------------+-------------+-------------+-------------+-------------+-------------|
| 14 | 15 | 16 | 17 | 18 | 19 | 20 |
| | | | | | | |
| | | | | | | |
| ==========================================Mkt. Strat.==========================================+|
| ========Drawings=========+|+=============================Prototype============================= |
|-------------+-------------+-------------+-------------+-------------+-------------+-------------|
| 21 | 22 | 23 | 24 | 25 | 26 | 27 |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| ===========================================Prototype=========================================== |
|-------------+-------------+-------------+-------------+-------------+-------------+-------------|
| 28 | 29 | 30 | 31 | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| ===============Prototype===============+| | | | |
---------------------------------------------------------------------------------------------------
Example 2.5. Precedence Gantt Chart
This example produces a Gantt chart of the schedule obtained from PROC CPM.
The example uses the network described in Example 2.2 (AOA format) and assumes
that the data set SAVE contains the schedule produced by PROC CPM and sorted
by the variable E
START. The Gantt chart produced shows the early and late start
schedules as well as the precedence relationships between the activities. The prece-
dence information is conveyed to PROC GANTT through the TAILNODE= and
HEADNODE= options.
* specify the device on which you want the chart printed;
goptions vpos=50 hpos=80 border;
title f=swiss Precedence Gantt Chart;
title2 f=swiss Early and Late Start Schedule;
Example 2.6. Changing Duration Units
167
proc gantt graphics data=save;
chart / compress tailnode=tail headnode=head
font=swiss height=1.5 nojobnum skip=2
cprec=cyan cmile=magenta
caxis=black cframe=ligr
dur=days increment=7 nolegend;
id descrpt;
run;
Output 2.5.1. Gantt Chart of Project
Example 2.6. Changing Duration Units
This example illustrates the use of the INTERVAL= option to identify the units of
duration to PROC CPM. In the previous examples, it was assumed that work can
be done on the activities all seven days of the week without any break. Suppose
now that you want to schedule the activities only on weekdays. To do so, specify
INTERVAL=WEEKDAY in the PROC CPM statement. Output 2.6.1 displays the
schedule produced by PROC CPM. Note that, with a shorter work week, the project
nishes on March 8, 2004, instead of on February 9, 2004.
168
Chapter 2. The CPM Procedure
proc cpm data=widget out=save
date=1dec03d interval=weekday;
activity task;
succ succ1 succ2 succ3;
duration days;
run;
title Changing Duration Units;
title2 INTERVAL=WEEKDAY;
proc print;
id task;
var e_: l_: t_float f_float;
run;
Output 2.6.1. Changing Duration Units: INTERVAL=WEEKDAY
Changing Duration Units
INTERVAL=WEEKDAY
task E_START E_FINISH L_START L_FINISH T_FLOAT F_FLOAT
Approve Plan 01DEC03 05DEC03 01DEC03 05DEC03 0 0
Drawings 08DEC03 19DEC03 08DEC03 19DEC03 0 0
Anal. Market 08DEC03 12DEC03 19JAN04 23JAN04 30 0
Write Specs 08DEC03 12DEC03 15DEC03 19DEC03 5 5
Prototype 22DEC03 09JAN04 22DEC03 09JAN04 0 0
Mkt. Strat. 15DEC03 26DEC03 26JAN04 06FEB04 30 30
Materials 12JAN04 23JAN04 12JAN04 23JAN04 0 0
Facility 12JAN04 23JAN04 12JAN04 23JAN04 0 0
Init. Prod. 26JAN04 06FEB04 26JAN04 06FEB04 0 0
Evaluate 09FEB04 20FEB04 16FEB04 27FEB04 5 5
Test Market 09FEB04 27FEB04 09FEB04 27FEB04 0 0
Changes 01MAR04 05MAR04 01MAR04 05MAR04 0 0
Production 08MAR04 08MAR04 08MAR04 08MAR04 0 0
Marketing 09FEB04 09FEB04 08MAR04 08MAR04 20 20
To display the weekday schedule on a calendar, use the WEEKDAY option in the
PROC CALENDAR statement. The following code sorts the Schedule data set by the
E
START variable and produces a calendar shown in Output 2.6.2, which displays
the schedule of activities for the month of December.
proc sort;
by e_start;
run;
/* truncate schedule: print only for december */
data december;
set save;
e_finish = min(31dec03d, e_finish);
if e_start <= 31dec03d;
run;
Example 2.6. Changing Duration Units
169
title3 Calendar of Schedule;
proc calendar data=december schedule weekdays;
id e_start;
finish e_finish;
var task;
run;
Output 2.6.2. Changing Duration Units: WEEKDAY Calendar for December
Changing Duration Units
INTERVAL=WEEKDAY
Calendar of Schedule
----------------------------------------------------------------------------
| |
| December 2003 |
| |
|--------------------------------------------------------------------------|
| Monday | Tuesday | Wednesday | Thursday | Friday |
|--------------+--------------+--------------+--------------+--------------|
| 1 | 2 | 3 | 4 | 5 |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
|+==============================Approve Plan==============================+|
|--------------+--------------+--------------+--------------+--------------|
| 8 | 9 | 10 | 11 | 12 |
| | | | | |
| | | | | |
|+==============================Write Specs===============================+|
|+==============================Anal. Market==============================+|
|+================================Drawings================================ |
|--------------+--------------+--------------+--------------+--------------|
| 15 | 16 | 17 | 18 | 19 |
| | | | | |
| | | | | |
| | | | | |
|+==============================Mkt. Strat.=============================== |
| ================================Drawings================================+|
|--------------+--------------+--------------+--------------+--------------|
| 22 | 23 | 24 | 25 | 26 |
| | | | | |
| | | | | |
| | | | | |
|+===============================Prototype================================ |
| ==============================Mkt. Strat.===============================+|
|--------------+--------------+--------------+--------------+--------------|
| 29 | 30 | 31 | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| ================Prototype=================+| | |
----------------------------------------------------------------------------
170
Chapter 2. The CPM Procedure
Note that the durations of the activities in the project are multiples of 5. Thus, if work
is done only on weekdays, all activities in the project last 0, 1, 2, or 3 weeks. The
INTERVAL= option can also be used to set the units of duration to hours, minutes,
seconds, years, months, quarters, or weeks. In this example, the data set WIDGWK
is created from WIDGET to set the durations in weeks. PROC CPM is then invoked
with INTERVAL=WEEK, and the resulting schedule is displayed in Output 2.6.3.
Note that the oat values are also expressed in units of weeks.
data widgwk;
set widget;
weeks = days / 5;
run;
proc cpm data=widgwk date=1dec03d interval=week;
activity task;
successor succ1 succ2 succ3;
duration weeks;
id task;
run;
title2 INTERVAL=WEEK;
proc print;
id task;
var e_: l_: t_float f_float;
run;
Output 2.6.3. Changing Duration Units: INTERVAL=WEEK
Changing Duration Units
INTERVAL=WEEK
task E_START E_FINISH L_START L_FINISH T_FLOAT F_FLOAT
Approve Plan 01DEC03 07DEC03 01DEC03 07DEC03 0 0
Drawings 08DEC03 21DEC03 08DEC03 21DEC03 0 0
Anal. Market 08DEC03 14DEC03 19JAN04 25JAN04 6 0
Write Specs 08DEC03 14DEC03 15DEC03 21DEC03 1 1
Prototype 22DEC03 11JAN04 22DEC03 11JAN04 0 0
Mkt. Strat. 15DEC03 28DEC03 26JAN04 08FEB04 6 6
Materials 12JAN04 25JAN04 12JAN04 25JAN04 0 0
Facility 12JAN04 25JAN04 12JAN04 25JAN04 0 0
Init. Prod. 26JAN04 08FEB04 26JAN04 08FEB04 0 0
Evaluate 09FEB04 22FEB04 16FEB04 29FEB04 1 1
Test Market 09FEB04 29FEB04 09FEB04 29FEB04 0 0
Changes 01MAR04 07MAR04 01MAR04 07MAR04 0 0
Production 08MAR04 08MAR04 08MAR04 08MAR04 0 0
Marketing 09FEB04 09FEB04 08MAR04 08MAR04 4 4
Example 2.7. Controlling the Project Calendar
171
Example 2.7. Controlling the Project Calendar
This example illustrates the use of the INTERVAL=, DAYSTART=, and
DAYLENGTH= options to control the project calendar. In Example 2.1 through
Example 2.5, none of these three options is specied; hence the durations are
assumed to be days (INTERVAL=DAY), and work is scheduled on all seven days of
the week. In Example 2.6, the specication of INTERVAL=WEEKDAY causes the
schedule to skip weekends. The present example shows further ways of controlling
the project calendar. For example, you may want to control the work pattern during
a standard week or the start and length of the workday.
Suppose you want to schedule the project specied in Example 2.1 but you want to
schedule only on weekdays from 9 a.m. to 5 p.m. To schedule the project, use the
INTERVAL=WORKDAYoption rather than the default INTERVAL=DAY. Then, one
unit of duration is interpreted as eight hours of work. To schedule the manufacturing
project to start on December 1, with an eight-hour workday and a ve-day work week,
you can invoke PROC CPM with the following statements. Output 2.7.1 displays the
resulting schedule; note that the start and nish times are expressed in SAS datetime
values.
title Controlling the Project Calendar;
title2 Scheduling on Workdays;
proc cpm data=widget date=1dec03d interval=workday;
activity task;
succ succ1 succ2 succ3;
duration days;
run;
title3 Day Starts at 9 a.m.;
proc print;
id task;
var e_: l_: t_float f_float;
run;
172
Chapter 2. The CPM Procedure
Output 2.7.1. Controlling the Project Calendar: INTERVAL=WORKDAY
Controlling the Project Calendar
Scheduling on Workdays
Day Starts at 9 a.m.
task E_START E_FINISH L_START
Approve Plan 01DEC03:09:00:00 05DEC03:16:59:59 01DEC03:09:00:00
Drawings 08DEC03:09:00:00 19DEC03:16:59:59 08DEC03:09:00:00
Anal. Market 08DEC03:09:00:00 12DEC03:16:59:59 19JAN04:09:00:00
Write Specs 08DEC03:09:00:00 12DEC03:16:59:59 15DEC03:09:00:00
Prototype 22DEC03:09:00:00 09JAN04:16:59:59 22DEC03:09:00:00
Mkt. Strat. 15DEC03:09:00:00 26DEC03:16:59:59 26JAN04:09:00:00
Materials 12JAN04:09:00:00 23JAN04:16:59:59 12JAN04:09:00:00
Facility 12JAN04:09:00:00 23JAN04:16:59:59 12JAN04:09:00:00
Init. Prod. 26JAN04:09:00:00 06FEB04:16:59:59 26JAN04:09:00:00
Evaluate 09FEB04:09:00:00 20FEB04:16:59:59 16FEB04:09:00:00
Test Market 09FEB04:09:00:00 27FEB04:16:59:59 09FEB04:09:00:00
Changes 01MAR04:09:00:00 05MAR04:16:59:59 01MAR04:09:00:00
Production 08MAR04:09:00:00 08MAR04:09:00:00 08MAR04:09:00:00
Marketing 09FEB04:09:00:00 09FEB04:09:00:00 08MAR04:09:00:00
task L_FINISH T_FLOAT F_FLOAT
Approve Plan 05DEC03:16:59:59 0 0
Drawings 19DEC03:16:59:59 0 0
Anal. Market 23JAN04:16:59:59 30 0
Write Specs 19DEC03:16:59:59 5 5
Prototype 09JAN04:16:59:59 0 0
Mkt. Strat. 06FEB04:16:59:59 30 30
Materials 23JAN04:16:59:59 0 0
Facility 23JAN04:16:59:59 0 0
Init. Prod. 06FEB04:16:59:59 0 0
Evaluate 27FEB04:16:59:59 5 5
Test Market 27FEB04:16:59:59 0 0
Changes 05MAR04:16:59:59 0 0
Production 08MAR04:09:00:00 0 0
Marketing 08MAR04:09:00:00 20 20
If you want to change the length of the workday, use the DAYLENGTH= op-
tion in the PROC CPM statement. For example, if you want an eight-and-a-
half hour workday instead of the default eight-hour workday, you should include
DAYLENGTH=08:30T in the PROC CPM statement. In addition, you might also
want to change the start of the workday. The workday starts at 9 a.m., by default. To
change the default, use the DAYSTART= option. The following program schedules
the project to start at 7 a.m. on December 1. The project is scheduled on eight-
and-a-half hour workdays each starting at 7 a.m. Output 2.7.2 displays the resulting
schedule produced by PROC CPM.
proc cpm data=widget date=1dec03d interval=workday
daylength=08:30t daystart=07:00t;
activity task;
succ succ1 succ2 succ3;
duration days;
run;
Example 2.7. Controlling the Project Calendar
173
title3 Day Starts at 7 a.m. and is 8.5 Hours Long;
proc print;
id task;
var e_: l_: t_float f_float;
run;
Output 2.7.2. Controlling the Project Calendar: DAYSTART and DAYLENGTH
Controlling the Project Calendar
Scheduling on Workdays
Day Starts at 7 a.m. and is 8.5 Hours Long
task E_START E_FINISH L_START
Approve Plan 01DEC03:07:00:00 05DEC03:15:29:59 01DEC03:07:00:00
Drawings 08DEC03:07:00:00 19DEC03:15:29:59 08DEC03:07:00:00
Anal. Market 08DEC03:07:00:00 12DEC03:15:29:59 19JAN04:07:00:00
Write Specs 08DEC03:07:00:00 12DEC03:15:29:59 15DEC03:07:00:00
Prototype 22DEC03:07:00:00 09JAN04:15:29:59 22DEC03:07:00:00
Mkt. Strat. 15DEC03:07:00:00 26DEC03:15:29:59 26JAN04:07:00:00
Materials 12JAN04:07:00:00 23JAN04:15:29:59 12JAN04:07:00:00
Facility 12JAN04:07:00:00 23JAN04:15:29:59 12JAN04:07:00:00
Init. Prod. 26JAN04:07:00:00 06FEB04:15:29:59 26JAN04:07:00:00
Evaluate 09FEB04:07:00:00 20FEB04:15:29:59 16FEB04:07:00:00
Test Market 09FEB04:07:00:00 27FEB04:15:29:59 09FEB04:07:00:00
Changes 01MAR04:07:00:00 05MAR04:15:29:59 01MAR04:07:00:00
Production 08MAR04:07:00:00 08MAR04:07:00:00 08MAR04:07:00:00
Marketing 09FEB04:07:00:00 09FEB04:07:00:00 08MAR04:07:00:00
task L_FINISH T_FLOAT F_FLOAT
Approve Plan 05DEC03:15:29:59 0 0
Drawings 19DEC03:15:29:59 0 0
Anal. Market 23JAN04:15:29:59 30 0
Write Specs 19DEC03:15:29:59 5 5
Prototype 09JAN04:15:29:59 0 0
Mkt. Strat. 06FEB04:15:29:59 30 30
Materials 23JAN04:15:29:59 0 0
Facility 23JAN04:15:29:59 0 0
Init. Prod. 06FEB04:15:29:59 0 0
Evaluate 27FEB04:15:29:59 5 5
Test Market 27FEB04:15:29:59 0 0
Changes 05MAR04:15:29:59 0 0
Production 08MAR04:07:00:00 0 0
Marketing 08MAR04:07:00:00 20 20
An alternate way of specifying the start of each working day is to set the INTERVAL=
option to DTWRKDAY and specify a SAS datetime value for the project start date.
Using INTERVAL=DTWRKDAY tells CPM that the DATE= option is a SAS date-
time value and that the time given is the start of the workday. For the present example,
you could have used DATE=1dec03:07:00dt in conjunction with the specication
INTERVAL=DTWRKDAY and DAYLENGTH=08:30t.
174
Chapter 2. The CPM Procedure
Example 2.8. Scheduling around Holidays
This example shows how you can schedule around holidays with PROC CPM. First,
save a list of holidays in a SAS data set as SAS date variables. The length of the
holidays is assumed to be measured in units specied by the INTERVAL= option.
By default, all holidays are assumed to be one unit long. You can control the length
of each holiday by specifying either the nish time for each holiday or the length of
each holiday in the same observation as the holiday specication.
Output 2.8.1. Scheduling around Holidays: HOLIDAYS data set
Scheduling Around Holidays
Data Set HOLIDAYS
Obs holiday holifin holidur
1 24DEC03 26DEC03 4
2 01JAN04 . .
For example, the data set HOLIDAYS, displayed in Output 2.8.1 species two holi-
days, one for Christmas and the other for New Years Day. The variable holiday spec-
ies the start of each holiday. The variable holin species the end of the Christmas
holiday as 26Dec03. Alternately, the variable holidur can be used to interpret the
Christmas holiday as lasting four interval units starting from the 24th of December.
If the variable holidur is used, the actual days when work is not done depends on the
INTERVAL= option and on the underlying calendar used. This form of specifying
holidays or breaks is useful for indicating vacations for specic employees. The sec-
ond observation in the data set denes the New Years holiday as just one day long
because both the variables holin and holidur variables have missing values.
To invoke PROC CPM to schedule around holidays, use the HOLIDATA= option in
the PROC CPM statement (see the following program) to identify the data set, and
list the names of the variables in the data set in a HOLIDAY statement. The holiday
start and nish are identied by specifying the HOLIDAY and HOLIFIN variables.
Output 2.8.2 displays the schedule obtained.
proc cpm data=widget holidata=holidays
out=saveh date=1dec03d ;
activity task;
succ succ1 succ2 succ3;
duration days;
holiday holiday / holifin=(holifin);
run;
proc sort data=saveh;
by e_start;
run;
Example 2.8. Scheduling around Holidays
175
title Scheduling Around Holidays;
title2 Project Schedule;
goptions vpos=50 hpos=80 border;
goptions ftext=swiss;
proc gantt graphics data=saveh holidata=holidays;
chart / compress
font=swiss height=1.5 nojobnum skip=2
dur=days increment=7
holiday=(holiday) holifin=(holifin)
cframe=ligr;
id task;
run;
Output 2.8.2. Scheduling around Holidays: Project Schedule
The next two invocations illustrate the use of the HOLIDUR= option and the effect
of the INTERVAL= option on the duration of the holidays. Recall that the holiday
duration is also assumed to be in interval units where interval is the value specied for
the INTERVAL= option. Suppose that a holiday period for the entire project starts on
December 24, 2003, with duration specied as 4. First the project is scheduled with
INTERVAL=DAY so that the holidays are on December 24, 25, 26, and 27, 2003.
Output 2.8.3 displays the resulting schedule. The project completion is delayed by
one day due to the extra holiday on December 27, 2003.
176
Chapter 2. The CPM Procedure
proc cpm data=widget holidata=holidays
out=saveh1 date=1dec03d
interval=day;
activity task;
succ succ1 succ2 succ3;
duration days;
holiday holiday / holidur=(holidur);
run;
title2 Variable Length Holidays : INTERVAL=DAY;
proc sort data=saveh1;
by e_start;
run;
proc gantt graphics data=saveh1 holidata=holidays;
chart / compress
font=swiss
height=1.5 skip=2
nojobnum
dur=days increment=7
holiday=(holiday) holidur=(holidur) interval=day
cframe=ligr;
id task;
run;
Output 2.8.3. Scheduling around Holidays: INTERVAL=DAY
Example 2.8. Scheduling around Holidays
177
Next, suppose that work on the project is to be scheduled only on weekdays. The
INTERVAL= option is set to WEEKDAY. Then, the value 4 specied for the vari-
able holidur is interpreted as 4 weekdays. Thus, the holidays are on December 24,
25, 26, and 29, 2003, because December 27 and 28 (Saturday and Sunday) are non-
working days anyway. (Note that if holin had been used, the holiday would have
ended on December 26, 2003.) The following statements schedule the project to
start on December 1, 2003 with INTERVAL=WEEKDAY. Output 2.8.4 displays the
resulting schedule. Note the further delay in project completion time.
proc cpm data=widget holidata=holidays
out=saveh2 date=1dec03d
interval=weekday;
activity task;
succ succ1 succ2 succ3;
duration days;
holiday holiday / holidur=(holidur);
run;
proc sort data=saveh2;
by e_start;
run;
title2 Variable Length Holidays : INTERVAL=WEEKDAY;
proc gantt graphics data=saveh2 holidata=holidays;
chart / compress
font=swiss
height=1.5 skip=2
nojobnum
dur=days increment=7
holiday=(holiday)
holidur=(holidur)
interval=weekday
cframe=ligr;
id task;
run;
178
Chapter 2. The CPM Procedure
Output 2.8.4. Scheduling around Holidays: INTERVAL=WEEKDAY
Finally, the same project is scheduled to start on December 1, 2003 with
INTERVAL=WORKDAY. Output 2.8.5 displays the resulting Schedule data set.
Note that this time the holiday period starts at 5:00 p.m. on December 23, 2003, and
ends at 9:00 a.m. on December 30, 2003.
proc cpm data=widget holidata=holidays
out=saveh3 date=1dec03d
interval=workday;
activity task;
succ succ1 succ2 succ3;
duration days;
holiday holiday / holidur=(holidur);
run;
proc sort data=saveh3;
by e_start;
run;
Example 2.9. CALEDATA and WORKDATA Data Sets
179
title2 Variable Length Holidays : INTERVAL=WORKDAY;
proc gantt graphics data=saveh3 holidata=holidays;
chart / compress
font=swiss height=1.5 nojobnum skip=2
dur=days increment=7
holiday=(holiday) holidur=(holidur) interval=workday
cframe=ligr;
id task;
run;
Output 2.8.5. Scheduling around Holidays: INTERVAL=WORKDAY
Example 2.9. CALEDATA and WORKDATA Data Sets
This example shows how you can schedule the job over a nonstandard day and a
nonstandard week. In the rst part of the example, the calendar followed is a six-day
week with an eight-and-a-half hour workday starting at 7 a.m. The project data are
the same as were used in Example 2.8, but some of the durations have been changed
to include some fractional values. Output 2.9.1 shows the project data set.
180
Chapter 2. The CPM Procedure
Output 2.9.1. Data Set WIDGET9: Scheduling on the Six-Day Week
Scheduling on the 6-Day Week
Data Set WIDGET9
Obs task days succ1 succ2 succ3
1 Approve Plan 5.5 Drawings Anal. Market Write Specs
2 Drawings 10.0 Prototype
3 Anal. Market 5.0 Mkt. Strat.
4 Write Specs 4.5 Prototype
5 Prototype 15.0 Materials Facility
6 Mkt. Strat. 10.0 Test Market Marketing
7 Materials 10.0 Init. Prod.
8 Facility 10.0 Init. Prod.
9 Init. Prod. 10.0 Test Market Marketing Evaluate
10 Evaluate 10.0 Changes
11 Test Market 15.0 Changes
12 Changes 5.0 Production
13 Production 0.0
14 Marketing 0.0
The same Holiday data set is used. To indicate that work is to be done on all days
of the week except Sunday, use INTERVAL=DTDAY and dene a Calendar data
set with a single variable
SUN
CAL for the activity Prototype, and the DEFAULT calendar for the other
activities. Thus, in both the Activity data set and the Calendar data set, the calendar
information is conveyed through a CALID variable, cal.
PROC CPM is rst invoked without reference to the CALID variable. Thus, the
procedure recognizes only the rst observation in the Calendar data set (a warning is
printed to the log to this effect), and only the default calendar is used for all activities
in the project. The daylength parameter is interpreted as the length of a standard work
day; all the durations are assumed to be in units of this standard work day. Output
2.10.4 displays the schedule obtained. Note that the project is scheduled to nish on
March 12, 2004, at 12 noon.
data widgcal;
set widget9;
if task = Production then cal = PROD_CAL;
else if task = Prototype then cal = OVT_CAL;
else cal = DEFAULT;
run;
proc cpm date=01dec03d data=widgcal out=scheddef
holidata=holidays daylength=08:00t
workday=workdata
calendar=calendar;
holiday holiday / holifin = holifin;
activity task;
duration days;
successor succ1 succ2 succ3;
run;
title2 Project Schedule: Default calendar;
proc print;
var task days e_start e_finish l_start l_finish
t_float f_float;
run;
Example 2.10. Multiple Calendars
189
Output 2.10.4. Schedule Using Default Calendar
Multiple Calendars
Project Schedule: Default calendar
Obs task days E_START E_FINISH
1 Approve Plan 5.5 01DEC03:08:00:00 08DEC03:11:59:59
2 Drawings 10.0 08DEC03:12:00:00 22DEC03:11:59:59
3 Anal. Market 5.0 08DEC03:12:00:00 15DEC03:11:59:59
4 Write Specs 4.5 08DEC03:12:00:00 12DEC03:15:59:59
5 Prototype 15.0 22DEC03:12:00:00 16JAN04:11:59:59
6 Mkt. Strat. 10.0 15DEC03:12:00:00 02JAN04:11:59:59
7 Materials 10.0 16JAN04:12:00:00 30JAN04:11:59:59
8 Facility 10.0 16JAN04:12:00:00 30JAN04:11:59:59
9 Init. Prod. 10.0 30JAN04:12:00:00 13FEB04:11:59:59
10 Evaluate 10.0 13FEB04:12:00:00 27FEB04:11:59:59
11 Test Market 15.0 13FEB04:12:00:00 05MAR04:11:59:59
12 Changes 5.0 05MAR04:12:00:00 12MAR04:11:59:59
13 Production 0.0 12MAR04:12:00:00 12MAR04:12:00:00
14 Marketing 0.0 13FEB04:12:00:00 13FEB04:12:00:00
Obs L_START L_FINISH T_FLOAT F_FLOAT
1 01DEC03:08:00:00 08DEC03:11:59:59 0.0 0.0
2 08DEC03:12:00:00 22DEC03:11:59:59 0.0 0.0
3 23JAN04:12:00:00 30JAN04:11:59:59 30.0 0.0
4 16DEC03:08:00:00 22DEC03:11:59:59 5.5 5.5
5 22DEC03:12:00:00 16JAN04:11:59:59 0.0 0.0
6 30JAN04:12:00:00 13FEB04:11:59:59 30.0 30.0
7 16JAN04:12:00:00 30JAN04:11:59:59 0.0 0.0
8 16JAN04:12:00:00 30JAN04:11:59:59 0.0 0.0
9 30JAN04:12:00:00 13FEB04:11:59:59 0.0 0.0
10 20FEB04:12:00:00 05MAR04:11:59:59 5.0 5.0
11 13FEB04:12:00:00 05MAR04:11:59:59 0.0 0.0
12 05MAR04:12:00:00 12MAR04:11:59:59 0.0 0.0
13 12MAR04:12:00:00 12MAR04:12:00:00 0.0 0.0
14 12MAR04:12:00:00 12MAR04:12:00:00 20.0 20.0
Next PROC CPM is invoked with the CALID statement identifying the variable CAL
in the Activity and Calendar data sets. Recall that the two activities, Production and
Prototype, do not follow the default calendar. The schedule displayed in Output
2.10.5 shows that, due to longer working hours for these two activities in the project,
the scheduled nish date is now March 8, at 10:00 a.m.
proc cpm date=01dec03d data=widgcal out=schedmc
holidata=holidays daylength=08:00t
workday=workdata
calendar=calendar;
holiday holiday / holifin = holifin;
activity task;
duration days;
successor succ1 succ2 succ3;
calid cal;
run;
190
Chapter 2. The CPM Procedure
title2 Project Schedule: Three Calendars;
proc print;
var task days cal e_: l_: t_float f_float;
run;
Output 2.10.5. Schedule Using Three Calendars
Multiple Calendars
Project Schedule: Three Calendars
Obs task days cal E_START E_FINISH
1 Approve Plan 5.5 DEFAULT 01DEC03:08:00:00 08DEC03:11:59:59
2 Drawings 10.0 DEFAULT 08DEC03:12:00:00 22DEC03:11:59:59
3 Anal. Market 5.0 DEFAULT 08DEC03:12:00:00 15DEC03:11:59:59
4 Write Specs 4.5 DEFAULT 08DEC03:12:00:00 12DEC03:15:59:59
5 Prototype 15.0 OVT_CAL 22DEC03:12:00:00 12JAN04:09:59:59
6 Mkt. Strat. 10.0 DEFAULT 15DEC03:12:00:00 02JAN04:11:59:59
7 Materials 10.0 DEFAULT 12JAN04:10:00:00 26JAN04:09:59:59
8 Facility 10.0 DEFAULT 12JAN04:10:00:00 26JAN04:09:59:59
9 Init. Prod. 10.0 DEFAULT 26JAN04:10:00:00 09FEB04:09:59:59
10 Evaluate 10.0 DEFAULT 09FEB04:10:00:00 23FEB04:09:59:59
11 Test Market 15.0 DEFAULT 09FEB04:10:00:00 01MAR04:09:59:59
12 Changes 5.0 DEFAULT 01MAR04:10:00:00 08MAR04:09:59:59
13 Production 0.0 PROD_CAL 08MAR04:10:00:00 08MAR04:10:00:00
14 Marketing 0.0 DEFAULT 09FEB04:10:00:00 09FEB04:10:00:00
Obs L_START L_FINISH T_FLOAT F_FLOAT
1 01DEC03:08:00:00 08DEC03:11:59:59 0.00 0.00
2 08DEC03:12:00:00 22DEC03:11:59:59 0.00 0.00
3 19JAN04:10:00:00 26JAN04:09:59:59 25.75 0.00
4 16DEC03:08:00:00 22DEC03:11:59:59 5.50 5.50
5 22DEC03:12:00:00 12JAN04:09:59:59 0.00 0.00
6 26JAN04:10:00:00 09FEB04:09:59:59 25.75 25.75
7 12JAN04:10:00:00 26JAN04:09:59:59 0.00 0.00
8 12JAN04:10:00:00 26JAN04:09:59:59 0.00 0.00
9 26JAN04:10:00:00 09FEB04:09:59:59 0.00 0.00
10 16FEB04:10:00:00 01MAR04:09:59:59 5.00 5.00
11 09FEB04:10:00:00 01MAR04:09:59:59 0.00 0.00
12 01MAR04:10:00:00 08MAR04:09:59:59 0.00 0.00
13 08MAR04:10:00:00 08MAR04:10:00:00 0.00 0.00
14 08MAR04:10:00:00 08MAR04:10:00:00 20.00 20.00
Now suppose that the engineer in charge of writing specications requests a seven-
day vacation from December 8, 2003. How is the project completion time going to be
affected? A new calendar, Eng
, . . . ,
sat
9 lag
between Prototype and Facility. The fs
0 to ss
START and B
START, A
FINISH, A
DUR, and
STATUS; this data set is displayed in Output 2.13.3. Note that the activity Mkt.
Strat., which has rdur=3 in Output 2.13.2, has an early nish time (December 21,
2003) that is three days after TIMENOW. The S
VAR and F
START and S
DELAY,
DELAY
R, and SUPPL
R vari-
ables indicate that there is a delay of ve days in the activity Drawings due to the
resource engineer. Such information helps to pinpoint the source of resource insuf-
ciency, if any.
Note that other activities that follow Drawings also have S
START>E
START,
but the slippage in these activities is not caused by resource insufciency, it is due to
their predecessors being delayed. Note that the entire project is delayed by ve work-
ing days due to resource constraints (the maximumvalue of S
FINISHis 17MAR04,
while the maximum value of E
FINISH is 10MAR04).
Note also that in this invocation, the DELAY= option is not specied; therefore, the
supplementary level of resource is not used, since the primary levels of resources are
found to be sufcient to schedule the project by delaying some of the activities.
The data set WIDGROUT, displayed in Output 2.15.3, contains variables Rengineer
and Aengineer in addition to the variables Eengineer and Lengineer. The vari-
able Rengineer denotes the usage of the resource engineer corresponding to the
resource-constrained schedule, and Aengineer denotes the remaining level of the re-
source after resource allocation. For the consumable resource engcost, the variables
Eengcost, Lengcost, and Rengcost indicate the rate of usage per unit routinterval
(which defaults to INTERVAL=WEEKDAY, in this case) at the start of the time in-
terval specied in the variable
TIME
variable.
214
Chapter 2. The CPM Procedure
Output 2.15.3. Resource Usage: Rule = SHORTDUR
Resource Allocation
Usage Profiles for Constrained Schedule: Rule = SHORTDUR
E L R A
e e e e E L R A
n n n n e e e e
_ g g g g n n n n
T i i i i g g g g
I n n n n c c c c
O M e e e e o o o o
b E e e e e s s s s
s _ r r r r t t t t
1 01DEC03 2 2 2 1 400 400 400 40000
2 02DEC03 2 2 2 1 400 400 400 39600
3 03DEC03 2 2 2 1 400 400 400 39200
4 04DEC03 2 2 2 1 400 400 400 38800
5 05DEC03 2 2 2 1 400 400 400 38400
6 08DEC03 4 1 3 0 800 200 600 38000
7 09DEC03 4 1 3 0 800 200 600 37400
8 10DEC03 4 1 3 0 800 200 600 36800
9 11DEC03 4 1 3 0 800 200 600 36200
10 12DEC03 4 1 3 0 800 200 600 35600
11 15DEC03 1 3 1 2 200 600 200 35000
12 16DEC03 1 3 1 2 200 600 200 34800
13 17DEC03 1 3 1 2 200 600 200 34600
14 18DEC03 1 3 1 2 200 600 200 34400
15 19DEC03 1 3 1 2 200 600 200 34200
16 22DEC03 4 4 1 2 800 800 200 34000
17 23DEC03 4 4 1 2 800 800 200 33800
18 24DEC03 4 4 1 2 800 800 200 33600
19 26DEC03 4 4 1 3 800 800 200 33400
20 29DEC03 4 4 1 3 800 800 200 33200
21 30DEC03 4 4 4 0 800 800 800 33000
22 31DEC03 4 4 4 0 800 800 800 32200
23 02JAN04 4 4 4 0 800 800 800 31400
24 05JAN04 4 4 4 0 800 800 800 30600
25 06JAN04 4 4 4 0 800 800 800 29800
26 07JAN04 4 4 4 0 800 800 800 29000
27 08JAN04 4 4 4 0 800 800 800 28200
28 09JAN04 4 4 4 0 800 800 800 27400
29 12JAN04 4 4 4 0 800 800 800 26600
30 13JAN04 4 4 4 0 800 800 800 25800
31 14JAN04 2 2 4 0 400 400 800 25000
32 15JAN04 2 2 4 0 400 400 800 24200
33 16JAN04 2 2 4 0 400 400 800 23400
34 19JAN04 2 2 4 0 400 400 800 22600
35 20JAN04 2 2 4 0 400 400 800 21800
36 21JAN04 2 3 2 2 400 600 400 21000
37 22JAN04 2 3 2 2 400 600 400 20600
38 23JAN04 2 3 2 2 400 600 400 20200
39 26JAN04 2 3 2 2 400 600 400 19800
40 27JAN04 2 3 2 2 400 600 400 19400
41 28JAN04 4 4 2 2 800 800 400 19000
42 29JAN04 4 4 2 2 800 800 400 18600
43 30JAN04 4 4 2 2 800 800 400 18200
44 02FEB04 4 4 2 2 800 800 400 17800
45 03FEB04 4 4 2 2 800 800 400 17400
46 04FEB04 4 4 4 0 800 800 800 17000
47 05FEB04 4 4 4 0 800 800 800 16200
Example 2.15. Resource Allocation
215
Resource Allocation
Usage Profiles for Constrained Schedule: Rule = SHORTDUR
E L R A
e e e e E L R A
n n n n e e e e
_ g g g g n n n n
T i i i i g g g g
I n n n n c c c c
O M e e e e o o o o
b E e e e e s s s s
s _ r r r r t t t t
48 06FEB04 4 4 4 0 800 800 800 15400
49 09FEB04 4 4 4 0 800 800 800 14600
50 10FEB04 4 4 4 0 800 800 800 13800
51 11FEB04 1 0 4 0 200 0 800 13000
52 12FEB04 1 0 4 0 200 0 800 12200
53 13FEB04 1 0 4 0 200 0 800 11400
54 16FEB04 1 0 4 0 200 0 800 10600
55 17FEB04 1 0 4 0 200 0 800 9800
56 18FEB04 1 1 1 3 200 200 200 9000
57 19FEB04 1 1 1 3 200 200 200 8800
58 20FEB04 1 1 1 3 200 200 200 8600
59 23FEB04 1 1 1 3 200 200 200 8400
60 24FEB04 1 1 1 3 200 200 200 8200
61 25FEB04 0 1 1 3 0 200 200 8000
62 26FEB04 0 1 1 3 0 200 200 7800
63 27FEB04 0 1 1 3 0 200 200 7600
64 01MAR04 0 1 1 3 0 200 200 7400
65 02MAR04 0 1 1 3 0 200 200 7200
66 03MAR04 2 2 0 4 400 400 0 7000
67 04MAR04 2 2 0 4 400 400 0 7000
68 05MAR04 2 2 0 4 400 400 0 7000
69 08MAR04 2 2 0 4 400 400 0 7000
70 09MAR04 2 2 0 4 400 400 0 7000
71 10MAR04 0 0 2 2 0 0 400 7000
72 11MAR04 0 0 2 2 0 0 400 6600
73 12MAR04 0 0 2 2 0 0 400 6200
74 15MAR04 0 0 2 2 0 0 400 5800
75 16MAR04 0 0 2 2 0 0 400 5400
76 17MAR04 0 0 0 4 0 0 0 5000
The second invocation of PROC CPM uses a different scheduling rule (LST, which
is the default scheduling rule). Ties are broken using the L
R and R
START=21JAN04).
216
Chapter 2. The CPM Procedure
proc cpm date=01dec03d
interval=weekday
data=widgres
resin=widgrin
holidata=holdata
out=widgsch2
resout=widgrou2;
tailnode tail;
duration days;
headnode head;
holiday hol;
resource engineer engcost / period=per
obstype=otype
schedrule=lst
delayanalysis;
id task;
run;
Output 2.15.4. Resource Constrained Schedule: Rule = LST
Resource Allocation
Resource Constrained Schedule: Rule = LST
Obs tail head days task engineer engcost S_START S_FINISH
1 1 2 5 Approve Plan 2 400 01DEC03 05DEC03
2 2 3 10 Drawings 1 200 08DEC03 19DEC03
3 2 4 5 Anal. Market 1 200 15DEC03 19DEC03
4 2 3 5 Write Specs 2 400 08DEC03 12DEC03
5 3 5 15 Prototype 4 800 26DEC03 16JAN04
6 4 6 10 Mkt. Strat. . . 22DEC03 06JAN04
7 5 7 10 Materials . . 19JAN04 30JAN04
8 5 7 10 Facility 2 400 19JAN04 30JAN04
9 7 8 10 Init. Prod. 4 800 02FEB04 13FEB04
10 8 9 10 Evaluate 1 200 16FEB04 27FEB04
11 6 9 15 Test Market . . 16FEB04 05MAR04
12 9 10 5 Changes 2 400 08MAR04 12MAR04
13 10 11 0 Production 4 800 15MAR04 15MAR04
14 6 12 0 Marketing . . 16FEB04 16FEB04
15 8 6 0 Dummy . . 16FEB04 16FEB04
Obs E_START E_FINISH L_START L_FINISH R_DELAY DELAY_R SUPPL_R
1 01DEC03 05DEC03 01DEC03 05DEC03 0
2 08DEC03 19DEC03 08DEC03 19DEC03 0
3 08DEC03 12DEC03 21JAN04 27JAN04 5 engineer
4 08DEC03 12DEC03 15DEC03 19DEC03 0
5 22DEC03 13JAN04 22DEC03 13JAN04 3 engineer
6 15DEC03 29DEC03 28JAN04 10FEB04 0
7 14JAN04 27JAN04 14JAN04 27JAN04 0
8 14JAN04 27JAN04 14JAN04 27JAN04 0
9 28JAN04 10FEB04 28JAN04 10FEB04 0
10 11FEB04 24FEB04 18FEB04 02MAR04 0
11 11FEB04 02MAR04 11FEB04 02MAR04 0
12 03MAR04 09MAR04 03MAR04 09MAR04 0
13 10MAR04 10MAR04 10MAR04 10MAR04 0
14 11FEB04 11FEB04 10MAR04 10MAR04 0
15 11FEB04 11FEB04 11FEB04 11FEB04 0
Example 2.15. Resource Allocation
217
Output 2.15.5. Resource Usage: Rule = LST
Resource Allocation
Usage Profiles for Constrained Schedule: Rule = LST
E L R A
e e e e E L R A
n n n n e e e e
_ g g g g n n n n
T i i i i g g g g
I n n n n c c c c
O M e e e e o o o o
b E e e e e s s s s
s _ r r r r t t t t
1 01DEC03 2 2 2 1 400 400 400 40000
2 02DEC03 2 2 2 1 400 400 400 39600
3 03DEC03 2 2 2 1 400 400 400 39200
4 04DEC03 2 2 2 1 400 400 400 38800
5 05DEC03 2 2 2 1 400 400 400 38400
6 08DEC03 4 1 3 0 800 200 600 38000
7 09DEC03 4 1 3 0 800 200 600 37400
8 10DEC03 4 1 3 0 800 200 600 36800
9 11DEC03 4 1 3 0 800 200 600 36200
10 12DEC03 4 1 3 0 800 200 600 35600
11 15DEC03 1 3 2 1 200 600 400 35000
12 16DEC03 1 3 2 1 200 600 400 34600
13 17DEC03 1 3 2 1 200 600 400 34200
14 18DEC03 1 3 2 1 200 600 400 33800
15 19DEC03 1 3 2 1 200 600 400 33400
16 22DEC03 4 4 0 3 800 800 0 33000
17 23DEC03 4 4 0 3 800 800 0 33000
18 24DEC03 4 4 0 3 800 800 0 33000
19 26DEC03 4 4 4 0 800 800 800 33000
20 29DEC03 4 4 4 0 800 800 800 32200
21 30DEC03 4 4 4 0 800 800 800 31400
22 31DEC03 4 4 4 0 800 800 800 30600
23 02JAN04 4 4 4 0 800 800 800 29800
24 05JAN04 4 4 4 0 800 800 800 29000
25 06JAN04 4 4 4 0 800 800 800 28200
26 07JAN04 4 4 4 0 800 800 800 27400
27 08JAN04 4 4 4 0 800 800 800 26600
28 09JAN04 4 4 4 0 800 800 800 25800
29 12JAN04 4 4 4 0 800 800 800 25000
30 13JAN04 4 4 4 0 800 800 800 24200
31 14JAN04 2 2 4 0 400 400 800 23400
32 15JAN04 2 2 4 0 400 400 800 22600
33 16JAN04 2 2 4 0 400 400 800 21800
34 19JAN04 2 2 2 2 400 400 400 21000
35 20JAN04 2 2 2 2 400 400 400 20600
36 21JAN04 2 3 2 2 400 600 400 20200
37 22JAN04 2 3 2 2 400 600 400 19800
38 23JAN04 2 3 2 2 400 600 400 19400
39 26JAN04 2 3 2 2 400 600 400 19000
40 27JAN04 2 3 2 2 400 600 400 18600
41 28JAN04 4 4 2 2 800 800 400 18200
42 29JAN04 4 4 2 2 800 800 400 17800
43 30JAN04 4 4 2 2 800 800 400 17400
44 02FEB04 4 4 4 0 800 800 800 17000
45 03FEB04 4 4 4 0 800 800 800 16200
46 04FEB04 4 4 4 0 800 800 800 15400
47 05FEB04 4 4 4 0 800 800 800 14600
218
Chapter 2. The CPM Procedure
Resource Allocation
Usage Profiles for Constrained Schedule: Rule = LST
E L R A
e e e e E L R A
n n n n e e e e
_ g g g g n n n n
T i i i i g g g g
I n n n n c c c c
O M e e e e o o o o
b E e e e e s s s s
s _ r r r r t t t t
48 06FEB04 4 4 4 0 800 800 800 13800
49 09FEB04 4 4 4 0 800 800 800 13000
50 10FEB04 4 4 4 0 800 800 800 12200
51 11FEB04 1 0 4 0 200 0 800 11400
52 12FEB04 1 0 4 0 200 0 800 10600
53 13FEB04 1 0 4 0 200 0 800 9800
54 16FEB04 1 0 1 3 200 0 200 9000
55 17FEB04 1 0 1 3 200 0 200 8800
56 18FEB04 1 1 1 3 200 200 200 8600
57 19FEB04 1 1 1 3 200 200 200 8400
58 20FEB04 1 1 1 3 200 200 200 8200
59 23FEB04 1 1 1 3 200 200 200 8000
60 24FEB04 1 1 1 3 200 200 200 7800
61 25FEB04 0 1 1 3 0 200 200 7600
62 26FEB04 0 1 1 3 0 200 200 7400
63 27FEB04 0 1 1 3 0 200 200 7200
64 01MAR04 0 1 0 4 0 200 0 7000
65 02MAR04 0 1 0 4 0 200 0 7000
66 03MAR04 2 2 0 4 400 400 0 7000
67 04MAR04 2 2 0 4 400 400 0 7000
68 05MAR04 2 2 0 4 400 400 0 7000
69 08MAR04 2 2 2 2 400 400 400 7000
70 09MAR04 2 2 2 2 400 400 400 6600
71 10MAR04 0 0 2 2 0 0 400 6200
72 11MAR04 0 0 2 2 0 0 400 5800
73 12MAR04 0 0 2 2 0 0 400 5400
74 15MAR04 0 0 0 4 0 0 0 5000
Example 2.16. Using Supplementary Resources
In this example, the same project as in Example 2.15 is scheduled with a specication
of DELAY=0. This indicates to PROC CPM that a supplementary level of resources
is to be used if an activity cannot be scheduled to start on or before its latest start
time (as computed in the unconstrained case). The schedule data and resource usage
data are saved in the data sets WIDGO16 and WIDGRO16, respectively. They are
displayed in Output 2.16.1 and Output 2.16.2, respectively.
Example 2.16. Using Supplementary Resources
219
title Using Supplementary Resources;
proc cpm date=01dec03d interval=weekday
data=widgres holidata=holdata resin=widgrin
out=widgo16 resout=widgro16;
tailnode tail;
duration days;
headnode head;
holiday hol;
resource engineer engcost / period=per obstype=otype
cumusage
delay=0
delayanalysis
routnobreak;
id task;
run;
To analyze the results of the resource constrained scheduling, you must examine both
output data sets, WIDGRO16 and WIDGO16. The negative values for Aengineer
in observation numbers 22 through 25 of the Usage data set WIDGRO16 indicate
the amount of supplementary resource that is needed on December 22, 23, 24, and
25, to complete the project without delaying any activity beyond its latest start time.
Examination of the SUPPL
START = 15DEC03) and scheduled later than its early start time
(E
START time is
equal to 21JAN04 and DELAY = 0.
Further, note the use of the option CUMUSAGE in the RESOURCE statement, re-
questing that cumulative resource usage be saved in the Usage data set for consum-
able resources. Thus, for the consumable resource engcost, the procedure saves the
cumulative resource usage in the variables Eengcost, Lengcost, and Rengcost, re-
spectively. For instance, Eengcost in a given observation species the cumulative
value of engcost for the early start schedule through the end of the previous day.
220
Chapter 2. The CPM Procedure
Output 2.16.1. Resource-Constrained Schedule: Supplementary Resource
Using Supplementary Resources
Resource Constrained Schedule
Obs tail head days task engineer engcost S_START S_FINISH
1 1 2 5 Approve Plan 2 400 01DEC03 05DEC03
2 2 3 10 Drawings 1 200 08DEC03 19DEC03
3 2 4 5 Anal. Market 1 200 15DEC03 19DEC03
4 2 3 5 Write Specs 2 400 08DEC03 12DEC03
5 3 5 15 Prototype 4 800 22DEC03 13JAN04
6 4 6 10 Mkt. Strat. . . 22DEC03 06JAN04
7 5 7 10 Materials . . 14JAN04 27JAN04
8 5 7 10 Facility 2 400 14JAN04 27JAN04
9 7 8 10 Init. Prod. 4 800 28JAN04 10FEB04
10 8 9 10 Evaluate 1 200 11FEB04 24FEB04
11 6 9 15 Test Market . . 11FEB04 02MAR04
12 9 10 5 Changes 2 400 03MAR04 09MAR04
13 10 11 0 Production 4 800 10MAR04 10MAR04
14 6 12 0 Marketing . . 11FEB04 11FEB04
15 8 6 0 Dummy . . 11FEB04 11FEB04
Obs E_START E_FINISH L_START L_FINISH R_DELAY DELAY_R SUPPL_R
1 01DEC03 05DEC03 01DEC03 05DEC03 0
2 08DEC03 19DEC03 08DEC03 19DEC03 0
3 08DEC03 12DEC03 21JAN04 27JAN04 5 engineer
4 08DEC03 12DEC03 15DEC03 19DEC03 0
5 22DEC03 13JAN04 22DEC03 13JAN04 0 engineer
6 15DEC03 29DEC03 28JAN04 10FEB04 0
7 14JAN04 27JAN04 14JAN04 27JAN04 0
8 14JAN04 27JAN04 14JAN04 27JAN04 0
9 28JAN04 10FEB04 28JAN04 10FEB04 0
10 11FEB04 24FEB04 18FEB04 02MAR04 0
11 11FEB04 02MAR04 11FEB04 02MAR04 0
12 03MAR04 09MAR04 03MAR04 09MAR04 0
13 10MAR04 10MAR04 10MAR04 10MAR04 0
14 11FEB04 11FEB04 10MAR04 10MAR04 0
15 11FEB04 11FEB04 11FEB04 11FEB04 0
This example also illustrates the use of the ROUTNOBREAK option to produce a
resource usage output data set that does not have any breaks for holidays. Thus, the
output data set WIDGRO16 has observations corresponding to holidays and week-
ends, unlike the corresponding resource output data sets in Example 2.15. Note that
for consumable resources with cumulative usage there is no accumulation of the re-
source on holidays; thus, the cumulative value of engcost at the beginning of the 7th
and 8th of December equals the value for the beginning of the 6th of December. For
the resource engineer, however, the resource is assumed to be tied to the activity in
progress even across holidays or weekends that are spanned by the activitys dura-
tion. For example, both activities Drawings and Write Specs start on December
8, 2003, requiring one and two engineers, respectively. The Write Specs activity
nishes on the 12th, freeing up two engineers, whereas Drawings nishes only on
the 19th of December. Thus, the data set WIDGRO16 has Rengineer equal to 3
from 8DEC03 to 12DEC03 and then equal to 1 on the 13th and 14th of December.
Another engineer is required by the activity Anal. Market from December 15,
2003; thus, the total usage from 15DEC03 to 19DEC03 is 2.
Example 2.16. Using Supplementary Resources
221
Output 2.16.2. Resource Usage: Supplementary Resources
Using Supplementary Resources
Usage Profiles for Constrained Schedule
E L R A
e e e e E L R A
n n n n e e e e
_ g g g g n n n n
T i i i i g g g g
I n n n n c c c c
O M e e e e o o o o
b E e e e e s s s s
s _ r r r r t t t t
1 01DEC03 2 2 2 1 0 0 0 40000
2 02DEC03 2 2 2 1 400 400 400 39600
3 03DEC03 2 2 2 1 800 800 800 39200
4 04DEC03 2 2 2 1 1200 1200 1200 38800
5 05DEC03 2 2 2 1 1600 1600 1600 38400
6 06DEC03 0 0 0 3 2000 2000 2000 38000
7 07DEC03 0 0 0 3 2000 2000 2000 38000
8 08DEC03 4 1 3 0 2000 2000 2000 38000
9 09DEC03 4 1 3 0 2800 2200 2600 37400
10 10DEC03 4 1 3 0 3600 2400 3200 36800
11 11DEC03 4 1 3 0 4400 2600 3800 36200
12 12DEC03 4 1 3 0 5200 2800 4400 35600
13 13DEC03 1 1 1 2 6000 3000 5000 35000
14 14DEC03 1 1 1 2 6000 3000 5000 35000
15 15DEC03 1 3 2 1 6000 3000 5000 35000
16 16DEC03 1 3 2 1 6200 3600 5400 34600
17 17DEC03 1 3 2 1 6400 4200 5800 34200
18 18DEC03 1 3 2 1 6600 4800 6200 33800
19 19DEC03 1 3 2 1 6800 5400 6600 33400
20 20DEC03 0 0 0 3 7000 6000 7000 33000
21 21DEC03 0 0 0 3 7000 6000 7000 33000
22 22DEC03 4 4 4 -1 7000 6000 7000 33000
23 23DEC03 4 4 4 -1 7800 6800 7800 32200
24 24DEC03 4 4 4 -1 8600 7600 8600 31400
25 25DEC03 4 4 4 -1 9400 8400 9400 30600
26 26DEC03 4 4 4 0 9400 8400 9400 30600
27 27DEC03 4 4 4 0 10200 9200 10200 29800
28 28DEC03 4 4 4 0 10200 9200 10200 29800
29 29DEC03 4 4 4 0 10200 9200 10200 29800
30 30DEC03 4 4 4 0 11000 10000 11000 29000
31 31DEC03 4 4 4 0 11800 10800 11800 28200
32 01JAN04 4 4 4 0 12600 11600 12600 27400
33 02JAN04 4 4 4 0 12600 11600 12600 27400
34 03JAN04 4 4 4 0 13400 12400 13400 26600
35 04JAN04 4 4 4 0 13400 12400 13400 26600
36 05JAN04 4 4 4 0 13400 12400 13400 26600
37 06JAN04 4 4 4 0 14200 13200 14200 25800
38 07JAN04 4 4 4 0 15000 14000 15000 25000
39 08JAN04 4 4 4 0 15800 14800 15800 24200
40 09JAN04 4 4 4 0 16600 15600 16600 23400
41 10JAN04 4 4 4 0 17400 16400 17400 22600
42 11JAN04 4 4 4 0 17400 16400 17400 22600
43 12JAN04 4 4 4 0 17400 16400 17400 22600
44 13JAN04 4 4 4 0 18200 17200 18200 21800
45 14JAN04 2 2 2 2 19000 18000 19000 21000
46 15JAN04 2 2 2 2 19400 18400 19400 20600
47 16JAN04 2 2 2 2 19800 18800 19800 20200
222
Chapter 2. The CPM Procedure
Using Supplementary Resources
Usage Profiles for Constrained Schedule
E L R A
e e e e E L R A
n n n n e e e e
_ g g g g n n n n
T i i i i g g g g
I n n n n c c c c
O M e e e e o o o o
b E e e e e s s s s
s _ r r r r t t t t
48 17JAN04 2 2 2 2 20200 19200 20200 19800
49 18JAN04 2 2 2 2 20200 19200 20200 19800
50 19JAN04 2 2 2 2 20200 19200 20200 19800
51 20JAN04 2 2 2 2 20600 19600 20600 19400
52 21JAN04 2 3 2 2 21000 20000 21000 19000
53 22JAN04 2 3 2 2 21400 20600 21400 18600
54 23JAN04 2 3 2 2 21800 21200 21800 18200
55 24JAN04 2 3 2 2 22200 21800 22200 17800
56 25JAN04 2 3 2 2 22200 21800 22200 17800
57 26JAN04 2 3 2 2 22200 21800 22200 17800
58 27JAN04 2 3 2 2 22600 22400 22600 17400
59 28JAN04 4 4 4 0 23000 23000 23000 17000
60 29JAN04 4 4 4 0 23800 23800 23800 16200
61 30JAN04 4 4 4 0 24600 24600 24600 15400
62 31JAN04 4 4 4 0 25400 25400 25400 14600
63 01FEB04 4 4 4 0 25400 25400 25400 14600
64 02FEB04 4 4 4 0 25400 25400 25400 14600
65 03FEB04 4 4 4 0 26200 26200 26200 13800
66 04FEB04 4 4 4 0 27000 27000 27000 13000
67 05FEB04 4 4 4 0 27800 27800 27800 12200
68 06FEB04 4 4 4 0 28600 28600 28600 11400
69 07FEB04 4 4 4 0 29400 29400 29400 10600
70 08FEB04 4 4 4 0 29400 29400 29400 10600
71 09FEB04 4 4 4 0 29400 29400 29400 10600
72 10FEB04 4 4 4 0 30200 30200 30200 9800
73 11FEB04 1 0 1 3 31000 31000 31000 9000
74 12FEB04 1 0 1 3 31200 31000 31200 8800
75 13FEB04 1 0 1 3 31400 31000 31400 8600
76 14FEB04 1 0 1 3 31600 31000 31600 8400
77 15FEB04 1 0 1 3 31600 31000 31600 8400
78 16FEB04 1 0 1 3 31600 31000 31600 8400
79 17FEB04 1 0 1 3 31800 31000 31800 8200
80 18FEB04 1 1 1 3 32000 31000 32000 8000
81 19FEB04 1 1 1 3 32200 31200 32200 7800
82 20FEB04 1 1 1 3 32400 31400 32400 7600
83 21FEB04 1 1 1 3 32600 31600 32600 7400
84 22FEB04 1 1 1 3 32600 31600 32600 7400
85 23FEB04 1 1 1 3 32600 31600 32600 7400
86 24FEB04 1 1 1 3 32800 31800 32800 7200
87 25FEB04 0 1 0 4 33000 32000 33000 7000
88 26FEB04 0 1 0 4 33000 32200 33000 7000
89 27FEB04 0 1 0 4 33000 32400 33000 7000
90 28FEB04 0 1 0 4 33000 32600 33000 7000
91 29FEB04 0 1 0 4 33000 32600 33000 7000
92 01MAR04 0 1 0 4 33000 32600 33000 7000
93 02MAR04 0 1 0 4 33000 32800 33000 7000
94 03MAR04 2 2 2 2 33000 33000 33000 7000
Example 2.17. INFEASDIAGNOSTIC Option and Aggregate Resource Type
223
Using Supplementary Resources
Usage Profiles for Constrained Schedule
E L R A
e e e e E L R A
n n n n e e e e
_ g g g g n n n n
T i i i i g g g g
I n n n n c c c c
O M e e e e o o o o
b E e e e e s s s s
s _ r r r r t t t t
95 04MAR04 2 2 2 2 33400 33400 33400 6600
96 05MAR04 2 2 2 2 33800 33800 33800 6200
97 06MAR04 2 2 2 2 34200 34200 34200 5800
98 07MAR04 2 2 2 2 34200 34200 34200 5800
99 08MAR04 2 2 2 2 34200 34200 34200 5800
100 09MAR04 2 2 2 2 34600 34600 34600 5400
101 10MAR04 0 0 0 4 35000 35000 35000 5000
Example 2.17. INFEASDIAGNOSTIC Option and Aggregate
Resource Type
The INFEASDIAGNOSTIC option instructs PROC CPM to continue scheduling
even when resources are insufcient. When PROC CPM schedules subject to re-
source constraints, it stops the scheduling process when it cannot nd sufcient re-
sources (primary or supplementary) for an activity before the activitys latest possible
start time (L
START + DELAY). In this case, you may want to determine which re-
sources are needed to schedule all the activities and when the deciencies occur. The
INFEASDIAGNOSTIC option is equivalent to specifying innite supplementary lev-
els for all the resources under consideration; the DELAY= value is assumed to equal
the default value of +INFINITY, unless it is specied otherwise.
The INFEASDIAGNOSTIC option is particularly useful when there are several re-
sources involved and when project completion time is critical. You want things to be
done on time, even if it means using supplementary resources or overtime resources;
rather than trying to juggle activities around to try to t available resource proles,
you want to determine the level of resources needed to accomplish tasks within a
given time frame.
For the WIDGET manufacturing project, let us assume that there are four resources:
a design engineer, a market analyst, a production engineer, and money. The resource
requirements for the different activities are saved in a data set, WIDGR17, and dis-
played in Output 2.17.1. Of these resources, suppose that the design engineer is the
resource that is most crucial in terms of his availability; perhaps he is an outside con-
tractor and you do not have control over his availability. You need to determine the
project schedule subject to the constraints on the resource deseng. Output 2.17.2
displays the RESOURCEIN= data set, RESIN17.
224
Chapter 2. The CPM Procedure
Output 2.17.1. Data Set WIDGR17
Use of the INFEASDIAGNOSTIC Option
Data Set WIDGR17
Obs task days tail head deseng mktan prodeng money
1 Approve Plan 5 1 2 1 1 1 200
2 Drawings 10 2 3 1 . 1 100
3 Anal. Market 5 2 4 . 1 1 100
4 Write Specs 5 2 3 1 . 1 150
5 Prototype 15 3 5 1 . 1 300
6 Mkt. Strat. 10 4 6 . 1 . 150
7 Materials 10 5 7 . . . 300
8 Facility 10 5 7 . . 1 500
9 Init. Prod. 10 7 8 . . . 250
10 Evaluate 10 8 9 1 . . 150
11 Test Market 15 6 9 . 1 . 200
12 Changes 5 9 10 1 . 1 200
13 Production 0 10 11 1 . 1 600
14 Marketing 0 6 12 . 1 . .
15 Dummy 0 8 6 . . . .
Output 2.17.2. Resourcein Data Set RESIN17
Use of the INFEASDIAGNOSTIC Option
Data Set RESIN17
Obs per otype deseng mktan prodeng money
1 . restype 1 1 1 4
2 01DEC03 reslevel 1 . 1 .
In the rst invocation of PROC CPM, the project is scheduled subject to resource
constraints on the single resource variable deseng. Output 2.17.3 displays the re-
sulting Schedule data set WIDGO17S, which shows that the project is delayed by
ve days because of this resource. Note that the project nish time has been delayed
only by ve days, even though R
R
variable indicates the rst resource in the resource list that was used beyond its pri-
mary level. Note also that it is possible to schedule the activities with only one pro-
duction engineer, but the project would be delayed by more than ve days.
The Usage data set, displayed in Output 2.17.5, shows the amount of resources re-
quired on each day of the project. The data set contains usage and remaining re-
source information only for the resource-constrained schedule because PROC CPM
was invoked with the RCPROFILE and AVPROFILE options in the RESOURCE
statement. Note that the availability prole contains only missing values for the re-
source money because it was used only for aggregation purposes. Further, since this
resource is a consumable resource as per the RESOURCEIN= data set, and since the
CUMUSAGE option is specied, the value for Rmoney in each observation indicates
the cumulative amount of money that would be needed through the beginning of the
date specied in that observation if the resource constrained schedule were followed.
For the other resources, the availability prole in the Usage data set contains negative
values for all the resources that were insufcient on any given day. This feature is
useful for diagnosing the level of insufciency of any resource; you can determine the
problem areas by examining the availability prole for the different resources. Thus,
the negative values for the resource availability prole Aprodeng indicate that, in
order for the project to be scheduled as desired, you need an extra production engineer
between the 21st and 27th of January, 2004. The negative values for Amktan indicate
the days when a market analyst is needed for the project.
Example 2.17. INFEASDIAGNOSTIC Option and Aggregate Resource Type
227
Output 2.17.4. Resource-Constrained Schedule: Multiple Resources
Use of the INFEASDIAGNOSTIC Option
Resource Constrained Schedule: Multiple Resources
Obs tail head days task deseng prodeng mktan money S_START S_FINISH
1 1 2 5 Approve Plan 1 1 1 200 01DEC03 05DEC03
2 2 3 10 Drawings 1 1 . 100 08DEC03 19DEC03
3 2 4 5 Anal. Market . 1 1 100 21JAN04 27JAN04
4 2 3 5 Write Specs 1 1 . 150 22DEC03 29DEC03
5 3 5 15 Prototype 1 1 . 300 30DEC03 20JAN04
6 4 6 10 Mkt. Strat. . . 1 150 28JAN04 10FEB04
7 5 7 10 Materials . . . 300 21JAN04 03FEB04
8 5 7 10 Facility . 1 . 500 21JAN04 03FEB04
9 7 8 10 Init. Prod. . . . 250 04FEB04 17FEB04
10 8 9 10 Evaluate 1 . . 150 18FEB04 02MAR04
11 6 9 15 Test Market . . 1 200 18FEB04 09MAR04
12 9 10 5 Changes 1 1 . 200 10MAR04 16MAR04
13 10 11 0 Production 1 1 . 600 17MAR04 17MAR04
14 6 12 0 Marketing . . 1 . 18FEB04 18FEB04
15 8 6 0 Dummy . . . . 18FEB04 18FEB04
Obs E_START E_FINISH L_START L_FINISH R_DELAY DELAY_R SUPPL_R
1 01DEC03 05DEC03 01DEC03 05DEC03 0 mktan
2 08DEC03 19DEC03 08DEC03 19DEC03 0
3 08DEC03 12DEC03 21JAN04 27JAN04 30 prodeng prodeng
4 08DEC03 12DEC03 15DEC03 19DEC03 10 deseng
5 22DEC03 13JAN04 22DEC03 13JAN04 0
6 15DEC03 29DEC03 28JAN04 10FEB04 0 mktan
7 14JAN04 27JAN04 14JAN04 27JAN04 0
8 14JAN04 27JAN04 14JAN04 27JAN04 0
9 28JAN04 10FEB04 28JAN04 10FEB04 0
10 11FEB04 24FEB04 18FEB04 02MAR04 0
11 11FEB04 02MAR04 11FEB04 02MAR04 0 mktan
12 03MAR04 09MAR04 03MAR04 09MAR04 0
13 10MAR04 10MAR04 10MAR04 10MAR04 0
14 11FEB04 11FEB04 10MAR04 10MAR04 0
15 11FEB04 11FEB04 11FEB04 11FEB04 0
228
Chapter 2. The CPM Procedure
Output 2.17.5. Resource Usage: Multiple Resources
Use of the INFEASDIAGNOSTIC Option
Usage Profile: Multiple Resources
Obs _TIME_ Rdeseng Adeseng Rprodeng Aprodeng Rmktan Amktan Rmoney Amoney
1 01DEC03 1 0 1 0 1 -1 0 .
2 02DEC03 1 0 1 0 1 -1 200 .
3 03DEC03 1 0 1 0 1 -1 400 .
4 04DEC03 1 0 1 0 1 -1 600 .
5 05DEC03 1 0 1 0 1 -1 800 .
6 08DEC03 1 0 1 0 0 0 1000 .
7 09DEC03 1 0 1 0 0 0 1100 .
8 10DEC03 1 0 1 0 0 0 1200 .
9 11DEC03 1 0 1 0 0 0 1300 .
10 12DEC03 1 0 1 0 0 0 1400 .
11 15DEC03 1 0 1 0 0 0 1500 .
12 16DEC03 1 0 1 0 0 0 1600 .
13 17DEC03 1 0 1 0 0 0 1700 .
14 18DEC03 1 0 1 0 0 0 1800 .
15 19DEC03 1 0 1 0 0 0 1900 .
16 22DEC03 1 0 1 0 0 0 2000 .
17 23DEC03 1 0 1 0 0 0 2150 .
18 24DEC03 1 0 1 0 0 0 2300 .
19 26DEC03 1 0 1 0 0 0 2450 .
20 29DEC03 1 0 1 0 0 0 2600 .
21 30DEC03 1 0 1 0 0 0 2750 .
22 31DEC03 1 0 1 0 0 0 3050 .
23 02JAN04 1 0 1 0 0 0 3350 .
24 05JAN04 1 0 1 0 0 0 3650 .
25 06JAN04 1 0 1 0 0 0 3950 .
26 07JAN04 1 0 1 0 0 0 4250 .
27 08JAN04 1 0 1 0 0 0 4550 .
28 09JAN04 1 0 1 0 0 0 4850 .
29 12JAN04 1 0 1 0 0 0 5150 .
30 13JAN04 1 0 1 0 0 0 5450 .
31 14JAN04 1 0 1 0 0 0 5750 .
32 15JAN04 1 0 1 0 0 0 6050 .
33 16JAN04 1 0 1 0 0 0 6350 .
34 19JAN04 1 0 1 0 0 0 6650 .
35 20JAN04 1 0 1 0 0 0 6950 .
36 21JAN04 0 1 2 -1 1 -1 7250 .
37 22JAN04 0 1 2 -1 1 -1 8150 .
38 23JAN04 0 1 2 -1 1 -1 9050 .
39 26JAN04 0 1 2 -1 1 -1 9950 .
40 27JAN04 0 1 2 -1 1 -1 10850 .
41 28JAN04 0 1 1 0 1 -1 11750 .
42 29JAN04 0 1 1 0 1 -1 12700 .
43 30JAN04 0 1 1 0 1 -1 13650 .
44 02FEB04 0 1 1 0 1 -1 14600 .
45 03FEB04 0 1 1 0 1 -1 15550 .
46 04FEB04 0 1 0 1 1 -1 16500 .
47 05FEB04 0 1 0 1 1 -1 16900 .
48 06FEB04 0 1 0 1 1 -1 17300 .
49 09FEB04 0 1 0 1 1 -1 17700 .
50 10FEB04 0 1 0 1 1 -1 18100 .
51 11FEB04 0 1 0 1 0 0 18500 .
52 12FEB04 0 1 0 1 0 0 18750 .
53 13FEB04 0 1 0 1 0 0 19000 .
54 16FEB04 0 1 0 1 0 0 19250 .
55 17FEB04 0 1 0 1 0 0 19500 .
Example 2.18. Variable Activity Delay
229
Use of the INFEASDIAGNOSTIC Option
Usage Profile: Multiple Resources
Obs _TIME_ Rdeseng Adeseng Rprodeng Aprodeng Rmktan Amktan Rmoney Amoney
56 18FEB04 1 0 0 1 1 -1 19750 .
57 19FEB04 1 0 0 1 1 -1 20100 .
58 20FEB04 1 0 0 1 1 -1 20450 .
59 23FEB04 1 0 0 1 1 -1 20800 .
60 24FEB04 1 0 0 1 1 -1 21150 .
61 25FEB04 1 0 0 1 1 -1 21500 .
62 26FEB04 1 0 0 1 1 -1 21850 .
63 27FEB04 1 0 0 1 1 -1 22200 .
64 01MAR04 1 0 0 1 1 -1 22550 .
65 02MAR04 1 0 0 1 1 -1 22900 .
66 03MAR04 0 1 0 1 1 -1 23250 .
67 04MAR04 0 1 0 1 1 -1 23450 .
68 05MAR04 0 1 0 1 1 -1 23650 .
69 08MAR04 0 1 0 1 1 -1 23850 .
70 09MAR04 0 1 0 1 1 -1 24050 .
71 10MAR04 1 0 1 0 0 0 24250 .
72 11MAR04 1 0 1 0 0 0 24450 .
73 12MAR04 1 0 1 0 0 0 24650 .
74 15MAR04 1 0 1 0 0 0 24850 .
75 16MAR04 1 0 1 0 0 0 25050 .
76 17MAR04 0 1 0 1 0 0 25250 .
Example 2.18. Variable Activity Delay
In Example 2.17, the DELAY= option is used to specify a maximum amount of delay
that is allowed for all activities in the project. In some situations it may be reasonable
to set the delay for each activity based on some characteristic pertaining to the activ-
ity. For example, consider the data in Example 2.17 with a slightly different scenario.
Suppose that no delay is allowed in activities that require a production engineer. Data
set WIDGR18, displayed in Output 2.18.1, is obtained from WIDGR17 using the
following simple DATA step.
data widgr18;
set widgr17;
if prodeng ^= . then adelay = 0;
else adelay = 5;
run;
title Variable Activity Delay;
title2 Data Set WIDGR18;
proc print;
run;
230
Chapter 2. The CPM Procedure
Output 2.18.1. Activity Data Set WIDGR18
Variable Activity Delay
Data Set WIDGR18
Obs task days tail head deseng mktan prodeng money adelay
1 Approve Plan 5 1 2 1 1 1 200 0
2 Drawings 10 2 3 1 . 1 100 0
3 Anal. Market 5 2 4 . 1 1 100 0
4 Write Specs 5 2 3 1 . 1 150 0
5 Prototype 15 3 5 1 . 1 300 0
6 Mkt. Strat. 10 4 6 . 1 . 150 5
7 Materials 10 5 7 . . . 300 5
8 Facility 10 5 7 . . 1 500 0
9 Init. Prod. 10 7 8 . . . 250 5
10 Evaluate 10 8 9 1 . . 150 5
11 Test Market 15 6 9 . 1 . 200 5
12 Changes 5 9 10 1 . 1 200 0
13 Production 0 10 11 1 . 1 600 0
14 Marketing 0 6 12 . 1 . . 5
15 Dummy 0 8 6 . . . . 5
PROC CPM is invoked with the ACTDELAY=ADELAY option in the RESOURCE
statement. The INFEASDIAGNOSTIC option is also used to enable the procedure
to schedule activities even if resources are insufcient. The output data sets are dis-
played in Output 2.18.2 and Output 2.18.3.
data resin17;
input per & date7. otype $
deseng mktan prodeng money;
format per date7.;
datalines;
. restype 1 1 1 4
01dec03 reslevel 1 . 1 .
;
data holdata;
format hol date7. name $9. ;
input hol & date7. name & ;
datalines;
25dec03 Christmas
01jan04 New Year
;
proc cpm date=01dec03d
interval=weekday
data=widgr18
holidata=holdata
resin=resin17
out=widgo18
resout=widgro18;
tailnode tail;
duration days;
headnode head;
holiday hol;
Example 2.18. Variable Activity Delay
231
resource deseng prodeng mktan money / period=per
obstype=otype
delayanalysis
actdelay=adelay
infeasdiagnostic
rcs avl t_float
cumusage;
id task;
run;
Output 2.18.2. Resource-Constrained Schedule: Variable Activity Delay
Variable Activity Delay
Resource Constrained Schedule
Obs tail head days task adelay deseng prodeng mktan money S_START
1 1 2 5 Approve Plan 0 1 1 1 200 01DEC03
2 2 3 10 Drawings 0 1 1 . 100 08DEC03
3 2 4 5 Anal. Market 0 . 1 1 100 14JAN04
4 2 3 5 Write Specs 0 1 1 . 150 08DEC03
5 3 5 15 Prototype 0 1 1 . 300 22DEC03
6 4 6 10 Mkt. Strat. 5 . . 1 150 21JAN04
7 5 7 10 Materials 5 . . . 300 14JAN04
8 5 7 10 Facility 0 . 1 . 500 14JAN04
9 7 8 10 Init. Prod. 5 . . . 250 28JAN04
10 8 9 10 Evaluate 5 1 . . 150 11FEB04
11 6 9 15 Test Market 5 . . 1 200 11FEB04
12 9 10 5 Changes 0 1 1 . 200 03MAR04
13 10 11 0 Production 0 1 1 . 600 10MAR04
14 6 12 0 Marketing 5 . . 1 . 11FEB04
15 8 6 0 Dummy 5 . . . . 11FEB04
Obs S_FINISH E_START E_FINISH L_START L_FINISH T_FLOAT R_DELAY DELAY_R SUPPL_R
1 05DEC03 01DEC03 05DEC03 01DEC03 05DEC03 0 0 mktan
2 19DEC03 08DEC03 19DEC03 08DEC03 19DEC03 0 0
3 20JAN04 08DEC03 12DEC03 21JAN04 27JAN04 30 25 prodeng prodeng
4 12DEC03 08DEC03 12DEC03 15DEC03 19DEC03 5 0 deseng
5 13JAN04 22DEC03 13JAN04 22DEC03 13JAN04 0 0
6 03FEB04 15DEC03 29DEC03 28JAN04 10FEB04 30 0 mktan
7 27JAN04 14JAN04 27JAN04 14JAN04 27JAN04 0 0
8 27JAN04 14JAN04 27JAN04 14JAN04 27JAN04 0 0
9 10FEB04 28JAN04 10FEB04 28JAN04 10FEB04 0 0
10 24FEB04 11FEB04 24FEB04 18FEB04 02MAR04 5 0
11 02MAR04 11FEB04 02MAR04 11FEB04 02MAR04 0 0 mktan
12 09MAR04 03MAR04 09MAR04 03MAR04 09MAR04 0 0
13 10MAR04 10MAR04 10MAR04 10MAR04 10MAR04 0 0
14 11FEB04 11FEB04 11FEB04 10MAR04 10MAR04 20 0
15 11FEB04 11FEB04 11FEB04 11FEB04 11FEB04 0 0
232
Chapter 2. The CPM Procedure
Output 2.18.3. Resource Usage
Variable Activity Delay
Usage Profile
Obs _TIME_ Rdeseng Adeseng Rprodeng Aprodeng Rmktan Amktan Rmoney Amoney
1 01DEC03 1 0 1 0 1 -1 0 .
2 02DEC03 1 0 1 0 1 -1 200 .
3 03DEC03 1 0 1 0 1 -1 400 .
4 04DEC03 1 0 1 0 1 -1 600 .
5 05DEC03 1 0 1 0 1 -1 800 .
6 08DEC03 2 -1 2 -1 0 0 1000 .
7 09DEC03 2 -1 2 -1 0 0 1250 .
8 10DEC03 2 -1 2 -1 0 0 1500 .
9 11DEC03 2 -1 2 -1 0 0 1750 .
10 12DEC03 2 -1 2 -1 0 0 2000 .
11 15DEC03 1 0 1 0 0 0 2250 .
12 16DEC03 1 0 1 0 0 0 2350 .
13 17DEC03 1 0 1 0 0 0 2450 .
14 18DEC03 1 0 1 0 0 0 2550 .
15 19DEC03 1 0 1 0 0 0 2650 .
16 22DEC03 1 0 1 0 0 0 2750 .
17 23DEC03 1 0 1 0 0 0 3050 .
18 24DEC03 1 0 1 0 0 0 3350 .
19 26DEC03 1 0 1 0 0 0 3650 .
20 29DEC03 1 0 1 0 0 0 3950 .
21 30DEC03 1 0 1 0 0 0 4250 .
22 31DEC03 1 0 1 0 0 0 4550 .
23 02JAN04 1 0 1 0 0 0 4850 .
24 05JAN04 1 0 1 0 0 0 5150 .
25 06JAN04 1 0 1 0 0 0 5450 .
26 07JAN04 1 0 1 0 0 0 5750 .
27 08JAN04 1 0 1 0 0 0 6050 .
28 09JAN04 1 0 1 0 0 0 6350 .
29 12JAN04 1 0 1 0 0 0 6650 .
30 13JAN04 1 0 1 0 0 0 6950 .
31 14JAN04 0 1 2 -1 1 -1 7250 .
32 15JAN04 0 1 2 -1 1 -1 8150 .
33 16JAN04 0 1 2 -1 1 -1 9050 .
34 19JAN04 0 1 2 -1 1 -1 9950 .
35 20JAN04 0 1 2 -1 1 -1 10850 .
36 21JAN04 0 1 1 0 1 -1 11750 .
37 22JAN04 0 1 1 0 1 -1 12700 .
38 23JAN04 0 1 1 0 1 -1 13650 .
39 26JAN04 0 1 1 0 1 -1 14600 .
40 27JAN04 0 1 1 0 1 -1 15550 .
41 28JAN04 0 1 0 1 1 -1 16500 .
42 29JAN04 0 1 0 1 1 -1 16900 .
43 30JAN04 0 1 0 1 1 -1 17300 .
44 02FEB04 0 1 0 1 1 -1 17700 .
45 03FEB04 0 1 0 1 1 -1 18100 .
46 04FEB04 0 1 0 1 0 0 18500 .
47 05FEB04 0 1 0 1 0 0 18750 .
48 06FEB04 0 1 0 1 0 0 19000 .
49 09FEB04 0 1 0 1 0 0 19250 .
50 10FEB04 0 1 0 1 0 0 19500 .
51 11FEB04 1 0 0 1 1 -1 19750 .
52 12FEB04 1 0 0 1 1 -1 20100 .
53 13FEB04 1 0 0 1 1 -1 20450 .
54 16FEB04 1 0 0 1 1 -1 20800 .
55 17FEB04 1 0 0 1 1 -1 21150 .
Example 2.18. Variable Activity Delay
233
Variable Activity Delay
Usage Profile
Obs _TIME_ Rdeseng Adeseng Rprodeng Aprodeng Rmktan Amktan Rmoney Amoney
56 18FEB04 1 0 0 1 1 -1 21500 .
57 19FEB04 1 0 0 1 1 -1 21850 .
58 20FEB04 1 0 0 1 1 -1 22200 .
59 23FEB04 1 0 0 1 1 -1 22550 .
60 24FEB04 1 0 0 1 1 -1 22900 .
61 25FEB04 0 1 0 1 1 -1 23250 .
62 26FEB04 0 1 0 1 1 -1 23450 .
63 27FEB04 0 1 0 1 1 -1 23650 .
64 01MAR04 0 1 0 1 1 -1 23850 .
65 02MAR04 0 1 0 1 1 -1 24050 .
66 03MAR04 1 0 1 0 0 0 24250 .
67 04MAR04 1 0 1 0 0 0 24450 .
68 05MAR04 1 0 1 0 0 0 24650 .
69 08MAR04 1 0 1 0 0 0 24850 .
70 09MAR04 1 0 1 0 0 0 25050 .
71 10MAR04 0 1 0 1 0 0 25250 .
Note from the Schedule data set that the activity Anal. Market is scheduled to
start on January 14, 2004, even though (L
FLOAT value. Note that if both the DELAY= and ACTDELAY= options
are specied, the DELAY= value is used to set the activity delay values for activities
that have missing values for the ACTDELAY variable.
234
Chapter 2. The CPM Procedure
Note also that in this invocation of PROC CPM, the BASELINE statement is used to
compare the early start schedule and the resource constrained schedule. Note that the
S
VAR and F
FLOAT)
Variable Activity Delay
Resource Constrained Schedule
Activity Delay = - (T_FLOAT)
S
p S _ E
a d r _ F _
c e o m m S I S
t h d t t s d k o T N T
O a e a a d e e t n A I A
b i a y s e n n a e R S R
s l d s k l g g n y T H T
1 1 2 5 Approve Plan 0 1 1 1 200 01DEC03 05DEC03 01DEC03
2 2 3 10 Drawings 0 1 1 . 100 08DEC03 19DEC03 08DEC03
3 2 4 5 Anal. Market -30 . 1 1 100 08DEC03 12DEC03 08DEC03
4 2 3 5 Write Specs -5 1 1 . 150 08DEC03 12DEC03 08DEC03
5 3 5 15 Prototype 0 1 1 . 300 22DEC03 13JAN04 22DEC03
6 4 6 10 Mkt. Strat. -30 . . 1 150 15DEC03 29DEC03 15DEC03
7 5 7 10 Materials 0 . . . 300 14JAN04 27JAN04 14JAN04
8 5 7 10 Facility 0 . 1 . 500 14JAN04 27JAN04 14JAN04
9 7 8 10 Init. Prod. 0 . . . 250 28JAN04 10FEB04 28JAN04
10 8 9 10 Evaluate -5 1 . . 150 11FEB04 24FEB04 11FEB04
11 6 9 15 Test Market 0 . . 1 200 11FEB04 02MAR04 11FEB04
12 9 10 5 Changes 0 1 1 . 200 03MAR04 09MAR04 03MAR04
13 10 11 0 Production 0 1 1 . 600 10MAR04 10MAR04 10MAR04
14 6 12 0 Marketing -20 . . 1 . 11FEB04 11FEB04 11FEB04
15 8 6 0 Dummy 0 . . . . 11FEB04 11FEB04 11FEB04
E L B
_ L _ R D S B _
F _ F _ E U _ F
I S I D L P S I S F
N T N E A P T N _ _
O I A I L Y L A I V V
b S R S A _ _ R S A A
s H T H Y R R T H R R
1 05DEC03 01DEC03 05DEC03 0 mktan 01DEC03 05DEC03 0 0
2 19DEC03 08DEC03 19DEC03 0 08DEC03 19DEC03 0 0
3 12DEC03 21JAN04 27JAN04 0 prodeng 08DEC03 12DEC03 0 0
4 12DEC03 15DEC03 19DEC03 0 deseng 08DEC03 12DEC03 0 0
5 13JAN04 22DEC03 13JAN04 0 22DEC03 13JAN04 0 0
6 29DEC03 28JAN04 10FEB04 0 mktan 15DEC03 29DEC03 0 0
7 27JAN04 14JAN04 27JAN04 0 14JAN04 27JAN04 0 0
8 27JAN04 14JAN04 27JAN04 0 14JAN04 27JAN04 0 0
9 10FEB04 28JAN04 10FEB04 0 28JAN04 10FEB04 0 0
10 24FEB04 18FEB04 02MAR04 0 11FEB04 24FEB04 0 0
11 02MAR04 11FEB04 02MAR04 0 mktan 11FEB04 02MAR04 0 0
12 09MAR04 03MAR04 09MAR04 0 03MAR04 09MAR04 0 0
13 10MAR04 10MAR04 10MAR04 0 10MAR04 10MAR04 0 0
14 11FEB04 10MAR04 10MAR04 0 11FEB04 11FEB04 0 0
15 11FEB04 11FEB04 11FEB04 0 11FEB04 11FEB04 0 0
236
Chapter 2. The CPM Procedure
Example 2.19. Activity Splitting
This example illustrates the use of activity splitting to help reduce project duration.
By default, PROC CPM assumes that an activity cannot be interrupted once it is
started (except for holidays and weekends). During resource-constrained scheduling,
it is possible for a noncritical activity to be scheduled rst, and at a later time a critical
activity may be held waiting for a resource to be freed by this less critical activity.
In such situations, you way want to allow noncritical activities to be preempted by
critical ones. PROC CPM enables you to specify, selectively, the activities that can be
split into segments, the minimum length of each segment, and the maximum number
of segments per activity.
The data set WIDGR19, displayed in Output 2.19.1, contains the widget network in
AON format with two resources: prodman and hrdware. Suppose the production
manager is required to oversee certain activities, as indicated by a 1 in the prodman
column. hrdware denotes some piece of equipment that is required by the activity
Drawings (perhaps a plotter to produce the engineering drawings). The variable
minseg denotes the minimum length of the split segments for each activity. Missing
values for this variable are set to default values (one-fth of the activitys duration).
The Resource data set WIDGRIN, displayed in Output 2.19.2, indicates that both re-
sources are replenishable, there is one production manager available from December
1, and the hardware is unavailable on the 10th and 11th of December (perhaps it is
scheduled for maintenance or has been reserved for some other project).
Output 2.19.1. Activity Splitting: Activity Data Set
Activity Splitting
Project Data
Obs task days succ prodman hrdware minseg
1 Approve Plan 5 Drawings 1 . .
2 Approve Plan 5 Anal. Market 1 . .
3 Approve Plan 5 Write Specs 1 . .
4 Drawings 10 Prototype . 1 1
5 Anal. Market 5 Mkt. Strat. . . .
6 Write Specs 5 Prototype . . .
7 Prototype 15 Materials 1 . .
8 Prototype 15 Facility 1 . .
9 Mkt. Strat. 10 Test Market 1 . 1
10 Mkt. Strat. 10 Marketing 1 . 1
11 Materials 10 Init. Prod. . . .
12 Facility 10 Init. Prod. . . .
13 Init. Prod. 10 Test Market 1 . .
14 Init. Prod. 10 Marketing 1 . .
15 Init. Prod. 10 Evaluate 1 . .
16 Evaluate 10 Changes 1 . .
17 Test Market 15 Changes . . .
18 Changes 5 Production . . .
19 Production 0 1 . .
20 Marketing 0 . . .
Example 2.19. Activity Splitting
237
Output 2.19.2. Activity Splitting: Resource Availability Data Set
Activity Splitting
Resource Availability Data Set
Obs per otype prodman hrdware
1 . restype 1 1
2 01DEC03 reslevel 1 1
3 10DEC03 reslevel . 0
4 12DEC03 reslevel . 1
The project is rst scheduled without allowing any of the activities to be split. The
Schedule data set SCHED, displayed in Output 2.19.3, indicates that the project
has been delayed by one week (ve working days, since maximum S
FINISH =
17MAR04 while maximum E
FINISH=L
DELAY=0 and
DELAY
R= for all activities). Note also that supplementary levels are not used
(SUPPL
FINISH time for the nal activity in the project contains the mean project
completion time based on the duration estimates that are used.
title PERT Assumptions and Calculations;
/* Activity-on-Arc representation of the project
with three duration estimates */
data widgpert;
format task $12. ;
input task & tail head tm tp to;
dur = (tp + 4*tm + to) / 6;
datalines;
Approve Plan 1 2 5 7 3
Drawings 2 3 10 11 6
Anal. Market 2 4 5 7 3
Write Specs 2 3 5 7 3
Prototype 3 5 15 12 9
Mkt. Strat. 4 6 10 11 9
Materials 5 7 10 12 8
Facility 5 7 10 11 9
Init. Prod. 7 8 10 12 8
Evaluate 8 9 9 13 8
Test Market 6 9 14 15 13
Changes 9 10 5 6 4
Example 2.21. PERT Assumptions and Calculations
249
Production 10 11 0 0 0
Marketing 6 12 0 0 0
Dummy 8 6 0 0 0
;
proc cpm data=widgpert out=sched
date=1dec03d;
tailnode tail;
headnode head;
duration dur;
id task;
run;
proc sort;
by e_start;
run;
goptions vpos=50 hpos=80 border;
proc gantt graphics data=sched;
chart / compress tailnode=tail headnode=head
font=swiss height=1.5 nojobnum skip=2
dur=dur increment=7 nolegend
cframe=ligr;
id task;
run;
Some words of caution are worth mentioning with regard to the traditional PERT
approach. The estimate of the mean project duration obtained in this instance always
underestimates the true value since the length of a critical path is a convex function of
the activity durations. The original PERT model developed by Malcolm et al. (1959)
provides a way to estimate the variance of the project duration as well as calculating
the probabilities of meeting certain target dates and so forth. Their analysis relies on
an implicit assumption that you may ignore all activities that are not on the critical
path in the deterministic problem that is derived by setting the activity durations equal
to the mean value of their distributions. It then applies the Central Limit Theorem to
the duration of this critical path and interprets the result as pertaining to the project
duration.
250
Chapter 2. The CPM Procedure
Output 2.21.1. PERT Statistical Estimates: Gantt Chart
However, when the activity durations are random variables, each path of the project
network is a likely candidate to be the critical path. Every outcome of the activity
durations could result in a different longest path. Furthermore, there could be several
dependent paths in the network in the sense that they share at least one common arc.
Thus, in the most general case, the length of a longest path would be the maximum
of a set of, possibly dependent, random variables. Evaluating or approximating the
distribution of the longest path, even under very specic distributional assumptions
on the activity durations is not a very easy problem. It is not surprising that this topic
is the subject of much research.
In view of the inaccuracies that can stem from the original PERT assumptions, many
people prefer to resort to the use of Monte Carlo Simulation. Van Slyke (1963) made
the rst attempt at straightforward simulation to analyze the distribution of the critical
path. Refer to Elmaghraby (1977) for a detailed synopsis of the pitfalls of making
traditional PERT assumptions and for an introduction to simulation techniques for
activity networks.
Example 2.22. Scheduling Course - Teacher Combinations
This example demonstrates the use of PROC CPM for a typical scheduling prob-
lem that may not necessarily t into a conventional project management scenario.
Such problems abound in practice and can usually be solved using a mathemati-
cal programming model. Here, the problem is modeled as a resource-allocation
problem using PROC CPM, illustrating the richness of the modeling environment
that is available with the SAS System. (Refer also to Kulkarni (1991) and SAS/OR
Example 2.22. Scheduling Course - Teacher Combinations
251
Software: Project Management Examples for another example of course scheduling
using PROC CPM.)
A committee for academically gifted children wishes to conduct some special classes
on weekends. There are four subjects that are to be taught and a number of teachers
available to teach them. Only certain course-teacher combinations are allowed. There
is a constraint on the number of rooms that are available and some teachers may not
be able to teach at certain times. Possible class times are one-hour periods between
9 a.m and 12 noon on Saturdays and Sundays. The goal is to determine a feasible
schedule of classes specifying the teacher that is to teach each class.
Suppose that there are four courses, c1, c2, c3, and c4, and three teachers, t1, t2, and
t3. There are several ways of modeling this problem; one possible way is to form
distinct classes for each possible course-teacher combination and treat each of these
as a distinct activity that needs to be scheduled. For example, if course c1 can be
taught by teachers t1, t2, and t3, dene three activities, c1t1, c1t2, and c1t3. The
resources for this problem are the courses, the teachers, and the number of rooms. In
particular, the resources needed for a particular activity, say, c1t3, are c1 and t3.
The following constraints are imposed:
Course 1 can be taught by Teachers 1, 2, and 3; Course 2 can be taught by
Teachers 1 and 3; Course 3 can be taught by Teachers 1, 2, and 3; and Course
4 can be taught by Teachers 1 and 2.
The total number of classes taught at any time cannot exceed NROOMS.
Class citj (if such a course-teacher combination is allowed) can be taught only
at times when teacher tj is available.
At any given time, a teacher can teach only one class.
At any given time, only one class is to be taught for any given course.
The following program uses PROC CPM to schedule the classes. The schedule is
obtained in terms of unformatted numeric values; the times 1, 2, 3, 4, 5, and 6 are
interpreted as the six different time slots that are possible, namely, Saturday 9, 10,
and 11 a.m. and Sunday 9, 10, and 11 a.m.
The data set CLASSES is the Activity data set, and it indicates the possible course-
teacher combinations and identies the specic room, teacher, and course as the re-
sources required. For each activity, the duration is 1 unit. Note that, in this example,
there are no precedence constraints between the activities; the resource availability
dictates the schedule entirely. However, there may be situations (such as prerequisite
courses) that impose precedence constraints.
The Resource data set, RESOURCE, species resource availabilities. The period
variable, per, indicates the time period from which resources are available. Since
only one class corresponding to a given course is to be taught at a given time, the
availability for c1 c4 is specied as 1. Teacher 2 is available only on Sunday;
thus, specify the availability of t2 to be 1 from time period 4. The total number of
rooms available at a given time is three. Thus, no more than three classes can be
scheduled at a given time.
252
Chapter 2. The CPM Procedure
In the invocation of PROC CPM, the STOPDATE= option is used in the RESOURCE
statement, thus restricting resource constrained scheduling to the rst six time peri-
ods. Not all of the specied activities may be scheduled within the time available,
in which case the unscheduled activities represent course-teacher combinations that
are not feasible under the given conditions. The schedule obtained by PROC CPM
is saved in a data set that is displayed, in Output 2.22.1, after formatting the activ-
ity names and the schedule times appropriately. Note that, in this example, all the
course-teacher combinations are scheduled within the two-day time period.
title Scheduling Course / Teacher Combinations;
data classes;
input class $ succ $ dur c1-c4 t1-t3 nrooms;
datalines;
c1t1 . 1 1 . . . 1 . . 1
c1t2 . 1 1 . . . . 1 . 1
c1t3 . 1 1 . . . . . 1 1
c2t1 . 1 . 1 . . 1 . . 1
c2t3 . 1 . 1 . . . . 1 1
c3t1 . 1 . . 1 . 1 . . 1
c3t2 . 1 . . 1 . . 1 . 1
c3t3 . 1 . . 1 . . . 1 1
c4t1 . 1 . . . 1 1 . . 1
c4t2 . 1 . . . 1 . 1 . 1
;
data resource;
input per c1-c4 t1-t3 nrooms;
datalines;
1 1 1 1 1 1 . 1 3
4 . . . . . 1 . .
;
proc cpm data=classes out=sched
resin=resource;
activity class;
duration dur;
successor succ;
resource c1-c4 t1-t3 nrooms / period=per stopdate=6;
run;
proc format;
value classtim
1 = Saturday 9:00-10:00
2 = Saturday 10:00-11:00
3 = Saturday 11:00-12:00
4 = Sunday 9:00-10:00
5 = Sunday 10:00-11:00
6 = Sunday 11:00-12:00
7 = Not Scheduled
;
value $classt
c1t1 = Class 1, Teacher 1
c1t2 = Class 1, Teacher 2
Example 2.22. Scheduling Course - Teacher Combinations
253
c1t3 = Class 1, Teacher 3
c2t1 = Class 2, Teacher 1
c2t2 = Class 2, Teacher 2
c2t3 = Class 2, Teacher 3
c3t1 = Class 3, Teacher 1
c3t2 = Class 3, Teacher 2
c3t3 = Class 3, Teacher 3
c4t1 = Class 4, Teacher 1
c4t2 = Class 4, Teacher 2
c4t3 = Class 4, Teacher 3
;
data schedtim;
set sched;
format classtim classtim.;
format class $classt.;
if (s_start <= 6) then classtim = s_start;
else classtim = 7;
run;
title2 Schedule of Classes;
proc print;
id class;
var classtim;
run;
Output 2.22.1. Class Schedule
Scheduling Course / Teacher Combinations
Schedule of Classes
class classtim
Class 1, Teacher 1 Saturday 9:00-10:00
Class 1, Teacher 2 Sunday 9:00-10:00
Class 1, Teacher 3 Saturday 10:00-11:00
Class 2, Teacher 1 Saturday 10:00-11:00
Class 2, Teacher 3 Saturday 9:00-10:00
Class 3, Teacher 1 Saturday 11:00-12:00
Class 3, Teacher 2 Sunday 10:00-11:00
Class 3, Teacher 3 Sunday 9:00-10:00
Class 4, Teacher 1 Sunday 9:00-10:00
Class 4, Teacher 2 Sunday 11:00-12:00
There may be several other constraints that you want to impose on the courses sched-
uled. These can usually be modeled suitably by changing the resource availability
prole. For example, suppose that you want to schedule more classes at 10 a.m.
and fewer at other times. The following program creates a new Resource data set,
RESOURC2, that changes the number of rooms available. Again, PROC CPM is
invoked with the STOPDATE= option, and the resulting schedule is displayed in
Output 2.22.2. The schedule can also be displayed graphically using the NETDRAW
procedure, as illustrated in a similar problem in Example 5.16 in Chapter 5, The
NETDRAW Procedure.
254
Chapter 2. The CPM Procedure
data resourc2;
input per c1-c4 t1-t3 nrooms;
datalines;
1 1 1 1 1 1 . 1 1
2 . . . . . . . 3
3 . . . . . . . 2
4 . . . . . 1 . 1
5 . . . . . . . 3
;
proc cpm data=classes out=sched2
resin=resourc2;
activity class;
duration dur;
successor succ;
resource c1-c4 t1-t3 nrooms / period=per stopdate=6;
run;
data schedtim;
set sched2;
format classtim classtim.;
format class $classt.;
if (s_start <= 6) then classtim = s_start;
else classtim = 7;
run;
title2 Alternate Schedule with Additional Constraints;
proc print;
id class;
var classtim;
run;
Output 2.22.2. Alternate Class Schedule
Scheduling Course / Teacher Combinations
Alternate Schedule with Additional Constraints
class classtim
Class 1, Teacher 1 Saturday 9:00-10:00
Class 1, Teacher 2 Sunday 9:00-10:00
Class 1, Teacher 3 Saturday 10:00-11:00
Class 2, Teacher 1 Saturday 10:00-11:00
Class 2, Teacher 3 Saturday 11:00-12:00
Class 3, Teacher 1 Saturday 11:00-12:00
Class 3, Teacher 2 Sunday 10:00-11:00
Class 3, Teacher 3 Sunday 11:00-12:00
Class 4, Teacher 1 Sunday 10:00-11:00
Class 4, Teacher 2 Sunday 11:00-12:00
Example 2.23. Multiproject Scheduling
255
Example 2.23. Multiproject Scheduling
This example illustrates multiproject scheduling. Consider a Survey project that con-
tains three phases, Plan, Prepare, and Implement, with each phase containing more
than one activity. You can consider each phase of the project as a subproject within
the master project, Survey. Each subproject in turn contains the lowest level activities,
also referred to as the leaf tasks. The Activity data set, containing the task durations,
project hierarchy, and the precedence constraints, is displayed in Output 2.23.1.
The PROJECT and ACTIVITY variables together dene the project hierarchy using
the parent/child relationship. Thus, the subproject, Plan, contains the two leaf tasks,
plan sur and design q. Precedence constraints are specied between leaf tasks as
well as between subprojects. For example, the subproject Prepare is followed by
the subproject Implement. Durations are specied for all the tasks in the project,
except for the master project Survey.
In addition to the Activity data set, dene a Holiday data set, also displayed in Output
2.23.1.
Output 2.23.1. Survey Project
Survey Project
Activity Data Set SURVEY
Obs id activity duration succ1 succ2 succ3 project
1 Plan Survey plan sur 4 hire per design q Plan
2 Hire Personnel hire per 5 trn per Prepare
3 Design Questionnaire design q 3 trn per select h print q Plan
4 Train Personnel trn per 3 Prepare
5 Select Households select h 3 Prepare
6 Print Questionnaire print q 4 Prepare
7 Conduct Survey cond sur 10 analyze Implement
8 Analyze Results analyze 6 Implement
9 Plan Plan 6 Survey
10 Prepare Prepare 8 Implement Survey
11 Implement Implement 18 Survey
12 Survey Project Survey .
Survey Project
Holiday Data Set HOLIDATA
Obs hol
1 09APR04
The following statements invoke PROC CPM with a PROJECT statement identifying
the parent task for each subtask in the Survey project. The calendar followed is a
weekday calendar with a holiday dened on April 9, 2004. The ORDERALL option
on the PROJECT statement creates the ordering variables ES
ASC and LS
ASC in
the Schedule data set, and the ADDWBS option creates a work breakdown structure
code for the project. The Schedule data set is displayed in Output 2.23.2, after being
sorted by the variable ES
ASC.
256
Chapter 2. The CPM Procedure
Note that the PROJ
DUR variable is missing for all the leaf tasks, and it contains
the project duration for the supertasks. The project duration is computed as the span
of all the subtasks of the supertask. The PROJ
CODE contains
the Work Breakdown Structure code dened by the CPM procedure using the project
hierarchy.
proc cpm data=survey date=29mar04d out=survout1
interval=weekday holidata=holidata;
activity activity;
successor succ1-succ3;
duration duration;
id id;
holiday hol;
project project / orderall addwbs;
run;
proc sort;
by es_asc;
run;
title Conducting a Market Survey;
title2 Early and Late Start Schedule;
proc print;
run;
Example 2.23. Multiproject Scheduling
257
Output 2.23.2. Survey Project Schedule
Conducting a Market Survey
Early and Late Start Schedule
P P W a d
p R R B c u
r O O S t r
o J J _ i s s s a
j _ _ C v u u u t
O e D L O i c c c i
b c U E D t c c c o
s t R V E y 1 2 3 n
1 28 0 0 Survey .
2 Survey 7 1 0.0 Plan 6
3 Plan . 2 0.0.0 plan sur hire per design q 4
4 Plan . 2 0.0.1 design q trn per select h print q 3
5 Survey 8 1 0.1 Prepare Implement 8
6 Prepare . 2 0.1.0 hire per trn per 5
7 Prepare . 2 0.1.2 select h 3
8 Prepare . 2 0.1.3 print q 4
9 Prepare . 2 0.1.1 trn per 3
10 Survey 16 1 0.2 Implement 18
11 Implement . 2 0.2.0 cond sur analyze 10
12 Implement . 2 0.2.1 analyze 6
E L
E _ L _ T F
_ F _ F _ _ E L
S I S I F F S S
T N T N L L _ _
O A I A I O O A A
b i R S R S A A S S
s d T H T H T T C C
1 Survey Project 29MAR04 06MAY04 29MAR04 06MAY04 0 0 0 0
2 Plan 29MAR04 06APR04 29MAR04 07APR04 1 1 1 1
3 Plan Survey 29MAR04 01APR04 29MAR04 01APR04 0 0 2 2
4 Design Questionnaire 02APR04 06APR04 05APR04 07APR04 1 0 3 3
5 Prepare 02APR04 14APR04 02APR04 14APR04 0 0 4 4
6 Hire Personnel 02APR04 08APR04 02APR04 08APR04 0 0 5 5
7 Select Households 07APR04 12APR04 12APR04 14APR04 2 2 6 8
8 Print Questionnaire 07APR04 13APR04 08APR04 14APR04 1 1 7 6
9 Train Personnel 12APR04 14APR04 12APR04 14APR04 0 0 8 7
10 Implement 15APR04 06MAY04 15APR04 06MAY04 0 0 9 9
11 Conduct Survey 15APR04 28APR04 15APR04 28APR04 0 0 10 10
12 Analyze Results 29APR04 06MAY04 29APR04 06MAY04 0 0 11 11
Next, a Gantt chart of the master project schedule is produced with the subtasks of
each project indented under the parent task. To produce the required indentation, pre-
x the Activity description (saved in the variable id) by a suitable number of blanks
using a simple DATA step. The following program shows the DATA step and the
invocation of the GANTT procedure; the resulting Gantt chart is plotted in Output
2.23.3. Note the precedence constraints between the two supertasks Prepare and
Implement.
258
Chapter 2. The CPM Procedure
data gant;
length id $26.;
set survout1;
if proj_lev=1 then id=" "||id;
else if proj_lev=2 then id=" "||id;
run;
goptions hpos=80 vpos=43;
title c=black f=swiss Conducting a Market Survey;
title2 c=black f=swiss h=1.5 Project Schedule;
proc gantt graphics data=gant holidata=holidata;
chart / holiday=(hol)
interval=weekday
font=swiss skip=2 height=1.2
nojobnum
compress noextrange
activity=activity succ=(succ1-succ3)
cprec=cyan cmile=magenta
caxis=black cframe=ligr;
id id;
run;
Output 2.23.3. Gantt Chart of Schedule
Example 2.23. Multiproject Scheduling
259
PROJ
LEV, WBS
CODE
for all subtasks of this subproject are prexed by 0.1. To produce reports for the
subproject Prepare, you can use a simple WHERE clause to subset the required
observations from the Schedule data set, as shown in the following statements.
title Market Survey;
title2 Sub-Project Schedule;
proc print data=survout1;
where substr(WBS_CODE,1,3) = "0.1";
id activity;
var project--activity duration e_start--t_float;
run;
260
Chapter 2. The CPM Procedure
Output 2.23.5. Subproject Schedule
Market Survey
Sub-Project Schedule
a P P W a d E L
c p R R B c u E _ L _ T
t r O O S t r _ F _ F _
i o J J _ i a S I S I F
v j _ _ C v t T N T N L
i e D L O i i A I A I O
t c U E D t o R S R S A
y t R V E y n T H T H T
Prepare Survey 8 1 0.1 Prepare 8 02APR04 14APR04 02APR04 14APR04 0
hire per Prepare . 2 0.1.0 hire per 5 02APR04 08APR04 02APR04 08APR04 0
select h Prepare . 2 0.1.2 select h 3 07APR04 12APR04 12APR04 14APR04 2
print q Prepare . 2 0.1.3 print q 4 07APR04 13APR04 08APR04 14APR04 1
trn per Prepare . 2 0.1.1 trn per 3 12APR04 14APR04 12APR04 14APR04 0
In the rst invocation of PROC CPM, the Survey project is scheduled with only a
specication for the project start date. Continuing, this example shows how you can
impose additional constraints on the master project or on the individual subprojects.
First, suppose that you impose a FINISHBEFORE constraint on the Survey project
by specifying the FBDATE to be May 10, 2004. The following program schedules the
project with a project start and nish specication. The resulting summary schedule
for the subprojects is shown in Output 2.23.6. Note that the late nish time of the
project is the 7th of May because there is a weekend on the 8th and 9th of May, 2004.
proc cpm data=survey date=29mar04d out=survout2
interval=weekday holidata=holidata
fbdate=10may04d; /* project finish date */
activity activity;
successor succ1-succ3;
duration duration;
id id;
holiday hol;
project project / orderall addwbs;
run;
title Market Survey;
title2 Summary Schedule: FBDATE Option;
proc print data=survout2;
where proj_lev=1; /* First level subprojects */
id activity;
var proj_dur duration e_start--t_float;
run;
Example 2.23. Multiproject Scheduling
261
Output 2.23.6. Summary Schedule: FBDATE Option
Market Survey
Summary Schedule: FBDATE Option
activity PROJ_DUR duration E_START E_FINISH L_START L_FINISH T_FLOAT
Plan 7 6 29MAR04 06APR04 30MAR04 08APR04 2
Prepare 8 8 02APR04 14APR04 05APR04 15APR04 1
Implement 16 18 15APR04 06MAY04 16APR04 07MAY04 1
Note that the procedure computes the backward pass of the schedule starting from
the project nish date. Thus, the critical path is computed in the context of the entire
project. If you want to obtain individual critical paths for each subproject, use the
SEPCRIT option on the PROJECT statement. You can see the effect of this option in
Output 2.23.7: all the subprojects have T
FLOAT = 0.
Output 2.23.7. Summary Schedule: FBDATE and SEPCRIT Options
Market Survey
Summary Schedule: FBDATE and SEPCRIT Options
activity PROJ_DUR duration E_START E_FINISH L_START L_FINISH T_FLOAT
Plan 7 6 29MAR04 06APR04 29MAR04 06APR04 0
Prepare 8 8 02APR04 14APR04 02APR04 14APR04 0
Implement 16 18 15APR04 06MAY04 15APR04 06MAY04 0
Now, suppose that, in addition to imposing a FINISHBEFORE constraint on the en-
tire project, the project manager for each subproject species a desired duration for
his or her subproject. In the present example, the variable duration has values 6,
8, and 18 for the three subprojects. Note that by default these values are not used
in either the backward or forward pass, even though they may represent desired dura-
tions for the corresponding subprojects. You can specify the USEPROJDUR option
on the PROJECT statement to indicate that the procedure should use these specied
durations to determine the late nish schedule for each of the subprojects. In other
words, if the USEPROJDUR option is specied, the late nish for each subproject is
constrained to be less than or equal to
E
START + duration
and this value is used during the backward pass.
The summary schedule resulting from the use of the USEPROJDUR option is shown
in Output 2.23.8. Note the difference in the schedules in Output 2.23.7 and Output
2.23.8. In Output 2.23.7, the computed project duration, PROJ
START, E
FINISH, L
RATE shows the rate of usage of the resource for the relevant activity. Note that
for driving resources, the variable dur is computed as (mandays / R
RATE). Thus,
for the Activity, Documentation, the programmer requires 10 days to complete 2
man-days of work at a rate of 20 percent per day, while the tester works at a rate of
50 percent requiring 2 days to complete 1 man-day of work.
A Gantt chart of the schedules for each resource is plotted in Output 2.24.3.
Example 2.24. Resource-Driven Durations and Resource Calendars
267
Output 2.24.3. Software Project Schedule
The daily utilization of the resources is also saved in a data set, ROUT, displayed
in Output 2.24.4. The resource usage data set indicates that you need more than one
tester on some days with both the early schedule (on the 14th, 19th, and 20th of April)
and the late schedule (on the 7th and 10th of May).
268
Chapter 2. The CPM Procedure
Output 2.24.4. Resource Usage Data
Software Development
Resource Usage Data Set ROUT
Obs _TIME_ EProgrammer LProgrammer ETester LTester
1 12APR04 1.0 1.0 1.0 1.0
2 13APR04 1.0 1.0 1.0 1.0
3 14APR04 1.0 1.0 2.0 0.0
4 15APR04 1.0 1.0 1.0 0.0
5 16APR04 1.0 1.0 1.0 1.0
6 19APR04 1.0 0.8 1.5 0.0
7 20APR04 1.0 0.8 1.5 0.0
8 21APR04 1.0 0.8 1.0 1.0
9 22APR04 1.0 0.8 1.0 1.0
10 23APR04 1.0 0.8 1.0 1.0
11 26APR04 1.0 0.8 0.0 1.0
12 27APR04 1.0 1.0 0.0 1.0
13 28APR04 1.0 1.0 0.0 1.0
14 29APR04 1.0 1.0 0.0 1.0
15 30APR04 1.0 1.0 0.0 1.0
16 03MAY04 0.5 0.7 1.0 1.0
17 04MAY04 0.5 0.7 1.0 1.0
18 05MAY04 0.5 0.7 1.0 1.0
19 06MAY04 0.5 0.7 1.0 1.0
20 07MAY04 0.5 0.7 1.0 1.5
21 10MAY04 0.5 0.7 1.0 1.5
22 11MAY04 0.0 0.0 0.0 0.0
Suppose now that you have only one tester and one programmer. You can determine
a resource-constrained schedule using PROC CPM (as in the xed duration case) by
specifying a resource availability data set, RESIN (Output 2.24.5).
Output 2.24.5. Resource Availability Data
Software Development
Resource Availability Data Set
Obs per otype Programmer Tester
1 12APR04 reslevel 1 1
Example 2.24. Resource-Driven Durations and Resource Calendars
269
The following statements invoke PROC CPM, and the resulting Resource Schedule
data set is displayed in Output 2.24.6. The ADDCAL option on the RESOURCE
statement creates a variable in the Resource Schedule data set which identies the
activity or resource calendar. Note that the project still nishes on May 11, but some
of the activities (Test Plan, Documentation, Test Data, and Test Routines) are
delayed. The resource-constrained schedule is plotted on a Gantt chart in Output
2.24.7; both resources follow the same weekday calendar.
proc cpm data=software resin=resin
out=sftout1 resout=rout1
rsched=rsftout1
date=12apr04d interval=weekday;
act act;
succ s1 s2;
dur dur;
res Programmer Tester / work=mandays addcal
obstype=otype
period=per
rschedid=Activity;
id Activity;
run;
270
Chapter 2. The CPM Procedure
Output 2.24.6. Resource-Constrained Schedule: Common Calendar
Software Development
Resource Constrained Schedule: Common Resource Calendar
Activity act _CAL_ RESOURCE DUR_TYPE dur mandays R_RATE S_START
Plans & Reqts 1 0 2 . . 12APR04
Plans & Reqts 1 0 Programmer FIXED 2 . 1.0 12APR04
Plans & Reqts 1 0 Tester FIXED 2 . 1.0 12APR04
Product Design 2 0 3 . . 14APR04
Product Design 2 0 Programmer RDRIVEN 3 3 1.0 14APR04
Product Design 2 0 Tester RDRIVEN 1 1 1.0 14APR04
Test Plan 3 0 3 . . 15APR04
Test Plan 3 0 Tester FIXED 3 . 1.0 15APR04
Documentation 4 0 10 . . 27APR04
Documentation 4 0 Programmer RDRIVEN 10 2 0.2 27APR04
Documentation 4 0 Tester RDRIVEN 2 1 0.5 27APR04
Code 5 0 10 . . 19APR04
Code 5 0 Programmer FIXED 10 . 0.8 19APR04
Test Data 6 0 5 . . 20APR04
Test Data 6 0 Tester FIXED 5 . 0.5 20APR04
Test Routines 7 0 5 . . 20APR04
Test Routines 7 0 Tester FIXED 5 . 0.5 20APR04
Test Product 8 0 6 . . 03MAY04
Test Product 8 0 Programmer FIXED 6 . 0.5 03MAY04
Test Product 8 0 Tester FIXED 6 . 1.0 03MAY04
Finish 9 0 0 . . 11MAY04
Activity S_FINISH E_START E_FINISH L_START L_FINISH
Plans & Reqts 13APR04 12APR04 13APR04 12APR04 13APR04
Plans & Reqts 13APR04 12APR04 13APR04 12APR04 13APR04
Plans & Reqts 13APR04 12APR04 13APR04 12APR04 13APR04
Product Design 16APR04 14APR04 16APR04 14APR04 16APR04
Product Design 16APR04 14APR04 16APR04 14APR04 16APR04
Product Design 14APR04 14APR04 14APR04 16APR04 16APR04
Test Plan 19APR04 14APR04 16APR04 21APR04 23APR04
Test Plan 19APR04 14APR04 16APR04 21APR04 23APR04
Documentation 10MAY04 19APR04 30APR04 27APR04 10MAY04
Documentation 10MAY04 19APR04 30APR04 27APR04 10MAY04
Documentation 28APR04 19APR04 20APR04 07MAY04 10MAY04
Code 30APR04 19APR04 30APR04 19APR04 30APR04
Code 30APR04 19APR04 30APR04 19APR04 30APR04
Test Data 26APR04 19APR04 23APR04 26APR04 30APR04
Test Data 26APR04 19APR04 23APR04 26APR04 30APR04
Test Routines 26APR04 19APR04 23APR04 26APR04 30APR04
Test Routines 26APR04 19APR04 23APR04 26APR04 30APR04
Test Product 10MAY04 03MAY04 10MAY04 03MAY04 10MAY04
Test Product 10MAY04 03MAY04 10MAY04 03MAY04 10MAY04
Test Product 10MAY04 03MAY04 10MAY04 03MAY04 10MAY04
Finish 11MAY04 11MAY04 11MAY04 11MAY04 11MAY04
Example 2.24. Resource-Driven Durations and Resource Calendars
271
Output 2.24.7. Resource-Constrained Schedule
Now suppose that the tester switches to part-time employment, working only four
days a week. Thus, the two resources have different calendars. To determine the
effect this change has on the project schedule, dene a calendar data set identifying
calendar 1 as having a holiday on Friday (see Output 2.24.8). In a new resource
availability data set (also displayed in Output 2.24.8), associate calendar 1 with
the resource Tester and calendar 0 with the resource Programmer. Note that 0
refers to the default calendar, which is the weekday calendar for this project (since
INTERVAL = WEEKDAY).
Output 2.24.8. Resource and Calendar Data
Software Development
Calendar Data Set CALENDAR
Obs _cal_ _fri_
1 1 holiday
Resource Data Set RESIN2
Obs per otype Programmer Tester
1 . calendar 0 1
2 12APR04 reslevel 1 1
272
Chapter 2. The CPM Procedure
Next, invoke PROC CPM, as shown in the following statements, with the Activity,
Resource, and Calendar data sets to obtain the revised schedule, plotted in Output
2.24.9. Note that the project is delayed by two days because of the TESTERs shorter
work week, which is illustrated by the longer holiday breaks in the TESTERs sched-
ule bars. The new resource constrained schedule is displayed in Output 2.24.10.
proc cpm data=software resin=resin2
caledata=calendar
out=sftout2 rsched=rsftout2
resout=rout2
date=12apr04d interval=weekday;
act act;
succ s1 s2;
dur dur;
res Programmer Tester / work=mandays addcal
obstype=otype
period=per
rschedid=Activity;
id Activity;
run;
Output 2.24.9. Resource-Constrained Schedule
Example 2.24. Resource-Driven Durations and Resource Calendars
273
Output 2.24.10. Resource-Constrained Schedule: Multiple Calendars
Software Development
Resource Constrained Schedule: Multiple Resource Calendars
Activity act _CAL_ RESOURCE DUR_TYPE dur mandays R_RATE S_START
Plans & Reqts 1 0 2 . . 12APR04
Plans & Reqts 1 0 Programmer FIXED 2 . 1.0 12APR04
Plans & Reqts 1 1 Tester FIXED 2 . 1.0 12APR04
Product Design 2 0 3 . . 14APR04
Product Design 2 0 Programmer RDRIVEN 3 3 1.0 14APR04
Product Design 2 1 Tester RDRIVEN 1 1 1.0 14APR04
Test Plan 3 0 3 . . 15APR04
Test Plan 3 1 Tester FIXED 3 . 1.0 15APR04
Documentation 4 0 10 . . 29APR04
Documentation 4 0 Programmer RDRIVEN 10 2 0.2 29APR04
Documentation 4 1 Tester RDRIVEN 2 1 0.5 29APR04
Code 5 0 10 . . 19APR04
Code 5 0 Programmer FIXED 10 . 0.8 19APR04
Test Data 6 0 5 . . 21APR04
Test Data 6 1 Tester FIXED 5 . 0.5 21APR04
Test Routines 7 0 5 . . 21APR04
Test Routines 7 1 Tester FIXED 5 . 0.5 21APR04
Test Product 8 0 6 . . 04MAY04
Test Product 8 0 Programmer FIXED 6 . 0.5 04MAY04
Test Product 8 1 Tester FIXED 6 . 1.0 04MAY04
Finish 9 0 0 . . 13MAY04
Activity S_FINISH E_START E_FINISH L_START L_FINISH
Plans & Reqts 13APR04 12APR04 13APR04 12APR04 13APR04
Plans & Reqts 13APR04 12APR04 13APR04 12APR04 13APR04
Plans & Reqts 13APR04 12APR04 13APR04 12APR04 13APR04
Product Design 16APR04 14APR04 16APR04 14APR04 16APR04
Product Design 16APR04 14APR04 16APR04 14APR04 16APR04
Product Design 14APR04 14APR04 14APR04 15APR04 15APR04
Test Plan 20APR04 14APR04 19APR04 19APR04 21APR04
Test Plan 20APR04 14APR04 19APR04 19APR04 21APR04
Documentation 12MAY04 19APR04 30APR04 28APR04 11MAY04
Documentation 12MAY04 19APR04 30APR04 28APR04 11MAY04
Documentation 03MAY04 19APR04 20APR04 10MAY04 11MAY04
Code 30APR04 19APR04 30APR04 19APR04 30APR04
Code 30APR04 19APR04 30APR04 19APR04 30APR04
Test Data 28APR04 20APR04 27APR04 22APR04 30APR04
Test Data 28APR04 20APR04 27APR04 22APR04 29APR04
Test Routines 28APR04 20APR04 27APR04 22APR04 30APR04
Test Routines 28APR04 20APR04 27APR04 22APR04 29APR04
Test Product 12MAY04 03MAY04 11MAY04 03MAY04 11MAY04
Test Product 11MAY04 03MAY04 10MAY04 04MAY04 11MAY04
Test Product 12MAY04 03MAY04 11MAY04 03MAY04 11MAY04
Finish 13MAY04 12MAY04 12MAY04 12MAY04 12MAY04
274
Chapter 2. The CPM Procedure
Example 2.25. Resource-Driven Durations and Alternate
Resources
Consider the software project dened in Example 2.24 but now the project requires a
single resource: a programmer. A network diagram displaying the activities and their
precedence relationships is shown in Figure 2.8, as part of the same example.
Some of the activities in this project have a xed duration, requiring a xed length
of time from a programmer. Other activities specify the amount of work required in
terms of man-days; for these activities, the length of the task will depend on the num-
ber of programmers (or rate) that is assigned to the task. The activities in the project,
their durations (if xed) or the total work required (if resource-driven) in days, the
precedence constraints, and the resource requirements are displayed in Output 2.25.1.
Suppose that you have only one programmer assigned to the project. You can de-
termine a resource-constrained schedule using PROC CPM by specifying a resource
availability data set, resin (also in Output 2.25.1). Note that the Resource data set
indicates that the resource Programmer is a driving resource whenever the WORK
variable has a valid value.
Output 2.25.1. Project Data
Software Development
Activity Data Set SOFTWARE
Activity act s1 s2 dur mandays Programmer
Plans & Reqts 1 2 3 2 . 1
Product Design 2 4 5 . 3 1
Test Plan 3 6 7 3 . .
Documentation 4 9 . 1 2 1
Code 5 8 . 1 10 1
Test Data 6 8 . 5 . .
Test Routines 7 8 . 5 . .
Test Product 8 9 . 6 . 1
Finish 9 . . 0 . .
Software Development
Resource Availability Data Set
Obs per otype Programmer
1 . resrcdur 1
2 12APR04 reslevel 1
The following statements invoke PROC CPM with a WORK= specication on the
RESOURCE statement, which identies (in number of man-days, in this case) the
amount of work required from the resource Programmer for each activity. If the
WORK variable has a missing value, the activity in that observation is assumed
to have a xed duration. The project is scheduled to start on April 12, 2004, and
the activities are assumed to follow a ve-day work week. The resulting sched-
ule is displayed in Output 2.25.2. For each activity in the project, the value of the
variable DUR
0
relationship) ends. Thus, for example, the activity, Mile 4 has E
START=27JAN04
because its predecessor, Task 3, has E
FINISH for Mile 13 (and the project nish time) is the end of the day
on 28JAN04. Note that both the variables EFINMILE and LFINMILE have the same
values for all the activities in this example.
proc cpm data=tasks out=out1
collapse interval=day
date=26jan04d
setfinishmilestone;
activity act;
successor succ /lag=(lag);
duration dur;
id lag notrgtmd;
run;
title Schedule with option SETFINISHMILESTONE;
title2 No Target Dates;
proc print;
id act;
var succ lag dur notrgtmd e_start e_finish
l_start l_finish efinmile lfinmile;
run;
286
Chapter 2. The CPM Procedure
Output 2.28.3. Schedule with SETFINISHMILESTONE Option
Schedule with option SETFINISHMILESTONE
No Target Dates
n E L E L
o E _ L _ F F
t _ F _ F I I
r S I S I N N
s g T N T N M M
a u l d t A I A I I I
c c a u m R S R S L L
t c g r d T H T H E E
Task 0 Mile 1 ss_0 1 . 26JAN04 26JAN04 28JAN04 28JAN04 . .
Mile 1 Task 2 0 26JAN04 26JAN04 26JAN04 28JAN04 28JAN04 . .
Task 2 1 . 26JAN04 26JAN04 28JAN04 28JAN04 . .
Task 3 Mile 4 1 . 26JAN04 26JAN04 28JAN04 28JAN04 . .
Mile 4 0 26JAN04 26JAN04 26JAN04 28JAN04 28JAN04 1 1
Task 5 Mile 6 1 . 26JAN04 26JAN04 27JAN04 27JAN04 . .
Mile 6 Mile 7 FS_1 0 26JAN04 26JAN04 26JAN04 27JAN04 27JAN04 1 1
Mile 7 0 27JAN04 27JAN04 27JAN04 28JAN04 28JAN04 1 1
Task 8 Mile 9 SS_3 1 . 26JAN04 26JAN04 26JAN04 26JAN04 . .
Mile 9 Mile 10 0 29JAN04 29JAN04 29JAN04 29JAN04 29JAN04 . .
Mile 10 0 29JAN04 29JAN04 29JAN04 29JAN04 29JAN04 . .
Task 11 Mile 12 2 . 26JAN04 27JAN04 26JAN04 27JAN04 . .
Mile 12 Mile 13 FS_1 0 27JAN04 27JAN04 27JAN04 27JAN04 27JAN04 1 1
Mile 13 0 28JAN04 28JAN04 28JAN04 28JAN04 28JAN04 1 1
The next invocation of CPM illustrates the effect of alignment constraints on the
milestones. As explained in the Finish Milestones section on page 111, imposing
an alignment constraint of type SGE on a milestone may change it from a nish
milestone to a start milestone (default behavior) as far as the early schedule of the
project is concerned. In the following program, the CPM procedure is invoked with
the SETFINISHMILESTONE option and the ALIGNDATE and ALIGNTYPE state-
ments. The resulting schedule is printed in Output 2.28.4. Note that the early sched-
ule of the milestones should now correspond to the values in the variable miledate.
Note also that the activities Mile 12 and Mile 13 are no longer nish milestones, as
indicated by missing values for the variable EFINMILE. The SGE alignment con-
straint with a target date of 28JAN04 moves the milestone Mile 12 to the beginning
of January 28, 2004, instead of the end of January 27, 2004.
proc cpm data=tasks out=out2
collapse
interval=day
date=26jan04d
setfinishmilestone;
activity act;
successor succ /lag=(lag);
duration dur;
aligndate target;
aligntype trgttype;
id target trgttype lag miledate;
run;
Example 2.28. Use of the SETFINISHMILESTONE Option
287
title Schedule with option SETFINISHMILESTONE;
title2 Target Dates change Early Schedule for some Milestones;
proc print;
id act;
var succ lag target trgttype miledate e_start e_finish
l_start l_finish efinmile lfinmile;
run;
Output 2.28.4. Effect of Alignment Constraints
Schedule with option SETFINISHMILESTONE
Target Dates change Early Schedule for some Milestones
t m E L E L
r i E _ L _ F F
t g l _ F _ F I I
a t e S I S I N N
s r t d T N T N M M
a u l g y a A I A I I I
c c a e p t R S R S L L
t c g t e e T H T H E E
Task 0 Mile 1 ss_0 26JAN04 SGE . 26JAN04 26JAN04 28JAN04 28JAN04 . .
Mile 1 Task 2 . 26JAN04 26JAN04 26JAN04 28JAN04 28JAN04 . .
Task 2 . . 26JAN04 26JAN04 28JAN04 28JAN04 . .
Task 3 Mile 4 . . 26JAN04 26JAN04 28JAN04 28JAN04 . .
Mile 4 . 26JAN04 26JAN04 26JAN04 28JAN04 28JAN04 1 1
Task 5 Mile 6 . . 26JAN04 26JAN04 27JAN04 27JAN04 . .
Mile 6 Mile 7 FS_1 . 26JAN04 26JAN04 26JAN04 27JAN04 27JAN04 1 1
Mile 7 . 27JAN04 27JAN04 27JAN04 28JAN04 28JAN04 1 1
Task 8 Mile 9 SS_3 . . 26JAN04 26JAN04 26JAN04 26JAN04 . .
Mile 9 Mile 10 . 29JAN04 29JAN04 29JAN04 29JAN04 29JAN04 . .
Mile 10 . 29JAN04 29JAN04 29JAN04 29JAN04 29JAN04 . .
Task 11 Mile 12 . . 26JAN04 27JAN04 26JAN04 27JAN04 . .
Mile 12 Mile 13 FS_1 28JAN04 SGE 28JAN04 28JAN04 28JAN04 27JAN04 27JAN04 . 1
Mile 13 . 29JAN04 29JAN04 29JAN04 28JAN04 28JAN04 . 1
The interpretation of the start and nish times for a milestone depends on whether it is
a start milestone or a nish milestone. By default, all milestones are start milestones
and are assumed to be scheduled at the beginning of the date specied in the start or
nish time variable. As such, PROC GANTT displays these milestones at the start
of the corresponding days on the Gantt chart. However, if a milestone is a nish
milestone then it may not be displayed correctly on the Gantt chart, depending on the
scale of the display.
In this example, PROC GANTT is used to display the schedule produced in Output
2.28.4. Recall that the schedule is saved in the data set out2. First, PROC GANTT
is invoked without any modications to the schedule data set. The resulting Gantt
chart is displayed in Output 2.28.5. Note that the nish milestones (with values of
EFINMILE = 1) are not plotted correctly. For example, Mile 6 is plotted at the
beginning instead of the end of the schedule bar for the predecessor activity, Act 5.
To correct this problem, you can adjust the schedule variables for the nish milestones
and plot the new values, as illustrated by the second invocation of PROC GANTT.
The corrected Gantt chart is displayed in Output 2.28.6.
288
Chapter 2. The CPM Procedure
title h=1.5
Schedule with option SETFINISHMILESTONE and ALIGNDATE;
title2 Gantt Chart of Early Schedule without adjustment;
proc gantt data=out2(drop=l_:);
chart / compress act=act succ=succ lag=lag
font=swiss scale=7
cprec=cyan cmile=magenta
caxis=black cframe=ligr;
dur=dur nojobnum nolegend;
id act succ lag e_start efinmile;
run;
/* Save adjusted E_START and E_FINISH times for finish
milestones */
data temp;
set out2;
format estart efinish date7.;
estart = e_start;
efinish = e_finish;
if efinmile then do;
estart=estart+1;
efinish=efinish+1;
end;
run;
/* Plot the adjusted start and finish times for the
early schedule */
title h=1.5
Schedule with option SETFINISHMILESTONE and ALIGNDATE;
title2 Gantt Chart of Early Schedule after adjustment;
proc gantt data=temp(drop=l_:);
chart / compress act=act succ=succ lag=lag
font=swiss scale=7
es=estart ef=efinish
cprec=cyan cmile=magenta
caxis=black cframe=ligr;
dur=dur nojobnum nolegend;
id act succ lag e_start efinmile;
run;
Example 2.28. Use of the SETFINISHMILESTONE Option
289
Output 2.28.5. Gantt Chart of Unadjusted Schedule
Output 2.28.6. Gantt Chart of Adjusted Schedule
290
Chapter 2. The CPM Procedure
Example 2.29. Negative Resource Requirements
This example illustrates the use of negative resource requirements and the
MILESTONERESOURCE option. Consider the production of boxed greeting cards
that need to be shipped on trucks with a given capacity. Suppose there are three
trucks with a capacity of 10,000 boxes of cards each. Suppose also that the boxes
are produced at the rate of 5,000 boxes a day by the box-creating activity, First
Order with a duration of 6 days, and requiring the use of a machine, say resource
Mach1. The activity data set OneOrder, displayed in Output 2.29.1, represents
the activities that are to be scheduled. Note that the Schedule Truck i task (i =
1, 2, 3) is represented as a milestone to denote the point in time when the required
number of boxes are available from the production line. The variable numboxes
denotes the number of boxes that are produced by the machine, or delivered by the
trucks. The Resource data set OneMachine, displayed in Output 2.29.2, denes the
resource numboxes as a consumable resource and the resources Mach1 and trucks
as replenishable resources.
Output 2.29.1. Activity Data Set
Greeting Card Production
Activity Data Set OneOrder
Obs Activity succ Duration Mach1 numboxes trucks
1 First Order 6 1 -5000 .
2 Sched truck1 Delivery 1 0 . 10000 .
3 Sched truck2 Delivery 2 0 . 10000 .
4 Sched truck3 Delivery 3 0 . 10000 .
5 Delivery 1 2 . . 1
6 Delivery 2 2 . . 1
7 Delivery 3 2 . . 1
Output 2.29.2. Resource Data Set
Resource Data Set OneMachine
Obs per obstype Mach1 numboxes trucks
1 . restype 1 2 1
2 15AUG04 reslevel 1 . 1
The following statements invoke the CPM procedure to schedule the production of
the boxed greeting cards. The option MILESTONERESOURCE indicates that mile-
stones can consume resources. In this case, the milestones representing the schedul-
ing of the trucks are scheduled only when 10,000 boxes of greeting cards are avail-
able. The resulting schedule is displayed in Output 2.29.3 using PROC GANTT, and
the resource usage data set is displayed in Output 2.29.4.
proc cpm data=OneOrder resin=OneMachine
out=OneSched rsched=OneRsch resout=OneRout
date=15aug04d;
act activity;
succ succ;
duration duration;
Example 2.29. Negative Resource Requirements
291
resource Mach1 numboxes trucks / period=per
obstype=obstype
milestoneresource;
run;
proc sort data=OneSched;
by s_start;
run;
title Greeting Card Production;
title2 Truck Schedule;
title h=2 f=swissb Greeting Card Production;
title h=1.5 f=swissb Truck Schedule;
proc gantt data=OneSched (drop=e_: l_:) ;
chart / act=activity succ=succ duration=duration
cmile=red top
nolegend nojobnum;
id activity duration;
run;
title2 Resource Usage Data Set;
proc print data=OneRout;
id _time_;
run;
Output 2.29.3. Gantt Chart of Schedule
292
Chapter 2. The CPM Procedure
The resulting Gantt chart shows the schedule of the trucks, which is staggered ac-
cording to the production rate of the machine that produces the cards. In other words,
the trucks are scheduled at intervals of 2 days. The Resource Usage data set shows
the production/consumption rate of the boxes for each day of the project.
Output 2.29.4. Resource Usage Data Set
Resource Usage Data Set
E L R A
n n n n
u u u u E L R A
_ E L R A m m m m t t t t
T M M M M b b b b r r r r
I a a a a o o o o u u u u
M c c c c x x x x c c c c
E h h h h e e e e k k k k
_ 1 1 1 1 s s s s s s s s
15AUG04 1 1 1 0 25000 -5000 -5000 0 3 0 0 1
16AUG04 1 1 1 0 -5000 -5000 -5000 5000 3 0 0 1
17AUG04 1 1 1 0 -5000 -5000 5000 10000 0 0 1 0
18AUG04 1 1 1 0 -5000 -5000 -5000 5000 0 0 1 0
19AUG04 1 1 1 0 -5000 25000 5000 10000 0 3 1 0
20AUG04 1 1 1 0 -5000 -5000 -5000 5000 0 3 1 0
21AUG04 0 0 0 1 0 0 10000 10000 0 0 1 0
22AUG04 0 0 0 1 0 0 0 0 0 0 1 0
23AUG04 0 0 0 1 0 0 0 0 0 0 0 1
Example 2.30. Auxiliary Resources and Negative
Requirements
This example extends the production scenario in the previous example to two separate
orders of the greeting cards. Suppose also that the machine used in Example 2.29 is
to be replaced by a faster machine that is scheduled to come on-line on August 24,
2004. This scheduling problem is modeled using alternate resources Mach1 and
Mach2 for a primary resource Machine. Each of the alternate resources produces
the auxiliary resource numboxes; the rate of production depends on which machine
is used.
The Activity data set TwoOrders, displayed in Output 2.30.1, now contains addi-
tional activities corresponding to the second order of greeting cards. Note that the
resource requirement corresponding to the machine needed for the production is now
represented in terms of the generic machine resource, Machine. The resource data
set, TwoMachines, displayed in Output 2.30.2, species Mach1 and Mach2 as al-
ternate resources for Machine and the resource numboxes as an auxiliary resource
produced at the rate of 5,000 by Mach1 and 10,000 by Mach2. Observations 5 and
6 indicate that the rst machine is available from August 15 and is then replaced by
the second machine on August 24, 2004.
Example 2.30. Auxiliary Resources and Negative Requirements
293
Output 2.30.1. Activity Data Set
Greeting Card Production - Machines 1 and 2
Activity Data Set TwoOrder
A D n _
c u M u p
t r a m t a
i a c M M b r t
v s t h a a o u t
O i u i i c c x c e
b t c o n h h e k r
s y c n e 1 2 s s n
1 First Order 6 1 . . . . 1
2 Sched truck1 Delivery 1 0 . . . 10000 . 1
3 Sched truck2 Delivery 2 0 . . . 10000 . 1
4 Sched truck3 Delivery 3 0 . . . 10000 . 1
5 Delivery 1 2 . . . . 1 1
6 Delivery 2 2 . . . . 1 1
7 Delivery 3 2 . . . . 1 1
8 Second Order 6 1 . . . . 2
9 Sched truck4 Delivery 4 0 . . . 10000 . 2
10 Sched truck5 Delivery 5 0 . . . 10000 . 2
11 Sched truck6 Delivery 6 0 . . . 10000 . 2
12 Delivery 4 2 . . . . 1 2
13 Delivery 5 2 . . . . 1 2
14 Delivery 6 2 . . . . 1 2
Output 2.30.2. Resource Data Set
Greeting Card Production - Machines 1 and 2
Resource Data Set TwoMachines
Obs per obstype resid Machine Mach1 Mach2 numboxes trucks
1 . restype 1 1 1 2 1
2 . altrate Machine . 1 1 . .
3 . auxres Mach1 . . . -5000 .
4 . auxres Mach2 . . . -10000 .
5 15AUG04 reslevel . 1 . . 3
6 24AUG04 reslevel . 0 1 . .
The following statements invoke the CPMprocedure to schedule the production of the
two orders of boxed greeting cards and display the schedule (in Output 2.30.3) using
PROC GANTT. Note that PROC GANTT is invoked with the PATTERN= option in-
dicating that the schedules should be drawn using the pattern statements correspond-
ing to the variable
pattern in the activity data set. In addition, the CTEXTCOLS=
option indicates that the color of the text should match the color of the schedule bars.
proc cpm data=TwoOrders resin=TwoMachines
out=TwoSched rsched=TwoRsched resout=TwoRout
date=15aug04d;
act activity;
succ succ;
duration duration;
resource Machine Mach1 Mach2 numboxes trucks / period=per
obstype=obstype
resid=resid
milestoneresource;
id _pattern;
run;
294
Chapter 2. The CPM Procedure
proc sort data=TwoSched;
by s_start;
run;
title h=1.5 f=swissb Greeting Card Production - Machines 1 and 2;
title2 h=1.2 f=swissb Truck Schedule: Fixed Activity Durations;
proc gantt data=TwoSched(drop=e_: l:);
chart / act=activity succ=succ duration=duration font=swiss
nolegend nojobnum pcompress pattern=_pattern
ctextcols=id scale=4;
id activity ;
run;
title2 Resource Usage Data set: Fixed Activity Durations;
proc print data=TwoRout;
if _time_;
run;
Output 2.30.3. Gantt Chart of Schedule
The Gantt chart shows that the trucks corresponding to the second order of greeting
cards depart at a faster rate (every day) than the ones corresponding to the rst order
(every 2 days). The faster delivery is enabled by the use of the faster machine for
the second order. Note also that the activity Second Order continues for a total of 6
days, even though the order is lled within the rst 3 days. This is due to the fact that
the activity is dened to have a xed duration. The resource usage data set, displayed
Example 2.31. Resource-Driven Durations and Negative Requirements
295
in Output 2.30.4 shows that 10,000 boxes are produced each day for 6 days, causing
an inventory build up of 30,000 boxes at the end of the production schedule.
Output 2.30.4. Resource Usage Data Set
Resource Usage Data set: Fixed Activity Durations
E L R A
E L R A n n n n
M M M M u u u u E L R A
_ a a a a E L R A E L R A m m m m t t t t
T c c c c M M M M M M M M b b b b r r r r
I h h h h a a a a a a a a o o o o u u u u
M i i i i c c c c c c c c x x x x c c c c
E n n n n h h h h h h h h e e e e k k k k
_ e e e e 1 1 1 1 2 2 2 2 s s s s s s s s
15AUG04 2 2 0 0 0 0 1 0 0 0 0 0 60000 0 -5000 0 6 0 0 3
16AUG04 2 2 0 0 0 0 1 0 0 0 0 0 0 0 -5000 5000 6 0 0 3
17AUG04 2 2 0 0 0 0 1 0 0 0 0 0 0 0 5000 10000 0 0 1 2
18AUG04 2 2 0 0 0 0 1 0 0 0 0 0 0 0 -5000 5000 0 0 1 2
19AUG04 2 2 0 0 0 0 1 0 0 0 0 0 0 60000 5000 10000 0 6 1 2
20AUG04 2 2 0 0 0 0 1 0 0 0 0 0 0 0 -5000 5000 0 6 1 2
21AUG04 0 0 0 0 0 0 0 1 0 0 0 0 0 0 10000 10000 0 0 1 2
22AUG04 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 2
23AUG04 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 3
24AUG04 0 0 0 0 0 0 0 0 0 0 1 0 0 0 -10000 0 0 0 0 3
25AUG04 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 10000 0 0 1 2
26AUG04 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 10000 0 0 2 1
27AUG04 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 10000 0 0 2 1
28AUG04 0 0 0 0 0 0 0 0 0 0 1 0 0 0 -10000 10000 0 0 1 2
29AUG04 0 0 0 0 0 0 0 0 0 0 1 0 0 0 -10000 20000 0 0 0 3
30AUG04 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 30000 0 0 0 3
Example 2.31. Resource-Driven Durations and Negative
Requirements
A more realistic model for the truck scheduling example can be built if the activities
First Order and Second Order are dened to be resource driven. In other words,
specify the total amount of work (6 days of work) that is needed from the activity
at a pre-specied rate (of 5,000 boxes per day), and allow the choice of machine to
dictate the duration of the activity. This modied model is illustrated by the activity
data set, TwoOrdersRD, and resource data set, TwoMachinesRD, printed in Output
2.31.1 and Output 2.31.1, respectively. The two orders for greeting cards have a work
specication of 6 days if the generic machine Machine (which produces 5,000 boxes
a day) is used. The resource data set has a new observation with value resrcdur for
the variable obstype. This observation species that the resources Machine, Mach1
and Mach2 drive the durations of activities that require them. The third observation
in this data set species that the second machine is twice as fast as the rst one,
indicated by the fact that the alternate rate is 0.5. This implies that using the second
machine will reduce the activitys duration by 50 percent.
296
Chapter 2. The CPM Procedure
Output 2.31.1. Activity Data Set
Greeting Card Production - Machines 1 and 2
Activity Data Set TwoOrdersRD
A D n _
c u M u p
t r a m t a
i a c M M b r t
v s t w h a a o u t
O i u i o i c c x c e
b t c o r n h h e k r
s y c n k e 1 2 s s n
1 First Order 1 6 1 . . . . 1
2 Sched truck1 Delivery 1 0 . . . . 10000 . 1
3 Sched truck2 Delivery 2 0 . . . . 10000 . 1
4 Sched truck3 Delivery 3 0 . . . . 10000 . 1
5 Delivery 1 2 . . . . . 1 1
6 Delivery 2 2 . . . . . 1 1
7 Delivery 3 2 . . . . . 1 1
8 Second Order 1 6 1 . . . . 2
9 Sched truck4 Delivery 4 0 . . . . 10000 . 2
10 Sched truck5 Delivery 5 0 . . . . 10000 . 2
11 Sched truck6 Delivery 6 0 . . . . 10000 . 2
12 Delivery 4 2 . . . . . 1 2
13 Delivery 5 2 . . . . . 1 2
14 Delivery 6 2 . . . . . 1 2
Output 2.31.2. Resource Data Set
Greeting Card Production - Machines 1 and 2
Resource Data Set TwoMachinesRD
Obs per obstype resid Machine Mach1 Mach2 numboxes trucks
1 . resrcdur 1 1 1.0 . .
2 . restype 1 1 1.0 2 1
3 . altrate Machine . 1 0.5 . .
4 . auxres Mach1 . . . -5000 .
5 . auxres Mach2 . . . -10000 .
6 15AUG04 reslevel . 1 . . 3
7 24AUG04 reslevel . 0 1.0 . .
The following statements invoke PROC CPM with the additional specication of the
WORK= option. Once again, the CPM procedure allocates one of the two machines
for the production, depending on the availability. The Gantt chart is displayed in
Output 2.31.3 and the resource usage data set is printed in Output 2.31.4. As before,
the trucks for the rst order depart every second day requiring a total of 6 days,
while the second order is completed in 3 days. Also, using a resource-driven duration
model allows the second activity to be completed in 3 days instead of 6 days, as in the
previous example. The resource usage data set indicates that production is stopped as
soon as the two orders are lled, avoiding excess inventory.
proc cpm data=TwoOrdersRD resin=TwoMachinesRD
out=TwoSchedRD rsched=TwoRschedRD resout=TwoRoutRD
date=15aug04d;
act activity;
succ succ;
duration duration;
resource Machine Mach1 Mach2 numboxes trucks / period=per
obstype=obstype
Example 2.31. Resource-Driven Durations and Negative Requirements
297
resid=resid work=work
milestoneresource;
id _pattern;
run;
proc sort data=TwoSchedRD;
by s_start;
run;
title h=1.5 f=swissb Greeting Card Production - Machines 1 and 2;
title2 h=1.2 f=swissb Truck Schedule: Resource Driven Durations;
proc gantt data=TwoSchedRD(drop=e_: l:);
chart / act=activity succ=succ duration=duration font=swiss
nolegend nojobnum compress pattern=_pattern
ctextcols=id scale=4;
id activity ;
run;
title2 Resource Usage Data set: Resource Driven Durations;
proc print data=TwoRoutRD;
id _time_;
run;
Output 2.31.3. Gantt Chart of Schedule
298
Chapter 2. The CPM Procedure
Output 2.31.4. Resource Usage Data Set
Resource Usage Data set: Resource Driven Durations
E L R A
E L R A n n n n
M M M M u u u u E L R A
_ a a a a E L R A E L R A m m m m t t t t
T c c c c M M M M M M M M b b b b r r r r
I h h h h a a a a a a a a o o o o u u u u
M i i i i c c c c c c c c x x x x c c c c
E n n n n h h h h h h h h e e e e k k k k
_ e e e e 1 1 1 1 2 2 2 2 s s s s s s s s
15AUG04 2 2 0 0 0 0 1 0 0 0 0 0 60000 0 -5000 0 6 0 0 3
16AUG04 2 2 0 0 0 0 1 0 0 0 0 0 0 0 -5000 5000 6 0 0 3
17AUG04 2 2 0 0 0 0 1 0 0 0 0 0 0 0 5000 10000 0 0 1 2
18AUG04 2 2 0 0 0 0 1 0 0 0 0 0 0 0 -5000 5000 0 0 1 2
19AUG04 2 2 0 0 0 0 1 0 0 0 0 0 0 60000 5000 10000 0 6 1 2
20AUG04 2 2 0 0 0 0 1 0 0 0 0 0 0 0 -5000 5000 0 6 1 2
21AUG04 0 0 0 0 0 0 0 1 0 0 0 0 0 0 10000 10000 0 0 1 2
22AUG04 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 2
23AUG04 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 3
24AUG04 0 0 0 0 0 0 0 0 0 0 1 0 0 0 -10000 0 0 0 0 3
25AUG04 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 10000 0 0 1 2
26AUG04 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 10000 0 0 2 1
27AUG04 0 0 0 0 0 0 0 0 0 0 0 1 0 0 10000 10000 0 0 2 1
28AUG04 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 2
29AUG04 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 3
Statement and Option Cross-Reference Tables
The next two tables reference the statements and options in the CPM procedure that
are illustrated by the examples in this section.
Table 2.28. Statements and Options Specied in Examples 2.12.17
Statement 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
ACTIVITY X X X X X X X X X X
ACTUAL X
ALIGNDATE X
ALIGNTYPE X
BASELINE X
CALID X
DURATION X X X X X X X X X X X X X X X X X
HEADNODE X X X X X X X X
HOLIDAY X X X X X X X X
ID X X X X X X X X X X
RESOURCE X X X X
SUCCESSOR X X X X X X X X X
TAILNODE X X X X X X X X
Option 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
A
FINISH X
ALAGCAL= X
A
START= X
AUTOUPDT X
AVPROFILE X
CALEDATA= X X X
Statement and Option Cross-Reference Tables
299
Table 2.28. (continued)
Option 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
COLLAPSE X
COMPARE= X
CUMUSAGE X X
DATA= X X X X X X X X X X X X X X X X X
DATE= X X X X X X X X X X X X X X X X X
DAYLENGTH= X X X
DAYSTART= X
DELAY= X X
DELAYANALYSIS X X X
FBDATE= X
HOLIDATA= X X X X X X X X
HOLIDUR= X X
HOLIFIN= X X X X
INFEASDIAGNOSTIC X
INTERVAL= X X X X X X X X X X X X
LAG= X
MAXDATE= X
NOAUTOUPDT X
OBSTYPE= X X X
OUT= X X X X X X X X X X X X
PCTCOMP= X
PERIOD= X X X
RCPROFILE X
REMDUR= X
RESOURCEIN= X X X
RESOURCEOUT= X X X X
ROUTNOBREAK X
SCHEDRULE= X
SET= X
SHOWFLOAT X
TIMENOW= X
WORKDATA= X X
XFERVARS X
Table 2.29. Statements and Options Specied in Examples 2.182.31
Statement 18 19 20 21 22 23 24 25 26 27 28 29 30 31
ACTIVITY X X X X X X X X X X X X
ALIGNDATE X X
ALIGNTYPE X X
BASELINE X
DURATION X X X X X X X X X X X X X X
HEADNODE X X
HOLIDAY X X X X
ID X X X X X X X X X X
PROJECT X
RESOURCE X X X X X X X X X X X
SUCCESSOR X X X X X X X X X X X X
TAILNODE X X
ACTDELAY= X
300
Chapter 2. The CPM Procedure
Table 2.29. (continued)
Option 18 19 20 21 22 23 24 25 26 27 28 29 30 31
ADDCAL X
ADDWBS X
ALTBEFORESUP X
AVPROFILE X X X
CALEDATA= X
COLLAPSE X X X
COMPARE= X
CUMUSAGE X
DATA= X X X X X X X X X X X X X X
DATE= X X X X X X X X X X X X X
DELAY= X
DELAYANALYSIS X X
FBDATE= X
F
FLOAT X
HOLIDATA= X X X X
INFEASDIAGNOSTIC X
INTERVAL= X X X X X X X X X
LAG= X
MILESTONERESOURCE X X X
MINSEGMTDUR= X
MULTIPLEALTERNATES X X
OBSTYPE= X X X X X X X X X X
ORDERALL X
OUT= X X X X X X X X X X X X X X
PERIOD= X X X X X X X X X X X
RCPROFILE X X X
RESID= X X X X X X
RESOURCEIN= X X X X X X X X X X X
RESOURCEOUT= X X X X X X X X X X
RESOURCESCHED= X X X X X X X
ROUTNOBREAK
RSCHEDID= X X X X
SEPCRIT X
SET= X
SETFINISHMILESTONE X
STOPDATE= X
T
FLOAT X X
USEPROJDUR X
WORK= X X X X
References
301
References
Davis, E. W. (1973), Project Scheduling under Resource Constraints: Historical
Review and Categorization of Procedures, AIIE Transactions, 5, 297313.
Elmaghraby, S. E. (1977), Activity Networks: Project Planning and Control by
Network Models, New York: John Wiley and Sons, Inc.
Horowitz, E. and Sahni, S. (1976), Fundamentals of Data Structures, Potomac, MD:
Computer Science Press, Inc.
Kulkarni, R. (1991), Scheduling with the CPM Procedure, in Proceedings of the
Sixteenth Annual SAS Users Group International Conference, SAS Institute Inc.
Malcolm, D. G., Roseboom, J. H., Clark, C. E., and Fazar, W. (1959), Applications
of a Technique for R and D Program Evaluation (PERT), Operations Research, 7,
646669.
Minieka, E. (1978), Optimization Algorithms for Networks and Graphs, New York:
Marcel Dekker, Inc.
Moder, J. J., Phillips, C. R., and Davis, E. W. (1983), Project Management with
CPM, PERT and Precedence Diagramming, New York: Van Nostrand Reinhold
Company.
SAS Institute Inc. (1993), SAS/OR Software: Project Management Examples, Cary,
NC: SAS Institute Inc.
Van Slyke, R. M. (1963), Monte Carlo Methods and the PERT Problem, Operations
Research, 11, 839860.
Wiest, J. D. (1967), A Heuristic Model for Scheduling Large Projects with Limited
Resources, Management Science, 13, 359377.
302
Chapter 2. The CPM Procedure
Chapter 3
The DTREE Procedure
Chapter Contents
OVERVIEW . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305
GETTING STARTED . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307
Introductory Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307
Attitudes Toward Risk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312
Sensitivity Analysis and Value of Perfect Information . . . . . . . . . . . . 313
Value of Perfect Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314
Oil Wildcatters Problem with Sounding Test . . . . . . . . . . . . . . . . . 315
SYNTAX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319
Functional Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
PROC DTREE Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . 323
EVALUATE Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . 336
MODIFY Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 336
MOVE Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 337
QUIT Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 337
RECALL Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 337
RESET Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 337
SAVE Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 337
SUMMARY Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . 338
TREEPLOT Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . 338
VARIABLES Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339
VPC Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343
VPI Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343
DETAILS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343
Input Data Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343
Missing Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347
Interactivity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347
Options on Multiple Statements . . . . . . . . . . . . . . . . . . . . . . . . 347
The Order of Stages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 348
Evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 348
Displayed Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 352
Displaying the Decision Tree . . . . . . . . . . . . . . . . . . . . . . . . . 352
Web-Enabled Decision Tree . . . . . . . . . . . . . . . . . . . . . . . . . . 356
ODS Table Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 357
Precision Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 357
304
Chapter 3. The DTREE Procedure
Computer Resource Requirements . . . . . . . . . . . . . . . . . . . . . . 358
EXAMPLES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 358
Example 3.1. Oil Wildcatters Problem with Insurance . . . . . . . . . . . . 359
Example 3.2. Oil Wildcatters Problem in Risk-Averse Setting . . . . . . . . 364
Example 3.3. Contract Bidding Problem . . . . . . . . . . . . . . . . . . . 376
Example 3.4. Research and Development Decision Problem . . . . . . . . . 380
Example 3.5. Loan Grant Decision Problem . . . . . . . . . . . . . . . . . 384
Example 3.6. Petroleum Distributors Decision Problem . . . . . . . . . . . 394
Statement and Option Cross-Reference Tables . . . . . . . . . . . . . . . . 404
REFERENCES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 406
Chapter 3
The DTREE Procedure
Overview
The DTREE procedure in SAS/OR software is an interactive procedure for decision
analysis. The procedure interprets a decision problem represented in SAS data sets,
nds the optimal decisions, and plots on a line printer or a graphics device the deci-
sion tree showing the optimal decisions.
To use PROC DTREE you rst construct a decision model to represent your problem.
This model, called a generic decision tree model, is made up of stages.
Every stage
has a stage name, which identies the stage, as well as a type, which species the
type of the stage. There are three types of stages: decision stages, chance stages, and
end stages. In addition, every stage has possible outcomes.
A decision stage represents a particular decision you have to make. The outcomes of
a decision stage are the possible alternatives (or actions) of the decision. A chance
stage represents an uncertain factor in the decision problem (a statistician might call
it a random variable; here it is called an uncertainty). The outcomes of a chance stage
are events, one of which will occur according to a given probability distribution. An
end stage terminates a particular scenario (a sequence of alternatives and events). It
is not necessary to include an end stage in your model; the DTREE procedure adds
an end stage to your model if one is needed.
Each outcome of a decision or chance stage also has several attributes, an outcome
name to identify the outcome, a reward to give the instant reward of the outcome, and
a successor to specify the name of the stage that comes next when this outcome is
realized. For chance stages, a probability attribute is also needed. It gives the relative
likelihood of this outcome. Every decision stage should have at least two alternatives,
and every chance stage should have at least two events. Probabilities of events for a
chance stage must sum to 1. End stages do not have any outcomes.
The structure of a decision model is given in the STAGEIN= data set. It contains the
stage name, the type, and the attributes (except probability) of all outcomes for each
stage in your model. You can specify each stage in one observation or across several
observations. If a diagrammatic representation of a decision problem is all you want,
you probably do not need any other data sets.
If you want to evaluate and analyze your decision problem, you need another SAS
data set, called the PROBIN= data set. This data set describes the probabilities or
conditional probabilities for every event in your model. Each observation in the data
set contains a list of given conditions (list of outcomes), if there are any, and at least
one combination of event and probability. Each event and probability combination
identies the probability that the event occurs given that all the outcomes specied
The stages are often referred to as variables in many decision analysis articles.
306
Chapter 3. The DTREE Procedure
in the list occur. If no conditions are given, then the probabilities are unconditional
probabilities.
The third data set, called the PAYOFFS= data set, contains the value of each possible
scenario. You can specify one or more scenarios and the associated values in one ob-
servation. If the PAYOFFS= data set is omitted, the DTREE procedure assumes that
all values are zero and uses rewards for outcomes to evaluate the decision problem.
You can use PROC DTREE to display, evaluate, and analyze your decision problem.
In the PROC DTREE statement, you specify input data sets and other options. A
VARIABLES statement identies the variables in the input data set that describe the
model. This statement can be used only once and must appear immediately after the
PROC DTREE statement. The EVALUATE statement evaluates the decision tree.
You can display the optimal decisions by using the SUMMARY statement, or you
can plot the complete tree with the TREEPLOT statement. Finally, you can also
associate HTML pages with decision tree nodes and create Web-enabled decision
tree diagrams.
It is also possible to interactively modify some attributes of your model with the
MODIFY statement and to change the order of decisions by using the MOVE state-
ment. Before making any changes to the model, you should save the current model
with the SAVE statement so that you can call it back later by using the RECALL
statement. Questions about the value of perfect information or the value of perfect
control are answered using the VPI and VPC statements. Moreover, any options that
can be specied in the PROC DTREE statement can be reset at any time with the
RESET statement.
All statements can appear in any order and can be used as many times as desired
with one exception. The RECALL statement must be preceded by at least one SAVE
statement. In addition, only one model can be saved at any time; the SAVE statement
overwrites the previously saved model. Finally, you can use the QUIT statement to
stop processing and exit the procedure.
The DTREE procedure produces one output data set. The IMAGEMAP= data set
contains the outline coordinates for the nodes in the decision tree that can be used to
generate HTML MAP tags.
PROC DTREE uses the Output Delivery System (ODS), a SAS subsystem that pro-
vides capabilities for displaying and controlling the output from SAS procedures.
ODS enables you to convert any of the output from PROC DTREE into a SAS data
set. For further details, refer to the chapter on ODS in the SAS/STAT Users Guide.
Introductory Example
307
Getting Started
Introductory Example
A decision problem for an oil wildcatter illustrates the use of the DTREE procedure.
The oil wildcatter must decide whether or not to drill at a given site before his option
expires. He is uncertain about many things: the cost of drilling, the extent of the oil or
gas deposits at the site, and so on. Based on the reports of his technical staff, the hole
could be Dry with probability 0.5, Wet with probability 0.3, and Soaking
with probability 0.2. His monetary payoffs are given in the following table.
Table 3.1. Monetary Payoffs of Oil Wildcatters Problem
Drill Not Drill
Dry 0 0
Wet $700, 000 0
Soaking $1, 200, 000 0
The wildcatter also learned from the reports that the cost of drilling could be
$150, 000 with probability 0.2, $300, 000 with probability 0.6, and $500, 000 with
probability 0.2. He can gain further relevant information about the underlying geolog-
ical structure of this site by conducting seismic soundings. A cost control procedure
that can make the probabilities of the High cost outcomes smaller (and hence, the
probabilities of the Low cost outcomes larger) is also available. However, such
information and control are quite costly, about $60, 000 and $120, 000, respectively.
The wildcatter must also decide whether or not to take the sounding test or the cost
control program before he makes his nal decision: to drill or not to drill.
The oil wildcatter feels that he should structure and analyze his basic problem rst:
whether or not to drill. He builds a model that contains one decision stage named
Drill (with two outcomes, Drill and Not_Drill) and two chance
stages named Cost and Oil_Deposit. A representation of the model is
saved in three SAS data sets. In particular, the STAGEIN= data set can be saved as
follows:
/* -- create the STAGEIN= data set -- */
data Dtoils1;
format _STNAME_ $12. _STTYPE_ $2. _OUTCOM_ $10.
_SUCCES_ $12. ;
input _STNAME_ $ _STTYPE_ $ _OUTCOM_ $ _SUCCES_ $ ;
datalines;
Drill D Drill Cost
. . Not_Drill .
Cost C Low Oil_Deposit
. . Fair Oil_Deposit
. . High Oil_Deposit
Oil_Deposit C Dry .
. . Wet .
. . Soaking .
;
308
Chapter 3. The DTREE Procedure
The structure of the decision problem is given in the Dtoils1 data set. As you apply
this data set, you should be aware of the following points:
There is no reward variable in this data set; it is not necessary.
The ordering of the chance stages Cost and Oil_Deposit is arbitrary.
Missing values for the
SUCCES
OUTCOM
) is also missing.
The following PROBIN= data set contains the probabilities of events:
/* -- create the PROBIN= data set -- */
data Dtoilp1;
input _EVENT1 $ _PROB1 _EVENT2 $ _PROB2
_EVENT3 $ _PROB3 ;
datalines;
Low 0.2 Fair 0.6 High 0.2
Dry 0.5 Wet 0.3 Soaking 0.2
;
Notice that the sum of the probabilities of the events Low, Fair, and High
is 1.0. Similarly, the sum of the probabilities of the events Dry, Wet, and
Soaking is 1.0.
Finally, the following statements produce the PAYOFFS= data set that lists all possi-
ble scenarios and their associated payoffs.
/* -- create PAYOFFS= data set -- */
data Dtoilu1;
format _STATE1-_STATE3 $12. _VALUE_ dollar12.0;
input _STATE1 $ _STATE2 $ _STATE3 $ ;
/* determine the cost for this scenario */
if _STATE1=Low then _COST_=150000;
else if _STATE1=Fair then _COST_=300000;
else _COST_=500000;
/* determine the oil deposit and the */
/* corresponding net payoff for this scenario */
if _STATE2=Dry then _PAYOFF_=0;
else if _STATE2=Wet then _PAYOFF_=700000;
else _PAYOFF_=1200000;
/* calculate the net return for this scenario */
if _STATE3=Not_Drill then _VALUE_=0;
else _VALUE_=_PAYOFF_-_COST_;
Introductory Example
309
/* drop unneeded variables */
drop _COST_ _PAYOFF_;
datalines;
Low Dry Not_Drill
Low Dry Drill
Low Wet Not_Drill
Low Wet Drill
Low Soaking Not_Drill
Low Soaking Drill
Fair Dry Not_Drill
Fair Dry Drill
Fair Wet Not_Drill
Fair Wet Drill
Fair Soaking Not_Drill
Fair Soaking Drill
High Dry Not_Drill
High Dry Drill
High Wet Not_Drill
High Wet Drill
High Soaking Not_Drill
High Soaking Drill
;
This data set can be displayed, as shown in Figure 3.1, with the following PROC
PRINT statements:
/* -- print the payoff table -- */
title "Oil Wildcatters Problem";
title3 "The Payoffs";
proc print data=Dtoilu1;
run;
310
Chapter 3. The DTREE Procedure
Oil Wildcatters Problem
The Payoffs
Obs _STATE1 _STATE2 _STATE3 _VALUE_
1 Low Dry Not_Drill $0
2 Low Dry Drill $-150,000
3 Low Wet Not_Drill $0
4 Low Wet Drill $550,000
5 Low Soaking Not_Drill $0
6 Low Soaking Drill $1,050,000
7 Fair Dry Not_Drill $0
8 Fair Dry Drill $-300,000
9 Fair Wet Not_Drill $0
10 Fair Wet Drill $400,000
11 Fair Soaking Not_Drill $0
12 Fair Soaking Drill $900,000
13 High Dry Not_Drill $0
14 High Dry Drill $-500,000
15 High Wet Not_Drill $0
16 High Wet Drill $200,000
17 High Soaking Not_Drill $0
18 High Soaking Drill $700,000
Figure 3.1. Payoffs of the Oil Wildcatters Problem
The $550, 000 payoff associated with the scenario Low, Wet, and Drill is
a net gure; it represents a return of $700, 000 for a wet hole less the $150, 000 cost
for drilling. Similarly, the net return of the consequence associated with the scenario
High, Soaking, and Drill is $700, 000, which is interpreted as a return
of $1, 200, 000 less the $500, 000 High cost.
Now the wildcatter can invoke PROC DTREE to evaluate his model and to nd the
optimal decision using the following statements:
/* -- PROC DTREE statements -- */
title "Oil Wildcatters Problem";
proc dtree stagein=Dtoils1
probin=Dtoilp1
payoffs=Dtoilu1
nowarning;
evaluate / summary;
The following message, which notes the order of the stages, appears on the SAS log:
NOTE: Present order of stages:
Drill(D), Cost(C), Oil_Deposit(C), _ENDST_(E).
Introductory Example
311
Oil Wildcatters Problem
The DTREE Procedure
Optimal Decision Summary
Order of Stages
Stage Type
-----------------------
Drill Decision
Cost Chance
Oil_Deposit Chance
_ENDST_ End
Decision Parameters
Decision Criterion: Maximize Expected Value (MAXEV)
Optimal Decision Yields: $140,000
Optimal Decision Policy
Up to Stage Drill
Alternatives Cumulative Evaluating
or Outcomes Reward Value
------------------------------------------
Drill $140,000*
Not_Drill $0
Figure 3.2. Optimal Decision Summary of the Oil Wildcatters Problem
The SUMMARY option in the EVALUATE statement produces the optimal decision
summary shown in Figure 3.2.
The summary shows that the best action, in the sense of maximizing the expected
payoff, is to drill. The expected payoff for this optimal decision is $140, 000, as
shown on the summary.
Perhaps the best way to view the details of the results is to display the complete
decision tree. The following statement draws the decision tree, as shown in Figure
3.3, in line-printer format:
/* plot decision tree diagram in line-printer mode */
OPTIONS LINESIZE=100;
treeplot/ lineprinter;
312
Chapter 3. The DTREE Procedure
Oil Wildcatters Problem
The DTREE Procedure
Line-printer Plot
Dry
-----------------------E
| p=0.5 EV= $-150,000
Low | Wet
-----------------------C-|----------------------E
| p=0.2 EV= $300,000 | p=0.3 EV= $550,000
| | Soaking
| -----------------------E
| p=0.2 EV= $1,050,000
| Dry
| -----------------------E
| | p=0.5 EV= $-300,000
Drill | Fair | Wet
-======================C-|----------------------C-|----------------------E
| EV= $140,000 | p=0.6 EV= $150,000 | p=0.3 EV= $400,000
| | | Soaking
| | -----------------------E
| | p=0.2 EV= $900,000
| | Dry
----------------------D-| | -----------------------E
EV= $140,000 | | | p=0.5 EV= $-500,000
| | High | Wet
| -----------------------C-|----------------------E
| p=0.2 EV= $-50,000 | p=0.3 EV= $200,000
| | Soaking
| -----------------------E
| p=0.2 EV= $700,000
|Not_Drill
-----------------------E
EV= $0
Figure 3.3. The Decision Tree
Attitudes Toward Risk
Assume now that the oil wildcatter is constantly risk averse and has an exponential
utility function with a risk tolerance (RT) of $700, 000. The risk tolerance is a mea-
sure of the decision makers attitude to risk. See the Evaluation section beginning
on page 348 for descriptions of the utility function and risk tolerance.
The new optimal decision based on this utility function can be determined with the
following statement:
evaluate / criterion=maxce rt=700000 summary;
The summary, shown in Figure 3.4, indicates that the venture of investing in the oil
well is worth $-13, 580 to the wildcatter, and he should not drill the well.
Sensitivity Analysis and Value of Perfect Information
313
Oil Wildcatters Problem
The DTREE Procedure
Optimal Decision Summary
Order of Stages
Stage Type
-----------------------
Drill Decision
Cost Chance
Oil_Deposit Chance
_ENDST_ End
Decision Parameters
Decision Criterion: Maximize Certain Equivalent Value (MAXCE)
Risk Tolerance: $700,000
Optimal Decision Yields: $0
Optimal Decision Policy
Up to Stage Drill
Alternatives Cumulative Evaluating
or Outcomes Reward Value
------------------------------------------
Drill $-13,580
Not_Drill $0*
Figure 3.4. Summary of the Oil Wildcatters Problem with RT = $700,000
Sensitivity Analysis and Value of Perfect Information
The oil wildcatter learned that the optimal decision changed when his attitude toward
risk changed. Since risk attitude is difcult to express quantitatively, the oil wildcatter
wanted to learn more about the uncertainties in his problem. Before spending any
money on information-gathering procedures, he would like to know the benet of
knowing, before the Drill or Not_Drill decision, the amount of oil or the
cost of drilling. The simplest approach is to calculate the value of perfect information
for each uncertainty. This quantity gives an upper limit on the amount that could be
spent protably on information gathering. The expected value of information for the
amount of oil is calculated by the following statement:
vpi Oil_Deposit;
314
Chapter 3. The DTREE Procedure
The result of the previous statement is written to the SAS log as
NOTE: The currently optimal decision yields 140000.
NOTE: The new optimal decision yields 295000.
NOTE: The value of perfect information of stage Oil_Deposit
yields 155000.
This means that the wildcatter could spend up to $155, 000 to determine the amount
of oil in the deposit with certainty before losing money. There are several alterna-
tive ways to calculate the expected value of perfect information. For example, the
following statement
vpi Cost;
is equivalent to
save;
move Cost before Drill;
evaluate;
recall;
The messages, which appear on the SAS log, show that if there is some way that the
wildcatter knows what the cost to drill will be before his decision has to be made, it
will yield an expected payoff of $150, 000. So, the expected value of perfect infor-
mation about drilling cost is $150, 000 - $140, 000 = $10, 000.
NOTE: The current problem has been successfully saved.
NOTE: Present order of stages:
Cost(C), Drill(D), Oil_Deposit(C), _ENDST_(E).
NOTE: The currently optimal decision yields 150000.
NOTE: The original problem has been successfully recalled.
NOTE: Present order of stages:
Drill(D), Cost(C), Oil_Deposit(C), _ENDST_(E).
Value of Perfect Control
The oil wildcatter may also want to know what the value of perfect control (VPC)
is on the cost of drilling. That is, how much is he willing to pay for getting com-
plete control on the drilling cost? This analysis can be performed with the following
statement:
vpc Cost;
Oil Wildcatters Problem with Sounding Test
315
The result is written to the SAS log as
NOTE: The currently optimal decision yields 140000.
NOTE: The new optimal decision yields 300000.
NOTE: The value of perfect control of stage Cost
yields 160000.
Oil Wildcatters Problem with Sounding Test
The wildcatter is impressed with the results of calculating the values of perfect
information and perfect control. After comparing those values with the costs of
the sounding test and the cost-controlling procedure, he prefers to spend $60, 000
on sounding test, which has a potential improvement of $155, 000. He is informed
that the sounding will disclose whether the terrain below has no structure (which is
bad), open structure (which is okay), or closed structure (which is really hopeful).
The expert also provides him with the following table, which shows the conditional
probabilities.
Table 3.2. Conditional Probabilities of Oil Wildcatters Problem
Seismic Outcomes
State No Structure Open Structure Closed Structure
Dry 0.6 0.3 0.1
Wet 0.3 0.4 0.3
Soaking 0.1 0.4 0.5
To include this additional information into his basic problem, the wildcatter needs to
add two stages to his model: a decision stage to represent the decision whether or not
to take the sounding test, and one chance stage to represent the uncertain test result.
The new STAGEIN= data set is
/* -- create the STAGEIN= data set -- */
data Dtoils2;
format _STNAME_ $12. _STTYPE_ $2. _OUTCOM_ $14.
_SUCCES_ $12. _REWARD_ dollar12.0;
input _STNAME_ & _STTYPE_ & _OUTCOM_ &
_SUCCES_ & _REWARD_ dollar12.0;
datalines;
Drill D Drill Cost .
. . Not_Drill . .
Cost C Low Oil_Deposit .
. . Fair Oil_Deposit .
. . High Oil_Deposit .
Oil_Deposit C Dry . .
. . Wet . .
. . Soaking . .
Sounding D Noseismic Drill .
. . Seismic Structure -$60,000
Structure C No_Struct Drill .
316
Chapter 3. The DTREE Procedure
. . Open_Struct Drill .
. . Closed_Struct Drill .
;
Note that the cost for the seismic soundings is represented as negative reward (of the
outcome Seismic) in this data set. The conditional probabilities for stage Structure
are added to the PROBIN= data set as follows:
/* -- create PROBIN= data set -- */
data Dtoilp2;
format _EVENT1 $10. _EVENT2 $12. _EVENT3 $14. ;
input _GIVEN_ $ _EVENT1 $ _PROB1
_EVENT2 $ _PROB2 _EVENT3 $ _PROB3;
datalines;
. Low 0.2 Fair 0.6 High 0.2
. Dry 0.5 Wet 0.3 Soaking 0.2
Dry No_Struct 0.6 Open_Struct 0.3 Closed_Struct 0.1
Wet No_Struct 0.3 Open_Struct 0.4 Closed_Struct 0.3
Soaking No_Struct 0.1 Open_Struct 0.4 Closed_Struct 0.5
;
It is not necessary to make any change to the PAYOFFS= data set. To evaluate his
new model, the wildcatter invokes PROC DTREE as follows:
/* -- PROC DTREE statements -- */
title "Oil Wildcatters Problem";
proc dtree stagein=Dtoils2
probin=Dtoilp2
payoffs=Dtoilu1
nowarning;
evaluate;
As before, the following messages are written to the SAS log:
NOTE: Present order of stages:
Sounding(D), Structure(C), Drill(D), Cost(C),
Oil_Deposit(C), _ENDST_(E).
NOTE: The currently optimal decision yields 140000.
The following SUMMARY statements produce optimal decision summary as shown
in Figure 3.5 and Figure 3.6:
summary / target=Sounding;
summary / target=Drill;
Oil Wildcatters Problem with Sounding Test
317
The optimal strategy for the oil-drilling problem is found to be the following:
No soundings test should be taken, and always drill. This alternative has an
expected payoff of $140, 000.
If the soundings test is conducted, then drill unless the test shows the terrain
below has no structure.
The soundings test is worth $180, 100 - $140, 000 = $40, 100 (this quantity is
also called the value of imperfect information or the value of sample informa-
tion), but it costs $60, 000; therefore, it should not be taken.
Oil Wildcatters Problem
The DTREE Procedure
Optimal Decision Summary
Order of Stages
Stage Type
-----------------------
Sounding Decision
Structure Chance
Drill Decision
Cost Chance
Oil_Deposit Chance
_ENDST_ End
Decision Parameters
Decision Criterion: Maximize Expected Value (MAXEV)
Optimal Decision Yields: $140,000
Optimal Decision Policy
Up to Stage Sounding
Alternatives Cumulative Evaluating
or Outcomes Reward Value
-------------------------------------------
Noseismic 0 $140,000*
Seismic -60000 $180,100
Figure 3.5. Summary of the Oil Wildcatters Problem for SOUNDING
318
Chapter 3. The DTREE Procedure
Oil Wildcatters Problem
The DTREE Procedure
Optimal Decision Summary
Order of Stages
Stage Type
-----------------------
Sounding Decision
Structure Chance
Drill Decision
Cost Chance
Oil_Deposit Chance
_ENDST_ End
Decision Parameters
Decision Criterion: Maximize Expected Value (MAXEV)
Optimal Decision Yields: $140,000
Optimal Decision Policy
Up to Stage Drill
Cumulative Evaluating
Alternatives or Outcomes Reward Value
-----------------------------------------------------------------------------
Noseismic Drill 0 $140,000*
Noseismic Not_Drill 0 $0
Seismic No_Struct Drill -60000 $-97,805
Seismic No_Struct Not_Drill -60000 $0*
Seismic Open_Struct Drill -60000 $204,286*
Seismic Open_Struct Not_Drill -60000 $0
Seismic Closed_Struct Drill -60000 $452,500*
Seismic Closed_Struct Not_Drill -60000 $0
Figure 3.6. Summary of the Oil Wildcatters Problem for DRILL
Note that the value of sample information also can be obtained by using the following
statements:
modify Seismic reward 0;
evaluate;
The following messages, which appear in the SAS log, show the expected payoff with
soundings test is $180, 100. Recall that the expected value without test information
is $140, 000. Again, following the previous calculation, the value of test information
is $180, 100 - $140, 000 = $40, 100.
NOTE: The reward of outcome Seismic has been changed to 0.
NOTE: The currently optimal decision yields 180100.
Now, the wildcatter has the information to make his best decision.
Syntax
319
Syntax
The following statements are available in PROC DTREE:
PROC DTREE options ;
EVALUATE / options ;
MODIFY specications ;
MOVE specications ;
QUIT ;
RECALL ;
RESET options ;
SAVE ;
SUMMARY / options ;
TREEPLOT / options ;
VARIABLES / options ;
VPC specications ;
VPI specications ;
The DTREE procedure begins with the PROC DTREE statement and terminates with
the QUIT statement. The VARIABLES statement can be used only once, and if it
is used, it must appear before any other statements. The EVALUATE, MODIFY,
MOVE, RECALL, RESET, SAVE, SUMMARY, TREEPLOT, VPC, and VPI state-
ments can be listed in any order and can be used as many times as desired with one
exception: the RECALL statement must be preceded by at least one SAVE statement.
You can also submit any other valid SAS statements, for example, OPTIONS, TITLE,
and SAS/GRAPH global statements. In particular, the SAS/GRAPH statements that
can be used to enhance the DTREE procedures output on graphics devices are listed
in Table 3.3. Note that the DTREE procedure is not supported with the ActiveX or
Java series of devices on the GOPTIONS statement. Refer to SAS/GRAPH Software:
Reference for more explanation of these statements.
Table 3.3. Statements to Enhance Graphics Output
Statement Function
FOOTNOTE Produce footnotes that are displayed on the graphics output
GOPTIONS Dene default values for graphics options
NOTE Produce text that is displayed on the graphics output
SYMBOL Create symbol denitions
TITLE Produce titles that are displayed on the graphics output
320
Chapter 3. The DTREE Procedure
Functional Summary
The following tables outline the options available for the DTREE procedure classied
by function.
Table 3.4. Accuracy Control Options
Description Statement(s) Option
accuracy of numerical computation DTREE, RESET TOLERANCE=
Table 3.5. Data Set Specications
Description Statement(s) Option
Annotate data set DTREE, RESET, TREEPLOT ANNOTATE=
Image map output data set DTREE, RESET, TREEPLOT IMAGEMAP=
Payoffs data set DTREE PAYOFFS=
Probability data set DTREE PROBIN=
Stage data set DTREE STAGEIN=
Table 3.6. Error Handling Options
Description Statement(s) Option
automatically rescale the probabilities of an
uncertainty if they do not sum to 1
DTREE, RESET AUTOSCALE
react to errors being detected DTREE, RESET ERRHANDLE=
do not automatically rescale probabilities DTREE, RESET NOSCALE
do not display warning message DTREE, RESET NOWARNING
display warning message DTREE, RESET WARNING
Table 3.7. Evaluation Control Options
Description Statement(s) Option
criterion to determine the optimal decision DTREE, EVALUATE, RESET CRITERION=
risk tolerance DTREE, EVALUATE, RESET RT=
Table 3.8. Format Control Options
Description Statement(s) Option
maximum decimal width to format
numerical values
DTREE, EVALUATE, RESET,
SUMMARY, TREEPLOT
MAXPREC=
maximum eld width to format
numerical values
DTREE, EVALUATE, RESET,
SUMMARY, TREEPLOT
MAXWIDTH=
maximum eld width to format names DTREE, EVALUATE, RESET,
SUMMARY, TREEPLOT
NWIDTH=
Table 3.9. Graphics Catalog Options
Description Statement(s) Option
description eld for catalog entry DTREE, RESET, TREEPLOT DESCRIPTION=
name of graphics catalog DTREE, RESET, TREEPLOT GOUT=
name eld for catalog entry DTREE, RESET, TREEPLOT NAME=
Table 3.10. Line-printer Options
Description Statement(s) Option
characters for line-printer plot DTREE, RESET, TREEPLOT FORMCHAR=
Functional Summary
321
Table 3.11. Link Appearance Options
Description Statement(s) Option
color of LOD
1
DTREE, RESET, TREEPLOT CBEST=
color of all links except LOD
1
DTREE, RESET, TREEPLOT CLINK=
symbol denition for all links except LOD
1
and LCP
2
DTREE, RESET, TREEPLOT LINKA=
symbol denition for LOD
1
DTREE, RESET, TREEPLOT LINKB=
symbol denition for LCP
2
DTREE, RESET, TREEPLOT LINKC=
line type of all links except LOD
1
and
LCP
2
DTREE, RESET, TREEPLOT LSTYLE=
line type of LOD
1
DTREE, RESET, TREEPLOT LSTYLEB=
line type of LCP
2
DTREE, RESET, TREEPLOT LSTYLEC=
line thickness of all links except LOD
1
DTREE, RESET, TREEPLOT LWIDTH=
line thickness of LOD
1
DTREE, RESET, TREEPLOT LWIDTHB=
1
LOD denotes links that indicate optimal decisions.
2
LCP denotes links that continue on subsequent pages.
Table 3.12. Node Appearance Options
Description Statement(s) Option
color of chance nodes DTREE, RESET, TREEPLOT CSYMBOLC=
color of decision nodes DTREE, RESET, TREEPLOT CSYMBOLD=
color of end nodes DTREE, RESET, TREEPLOT CSYMBOLE=
height of symbols for all nodes DTREE, RESET, TREEPLOT HSYMBOL=
symbol denition for chance nodes DTREE, RESET, TREEPLOT SYMBOLC=
symbol denition for decision nodes DTREE, RESET, TREEPLOT SYMBOLD=
symbol denition for end nodes DTREE, RESET, TREEPLOT SYMBOLE=
symbol to draw chance nodes DTREE, RESET, TREEPLOT VSYMBOLC=
symbol to draw decision nodes DTREE, RESET, TREEPLOT VSYMBOLD=
symbol to draw end nodes DTREE, RESET, TREEPLOT VSYMBOLE=
Table 3.13. Output Control Options
Description Statement(s) Option
suppress displaying the optimal decision
summary
DTREE, EVALUATE, RESET NOSUMMARY
display the optimal decision summary DTREE, EVALUATE, RESET SUMMARY
decision stage up to which the optimal de-
cision summary is displayed
DTREE, EVALUATE, RESET,
SUMMARY
TARGET=
322
Chapter 3. The DTREE Procedure
Table 3.14. Plot Control Options
Description Statement(s) Option
drawdiagramon one page in graphics mode DTREE, RESET, TREEPLOT COMPRESS
information are displayed on the decision
tree diagram
DTREE, RESET, TREEPLOT DISPLAY=
processing of the Annotate data set DTREE, RESET, TREEPLOT DOANNOTATE
invoke graphics version DTREE, RESET, TREEPLOT GRAPHICS
display labels DTREE, RESET, TREEPLOT LABEL
display legend DTREE, RESET, TREEPLOT LEGEND
invoke line-printer version DTREE, RESET, TREEPLOT LINEPRINTER
suppress processing of the Annotate data
set
DTREE, RESET, TREEPLOT NOANNOTATE
draw diagram across multiple pages DTREE, RESET, TREEPLOT NOCOMPRESS
suppress displaying label DTREE, RESET, TREEPLOT NOLABEL
suppress displaying legend DTREE, RESET, TREEPLOT NOLEGEND
suppress displaying page number DTREE, RESET, TREEPLOT NOPAGENUM
use rectangular corners for turns in the links DTREE, RESET, TREEPLOT NORC
display page number at upper right corner DTREE, RESET, TREEPLOT PAGENUM
use rounded corners for turns in the links DTREE, RESET, TREEPLOT RC
vertical space between two end nodes DTREE, RESET, TREEPLOT YBETWEEN=
Table 3.15. Text Appearance Options
Description Statement(s) Option
text color DTREE, RESET, TREEPLOT CTEXT=
text font DTREE, RESET, TREEPLOT FTEXT=
text height DTREE, RESET, TREEPLOT HTEXT=
Table 3.16. Variables in PAYOFFS= Data Set
Description Statement(s) Option
action outcome names VARIABLES ACTION=
state outcome names VARIABLES STATE=
payoffs VARIABLES VALUE=
Table 3.17. Variables in PROBIN= Data Set
Description Statement(s) Option
event outcome names VARIABLES EVENT=
given outcome names VARIABLES GIVEN=
(conditional) probabilities VARIABLES PROB=
Table 3.18. Variables in STAGEIN= Data Set
Description Statement(s) Option
outcome names VARIABLES OUTCOME=
rewards VARIABLES REWARD=
stage name VARIABLES STAGE=
successor names VARIABLES SUCCESSOR=
type of stage VARIABLES TYPE=
web reference variable VARIABLES WEB=
PROC DTREE Statement
323
PROC DTREE Statement
PROC DTREE options ;
The options that can appear in the PROC DTREE statement are listed in the following
section. The options specied in the PROC DTREE statement remain in effect for all
statements until the end of processing or until they are changed by a RESET state-
ment. These options are classied under appropriate headings: rst, all options that
are valid for all modes of the procedure are listed followed by the options classied
according to the mode (line-printer or graphics) of invocation of the procedure.
General Options
AUTOSCALE | NOSCALE
species whether the procedure should rescale the probabilities of events for a given
chance stage if the total probability of this stage is not equal to 1. The default is
NOSCALE.
CRITERION=i
indicates the decision criterion to be used for determining the optimal decision and
the certain equivalent for replacing uncertainties. The following table shows all valid
values of i and their corresponding decision criteria and certain equivalents.
Table 3.19. Values for the CRITERION= Option
i Criterion Certain Equivalent
MAXEV maximize expected value
MINEV minimize expected value
MAXMLV maximize value with largest probability
MINMLV minimize value with largest probability
MAXCE maximize certain equivalent value of expected utility
MINCE minimize certain equivalent value of expected utility
The default value is MAXEV. The last two criteria are used when your utility curve
can be t by an exponential function. See the Evaluation section beginning on page
348 for more information on the exponential utility function.
DISPLAY=(information-list)
species information that should be displayed on each link of the decision tree dia-
gram. Table 3.20 lists the valid keywords and corresponding information.
Table 3.20. Information on Decision Tree and Keywords
Keyword Information
ALL all information listed in this table
CR cumulative rewards of outcomes on the path that leads to the successor
of the link
EV evaluating value that can be expected from the successor of the link
LINK outcome name represented by the link
P probability of the outcome represented by the link
R instant reward of the outcome represented by the link
STAGE stage name of the successor of the link
324
Chapter 3. The DTREE Procedure
The default value is (LINK P EV R CR).
Note that the probability information displays on links that represent chance out-
comes only. In addition, the PROBIN= option must be specied. The expected values
display only if the decision tree has been evaluated. The reward information displays
on a link only if the instant reward of the outcome represented by the link is nonzero.
The cumulative rewards do not display if the cumulative rewards of links are all zero.
ERRHANDLE=DRAIN | QUIT
species whether the procedure should stop processing the current statement and
wait for next statement or quit PROC DTREE when an error has been detected by the
procedure. The default value is DRAIN.
GRAPHICS
creates plots for a graphics device. To specify this option, you need to have
SAS/GRAPH software licensed at your site. This is the default.
LABEL | NOLABEL
species whether the labels for information displayed on the decision tree diagram
should be displayed. If the NOLABEL option is not specied, the procedure uses the
following symbols to label all the information that is displayed on each link.
Table 3.21. Labels and Their Corresponding Information
Label Information
cr= the cumulative rewards of outcomes on the path that lead to the
successor of the link
EV= the value that can be expected from the successor of the link
p= the probability of the outcome represented by the link
r= the instant reward of the outcome
The default is LABEL.
LINEPRINTER
LP
creates plots of line-printer quality. If you do not specify this option, graphics plots
are produced.
MAXPREC=d
species the maximum decimal width (the precision) in which to format numerical
values using w.d format. This option is used in displaying the decision tree diagrams
and the summaries. The value for this option must be no greater than 9; the default
value is 3.
MAXWIDTH=mw
species the maximum eld width in which to format numerical values (probabilities,
rewards, cumulative rewards and evaluating values) using w.d format. This option
is used in displaying the decision tree diagrams and the summaries. The value for
this option must be no greater than 16 and must be at least 5 plus the value of the
MAXPREC= option. The default value is 10.
PROC DTREE Statement
325
NWIDTH=nw
species the maximum eld width in which to format outcome names when display-
ing the decision tree diagrams. The value for this option must be no greater than 40;
the default value is 32.
PAYOFFS=SAS-data-set
names the SAS data set that contains the evaluating values (payoffs, losses, utilities,
and so on) for each state and action combination. The use of PAYOFFS= is optional
in the PROC DTREE statement. If the PAYOFFS= option is not used, PROC DTREE
assumes that all evaluating values at the end nodes of the decision tree are 0.
PROBIN=SAS-data-set
names the SAS data set that contains the (conditional) probability specications of
outcomes. The PROBIN= SAS data set is required if the evaluation of the decision
tree is desired.
RT=r
species the value of the risk tolerance. The RT= option is used only when
CRITERION=MAXCE or CRITERION=MINCE is specied. If the RT= option
is not specied, and CRITERION=MAXCE or CRITERION=MINCE is specied,
PROCDTREE changes the value of the CRITERION= option to MAXEVor MINEV
(which would mean straight-line utility function and imply innite risk tolerance).
STAGEIN=SAS-data-set
names the SAS data set that contains the stage names, stage types, names of out-
comes, and their rewards and successors for each stage. If the STAGEIN= option is
not specied, PROC DTREE uses the most recently created SAS data set.
SUMMARY | NOSUMMARY
species whether an optimal decision summary should be displayed each time the
decision tree is evaluated. The decision summary lists all paths through the tree that
lead to the target stage as well as the cumulative rewards and the evaluating values of
all alternatives for that path. The alternative with optimal evaluating value for each
path is marked with an asterisk (*). The default is NOSUMMARY.
TARGET=stage
species the decision stage up to which the optimal decision policy table is displayed.
The TARGET= option is used only in conjunction with the SUMMARY option. The
stage specied must be a decision stage. If the TARGET= option is not specied, the
procedure displays an optimal decision policy table for each decision stage.
TOLERANCE=d
species either a positive number close to 0 or greater than 1. PROC DTREE treats
all numbers within e of 0 as 0, where
e =
d if d < 1
d otherwise
and is the machine epsilon. The default value is 1, 000.
326
Chapter 3. The DTREE Procedure
WARNING | NOWARNING
species whether the procedure should display a warning message when
the payoff for an outcome is not assigned in the PAYOFFS= data set
probabilities of events for a given chance stage have been automatically scaled
by PROC DTREE because the total probability of the chance stage does not
equal 1
The default is WARNING.
YBETWEEN=ybetween <units>
species the vertical distance between two successive end nodes. If the GRAPHICS
option is specied, the valid values for the optional units are listed in Table 3.22.
Table 3.22. Valid Values for the Units of the YBETWEEN= Option
Unit Description
CELL character cells
CM centimeters
INCH inches
PCT percentage of the graphics output area
SPACE height of the box surrounding the node, its predecessor link, and
all text information
The value of the YBETWEEN= option must be greater than or equal to 0. Note that
if the COMPRESS option is specied, the actual distance between two successive
end nodes is scaled by PROC DTREE and may not be the same as the YBETWEEN=
specication.
If the LINEPRINTER option is specied, the optional units value can be CELL or
SPACE. The value of the YBETWEEN= option must be a nonnegative integer.
If you do not specify units, a unit specication is determined in the following order:
the GUNIT= option in a GOPTIONS statement, if the GRAPHICS option is
specied
the default unit, CELL
The default value of YBETWEEN= option is 0.
Graphics Options
The following options are specically for the purpose of producing a high-resolution
quality decision tree diagram.
PROC DTREE Statement
327
ANNOTATE=SAS-data-set
ANNO=SAS-data-set
species an input data set that contains appropriate Annotate variables. The
ANNOTATE= option enables you to add features (for example, customized legend)
to plots produced on graphics devices. For additional information, refer to the chapter
on the annotate data set in SAS/GRAPH Software: Reference.
CBEST=color
CB=color
species the color for all links in the decision tree diagram that represent optimal
decisions. If you do not specify the CBEST= option, the color specication is deter-
mined in the following order:
the CI= option in the jth generated SYMBOL denition, if the option LINKB=j
is specied
the second color in the colors list
CLINK=color
CL=color
species the color for all links in the decision tree diagram except those that represent
optimal decisions. If the CLINK= option is not specied, the color specication is
determined in the following order:
the CI= option in the ith generated SYMBOL denition, if the option LINKA=i
is specied
the third color in the colors list
COMPRESS | NOCOMPRESS
CP | NOCP
species whether the decision tree diagram should be drawn on one physical page.
If the COMPRESS option is specied, PROC DTREE determines the scale so that
the diagram is compressed, if necessary, to t on one physical page. Otherwise,
the procedure draws the diagram across multiple pages if necessary. The default is
NOCOMPRESS.
CSYMBOLC=color
CC=color
species the color of the symbol used to draw all chance nodes in the decision tree
diagram. If the CSYMBOLC= option is not specied, the color specication is de-
termined in the following order:
the CV= option in the mth generated SYMBOL denition, if the option
SYMBOLC=m is specied
the CSYMBOL= option in a GOPTIONS statement
the fth color in the colors list
328
Chapter 3. The DTREE Procedure
CSYMBOLD=color
CD=color
species the color of the symbol used to draw all decision nodes in the decision
tree diagram. If the CSYMBOLD= option is not specied, the color specication is
determined in the following order:
the CV= option in the dth generated SYMBOL denition, if the option
SYMBOLD=d is specied
the CSYMBOL= option in a GOPTIONS statement
the fourth color in the colors list
CSYMBOLE=color
CE=color
species the color of the symbol used to draw all end nodes in the decision tree
diagram. If the CSYMBOLE= option is not specied, the color specication is de-
termined in the following order:
the CV= option in the nth generated SYMBOL denition, if the option
SYMBOLE=n is specied
the CSYMBOL= option in a GOPTIONS statement
the sixth color in the colors list
CTEXT=color
CT=color
species the color to be used for all text that appears on plots except on TITLE and
FOOTNOTE lines. If the CTEXT= option is not specied, the color specication is
determined in the following order:
the CTEXT= option in a GOPTIONS statement
the rst color in the colors list
DESCRIPTION=string
DES=string
species a descriptive string, up to 40 characters long, that appears in the descrip-
tion eld of the master menu of PROC GREPLAY. If the DESCRIPTION= option is
omitted, the description eld contains a description assigned by PROC DTREE.
DOANNOTATE | NOANNOTATE
DOANNO | NOANNO
species whether the Annotate data set should be processed. If the NOANNOTATE
option is specied, the procedure does not process the Annotate data set even though
the ANNOTATE= option is specied. The default is DOANNOTATE.
PROC DTREE Statement
329
FTEXT=name
FONT=name
species the font to be used for text on plots. If you do not use this option, the font
specication is determined in the following order:
the FTEXT= option in a GOPTIONS statement
the hardware font for your graphics output device
Refer to the chapter on SAS/GRAPH fonts in SAS/GRAPH Software: Reference for
details about SAS/GRAPH fonts.
GOUT=SAS-catalog
species the name of the graphics catalog used to save the output produced by PROC
DTREE for later replay. For additional information, refer to the chapter on graphics
output in SAS/GRAPH Software: Reference.
HSYMBOL=h
HS=h
species that the height of symbols for all nodes in the decision tree diagram is h
times the heights of symbols assigned by SAS/GRAPH software. You can specify
the heights of decision nodes, chance nodes, and end nodes by using the HEIGHT=
options in the corresponding SYMBOL statements. For example, if you specify the
options HSYMBOL=2 and SYMBOLD=1 in the PROC DTREE statement and de-
ned SYMBOL1 as
symbol1 height=4 pct;
then all decision nodes in the decision tree diagram are sized at 2 4 = 8% of the
graphics output area. The default value is 1.
HTEXT=h
HT=h
species that the height for all text in plots (except that in TITLE and FOOTNOTE
statements) be h times the height of the characters assigned by SAS/GRAPH soft-
ware. You can also specify character height by using the HTEXT= option in a
GOPTIONS statement.
For example, if you specify the option HTEXT=0.6 in the PROC DTREE statement
and also specied a GOPTIONS statement as follows
goptions htext=2 in;
then the size of all text is 0.6 2 = 1.2 inches. For more explanation of
the GOPTIONS statement, refer to the chapter on the GOPTIONS statement in
SAS/GRAPH Software: Reference. The default value is 1.
330
Chapter 3. The DTREE Procedure
IMAGEMAP=SAS-data-set
names the SAS data set that receives a description of the areas of a graph and a link
for each area. This information is for the construction of HTML image maps. You use
a SAS DATA step to process the output le and generate your own HTML les. The
graph areas correspond to the link information that comes from the WEB= variable
in the STAGEIN= data set. This gives you complete control over the appearance and
structure of your HTML pages.
LEGEND | NOLEGEND
LG | NOLG
species whether the default legend should be displayed. If the NOLEGEND is not
specied, the procedure displays a legend at the end of each page of the decision tree
diagram. The default is LEGEND.
LINKA=i
If the LINKA=i option is specied, then PROC DTREE uses the color specied with
the CI= option, the type specied with the LINE= option, and the thickness specied
with the WIDTH= option in the ith generated SYMBOL denition to draw all links
in the decision tree diagram, except those that indicate optimal decisions and those
that are continued on subsequent pages. There is no default value for this option. The
color, type, and thickness specications may be overridden by the specications of
the CLINK=, LSTYLE=, and LWIDTH= options in the PROC DTREE statement.
Note that if you specify the LINKA=i option, PROC DTREE uses the specications
in the ith generated SYMBOL denition and not the specications in the SYMBOLi
statement. Refer to SAS/GRAPH Software: Reference for the details about creating,
canceling, reviewing, and altering SYMBOL denitions.
LINKB=j
If the LINKB=j option is specied, then PROC DTREE uses the color specied with
the CI= option, the type specied with the LINE= option, and the thickness speci-
ed with the WIDTH= option in the jth generated SYMBOL denition to draw all
links that represent optimal decisions. There is no default value for this option. The
color, type, and thickness specications may be overridden by the specications of
the CBEST=, LSTYLEB=, and LWIDTHB= options in the PROC DTREE statement.
Note that if you specify the LINKB=j option, PROC DTREE uses the specications
in the jth generated SYMBOL denition and not the specications in the SYMBOLj
statement. Refer to SAS/GRAPH Software: Reference for the details about creating,
canceling, reviewing, and altering SYMBOL denitions.
LINKC=k
If the LINKC=k option is specied, then PROC DTREE uses the type specied with
the LINE= option in the kth generated SYMBOL denition to draw all links in the
decision tree diagram that are continued on subsequent pages. There is no default
value for this option. The color and thickness for links continued on another page
indicate whether the link represents an optimal decision or not. The type specica-
tion may be overridden by the specication of the LSTYLEC= option in the PROC
DTREE statement.
PROC DTREE Statement
331
Note that if you specify the LINKC=k option, PROC DTREE uses the specications
in the kth generated SYMBOL denition and not the specications in the SYMBOLk
statement. Refer to SAS/GRAPH Software: Reference for the details about creating,
canceling, reviewing, and altering SYMBOL denitions.
LSTYLE=l
L=l
species the line type (style) used for drawing all links in the decision tree diagram,
except those that represent the optimal decisions and those that are continued on
subsequent pages. Valid values for l are 1 though 46. If the LSTYLE= option is not
specied, the type specication is determined in the following order:
the LINE= option in the ith generated SYMBOL denition, if the option
LINKA=i is specied
the default value, 1 (solid line)
LSTYLEB=l2
LB=l2
species the line type (style) used for drawing the links in the decision tree dia-
gram that represent optimal decisions. Valid values for l2 are 1 though 46. If the
LSTYLEB= option is not specied, the type specication is determined in the fol-
lowing order:
the LINE= option in the jth generated SYMBOL denition, if the option
LINKB=j is specied
the default value, 1 (solid line)
LSTYLEC=l3
LC=l3
species the line type (style) used for drawing the links in the decision tree diagram
that are continued on the next subsequent pages. Valid values for l3 are 1 though 46.
If the LSTYLEC= option is not specied, the type specication is determined in the
following order:
the LINE= option in the kth generated SYMBOL denition, if the option
LINKC=k is specied
the default value, 2 (dot line)
LWIDTH=w
LTHICK=w
species the line thickness (width) used to draw all links in the decision tree diagram
except those that represent the optimal decisions.
332
Chapter 3. The DTREE Procedure
If the LWIDTH= option is not specied, the thickness specication is determined in
the following order:
the WIDTH= option in the ith generated SYMBOL denition, if the option
LINKA=i is specied
the default value, 1
LWIDTHB=w2
LTHICKB=w2
species the line thickness (width) used to draw the links in the decision tree dia-
gram that represent optimal decisions. If the LWIDTHB= option is not specied, the
thickness specication is determined in the following order:
the WIDTH= option in the jth generated SYMBOL denition, if the option
LINKB=j is specied
2 times the thickness for links that represent regular outcomes
NAME=string
species a descriptive string, up to 8 characters long, that appears in the name eld
of the master menu of PROC GREPLAY. The default is DTREE .
PAGENUM | NOPAGENUM
PAGENUMBER | NOPAGENUMBER
species whether the page numbers should be displayed in the top right corner of each
page of a multipage decision tree diagram. If the NOPAGENUM is not specied, the
pages are ordered from top to bottom, left to right.
The default is PAGENUM.
RC | NORC
species whether the links in the decision tree diagram should be drawn with rounded
corners or with rectangular corners. The default is RC.
SYMBOLC=m
SYMBC=m
If the SYMBOLC= option is specied, then PROC DTREE uses the color specied
with the CV= option, the character specied with the VALUE= option, the font spec-
ied with the FONT= option, and the height specied with the HEIGHT= option
in the mth generated SYMBOL denition to draw all chance nodes in the decision
tree diagram. There is no default value for this option. The color and the sym-
bol specications may be overridden by the specication of the CSYMBOLC= and
VSYMBOLC= options in the PROC DTREE statement. The height of the symbol
can be changed by the HSYMBOL= option in the PROC DTREE statement.
Note that if you specify the SYMBOLC=m option, PROC DTREE uses the speci-
cations in the mth generated SYMBOL denition and not the specications in the
SYMBOLm statement. Refer to SAS/GRAPH Software: Reference for the details
about creating, canceling, reviewing, and altering SYMBOL denitions.
PROC DTREE Statement
333
SYMBOLD=d
SYMBD=d
If the SYMBOLD= option is specied, then PROC DTREE uses the color specied
with the CV= option, the character specied with the VALUE= option, the font spec-
ied with the FONT= option, and the height specied with the HEIGHT= option
in the dth generated SYMBOL denition to draw all decision nodes in the decision
tree diagram. There is no default value for this option. The color and the sym-
bol specications may be overridden by the specication of the CSYMBOLD= and
VSYMBOLD= options in the PROC DTREE statement. The height of the characters
can be changed by the HSYMBOL= option in the PROC DTREE statement.
Note that if you specify the SYMBOLD=d option, PROC DTREE uses the speci-
cations in the dth generated SYMBOL denition and not the specications in the
SYMBOLd statement. Refer to SAS/GRAPH Software: Reference for the details
about creating, canceling, reviewing, and altering SYMBOL denitions.
SYMBOLE=n
SYMBE=n
If the SYMBOLE= option is specied, then PROC DTREE uses the color specied
with the CV= option, the character specied with the VALUE= option, the font speci-
ed with the FONT= option, and the height specied with the HEIGHT= option in the
nth generated SYMBOL denition to draw all end nodes in the decision tree diagram.
There is no default value for this option. The color and the symbol specications
may be overridden by the specication of the CSYMBOLE= and VSYMBOLE= op-
tions specied in the PROC DTREE statement. The height of the characters can be
changed by the HSYMBOL= option in the PROC DTREE statement.
Note that if you specify the SYMBOLE=n option, PROC DTREE uses the speci-
cations in the nth generated SYMBOL denition and not the specications in the
SYMBOLn statement. Refer to SAS/GRAPH Software: Reference for the details
about creating, canceling, reviewing, and altering SYMBOL denitions.
VSYMBOLC=symbolc-name
VC=symbolc-name
species that the symbol symbolc-name from the special symbol table be used to
draw all chance nodes in the decision tree diagram. If you do not specify this option,
the symbol used is determined in the following order:
the options VALUE= and FONT= specications in the mth generated
SYMBOL denition, if the option SYMBOLC=m is specied
the symbol CIRCLE in the special symbol table
VSYMBOLD=symbold-name
VD=symbold-name
species that the symbol symbold-name from the special symbol table be used to
draw all decision nodes in the decision tree diagram. If you do not specify this option,
the symbol used is determined in the following order:
334
Chapter 3. The DTREE Procedure
the options VALUE= and FONT= specications in the dth generated SYMBOL
denition, if the option SYMBOLD=d is specied
the symbol SQUARE in the special symbol table
VSYMBOLE=symbole-name
VE=symbole-name
species that the symbol symbole-name from the special symbol table be used to
draw all end nodes in the decision tree diagram. If you do not specify this option, the
symbol used is determined in the following order:
the options VALUE= and FONT= specications in the nth generated SYMBOL
denition, if the option SYMBOLE=n is specied
the symbol DOT in the special symbol table
Line-Printer Options
The following options are specically for the purpose of producing line-printer qual-
ity decision tree diagram.
FORMCHAR<(syni-list)>= formchar-string
denes characters to be used for features on line-printer plots. The syni-list is a list of
numbers ranging from 1 to 13. The list identies which features are controlled with
the string characters. The formchar-string gives characters for features in syni-list .
Any character or hexadecimal string can be used. By default, syni-list is omitted, and
the FORMCHAR= option gives a string for all 13 features. The features associated
with values of syni are listed in Table 3.23. Note that characters 4, 6, 7, 10, and 12
are not used in drawing a decision tree diagram.
Table 3.23. Features Associated with the FORMCHAR= Option
Syni Description of Character Feature
1 vertical bar vertical link
2 horizontal bar horizontal link
3 box character (upper left) vertical up to horizontal turn
5 box character (upper right) horizontal and down vertical joint
8 box character (middle right) horizontal to split joint
9 box character (lower left) vertical down to horizontal turn
11 box character (lower right) horizontal and up vertical joint
13 horizontal thick horizontal link that represents
optimal decision
PROC DTREE Statement
335
As an example, the decision tree diagram in Figure 3.7 is produced by the following
statement:
title "Decision Tree Showing the Effects of FORMCHAR";
data Dtoils4;
format _STNAME_ $12. _STTYPE_ $2. _OUTCOM_ $10.
_SUCCES_ $12.;
input _STNAME_ $ _STTYPE_ $ _OUTCOM_ $ _SUCCES_ $;
datalines;
Drill D Drill Cost
. . Not_Drill .
Cost C Low Oil_Deposit
. . High Oil_Deposit
Oil_Deposit C Dry .
. . Wet .
;
proc dtree stagein=Dtoils4
nowarning
;
treeplot / formchar(1 2 3 5 8 9 11 13)=|-/*<\+=
lineprinter display=(LINK);
quit;
Decision Tree Showing the Effects of FORMCHAR
The DTREE Procedure
Line-printer Plot
Low Dry
/----------C-*----------E
Drill | | Wet
/----------C-< \----------E
| | High Dry
----------D-< \----------C-*----------E
| | Wet
| \----------E
|Not_Drill
\----------E
Figure 3.7. Decision Tree Showing the Effects of FORMCHAR
By default, the form character list specied with the SAS system option
FORMCHAR= is used; otherwise, the default is |----|+|---+=. Refer
to the chapter on the Calendar Procedure in the SAS Procedures Guide for more
information.
336
Chapter 3. The DTREE Procedure
EVALUATE Statement
EVALUATE / options ;
The EVALUATE statement causes PROC DTREE to evaluate the decision tree and
calculate the optimal decisions. If the SUMMARY option is specied a decision
summary is displayed. Otherwise, the current optimal value is displayed on the SAS
log.
The following options, which can appear in the PROC DTREE statement, can also
be specied in the EVALUATE statement:
CRITERION=i MAXPREC=d MAXWIDTH=mw
NOSUMMARY NWIDTH=nw RT=r
SUMMARY TARGET=stage
The MAXPREC=, MAXWIDTH=, and NWIDTH=, options are valid only in con-
junction with the SUMMARY option. The RT= option is valid only in conjunction
with the CRITERION=MAXCE or CRITERION=MINCE specication. The options
specied in this statement are only in effect for this statement.
MODIFY Statement
MODIFY outcome-name REWARD new-value ;
MODIFY stage-name TYPE ;
The MODIFY statement is used to change either the type of a stage or the reward
from an outcome. If MODIFY outcome-name REWARD new-value is given where
the outcome-name is an outcome specied in the STAGEIN= data set, and new-value
is a numeric value, then the reward of the outcome named outcome-name is changed
to new-value.
If MODIFY stage-name TYPE is given where stage-name is a stage name specied
in the STAGEIN= data set, then the type of the stage named stage-name is changed
to DECISION if its current type is CHANCE and is changed to CHANCE if
its current type is DECISION. You cannot change the type of an END stage.
The change of the type of a stage from CHANCE to DECISION can help the
decision-maker learn how much improvement can be expected if he or she could pick
which of the future (or unknown) outcomes would occur. However, if you want to
change the type of a stage from DECISION to CHANCE, the procedure is not
able to determine the probabilities for its outcomes unless you specify them in the
PROBIN= data set.
SAVE Statement
337
MOVE Statement
MOVE stage1 (BEFORE | AFTER) stage2 ;
The MOVE statement is used to change the order of the stages. After all data in input
data sets have been read, PROCDTREE determines the order (fromleft to right) of all
stages specied in the STAGEIN= data set and display the order in the SAS log. The
ordering is determined based on the rule that if stage A is the successor of an outcome
of stage B, then stage A should occur to the right of stage B. The MOVE statement
can be used to change the order. If the keyword BEFORE is used, stage1 becomes
the new successor for all immediate predecessors of stage2, and stage2 becomes the
new successor for all outcomes of stage1. An outcome is said to be an immediate
predecessor of a stage if the stage is the successor of that outcome. Similarly, if
the keyword AFTER is used, the old leftmost (in previous order) successor of out-
comes for stage2 becomes the new successor for all outcomes of stage1 and the new
successor of all outcomes of stage2 is stage1.
There are two limitations: the END stage cannot be moved, and no stage can be
moved after the END stage. In practice, any stage after the END stage is useless.
QUIT Statement
QUIT ;
The QUIT statement tells the DTREE procedure to terminate processing. This state-
ment has no options.
RECALL Statement
RECALL ;
This statement tells PROC DTREE to recall the decision model that was saved previ-
ously with a SAVE statement. The RECALL statement has no options.
RESET Statement
RESET options ;
The RESET statement is used to change options after the procedure has started. All
of the options that can be set in the PROC DTREE statement can also be reset with
this statement, except for the STAGEIN=, the PROBIN=, and the PAYOFFS= data
set options.
SAVE Statement
SAVE ;
The SAVE statement saves the current model (attributes of stages and outcomes, the
ordering of stages, and so on) to a scratch space from which you can call it back
later. It is a good idea to save your decision model before you specify any MOVE
or MODIFY statements. Then you can get back to your original model easily after
338
Chapter 3. The DTREE Procedure
a series ofstatements that change the decision model. The SAVE statement has no
options.
SUMMARY Statement
SUMMARY / options ;
Unlike the SUMMARY option on the PROC DTREE statement or the EVALUATE
statement, which species that PROC DTREE display a decision summary when
the decision tree is evaluated, the SUMMARY statement causes the procedure to
display the summary immediately. If the decision tree has not been evaluated yet,
or if it has been changed (by the MOVE, MODIFY, or RECALL statement) since
last evaluated, the procedure evaluates or re-evaluates the decision tree before the
summary is displayed.
The following options that can appear in the PROC DTREE statement can also be
specied in this statement:
MAXPREC=d MAXWIDTH=mw
NWIDTH=nw TARGET=stage
The options specied in this statement are in effect only for this statement.
TREEPLOT Statement
TREEPLOT / options ;
The TREEPLOT statement plots the current decision tree (a diagram of the decision
problem). Each path in the decision tree represents a possible scenario of the problem.
In addition to the nodes and links on the decision tree, the information for each link
that can be displayed on the diagram is listed in Table 3.24.
Table 3.24. Information on Decision Tree Diagram
Information Labeled by
stage name for the successor of the link NL
3
outcome name for the link NL
3
probability of the outcome p=
value can be expected from the successor EV=
instant reward of the outcome r=
cumulative rewards of outcomes on the path that leads to the successor cr=
3
NL denotes that this information is not labeled.
If necessary, the outcome names and the stage names are displayed above the link,
and other information (if there is any) is displayed below the link. The DISPLAY=
option can be used to control which information should be included in the diagram.
The NOLABEL can be used to suppress the displaying of the labels.
If the LINEPRINTER option is used, the decision nodes, chance nodes, and the end
nodes are represented by the characters D, C, and E, respectively. The links
are displayed using the specications of the FORMCHAR= option. See the section
VARIABLES Statement
339
PROC DTREE Statement beginning on page 323 for more details. In graphics
mode, the control of the appearances of nodes and links is more complex. See the
Displaying the Decision Tree section beginning on page 352 for more information.
The following options that can appear in the PROC DTREE statement can also be
specied in the TREEPLOT statement:
DISPLAY=(information-list) GRAPHICS LABEL
LINEPRINTER MAXPREC=d MAXWIDTH=mw
NOLABEL NWIDTH=nw YBETWEEN=ybetween <units>
The following line-printer options that can appear in the PROC DTREE statement
can also be specied in the TREEPLOT statement if the LINEPRINTER option is
specied:
FORMCHAR<(syni-list)>=formchar-string
Moreover, the following graphics options that can appear in the PROC DTREE state-
ment can also be specied in the TREEPLOT statement if the GRAPHICS option is
specied:
ANNOTATE=SAS-data-set CBEST=color CLINK=color
COMPRESS CSYMBOLC=color CSYMBOLD=color
CSYMBOLE=color CTEXT=color DESCRIPTION=string
DOANNOTATE FTEXT=name GOUT=SAS-catalog
HSYMBOL=h HTEXT=h IMAGEMAP=SAS-data-set
LEGEND LINKA=i LINKB=j
LINKC=k LSTYLE=l LSTYLEB=l2
LSTYLEC=l3 LWIDTH=w2 LWIDTHB=w2
NAME=string NOANNOTATE NOCOMPRESS
NOLEGEND NOPAGENUM NORC
PAGENUM RC SYMBOLC=m
SYMBOLD=d SYMBOLE=n VSYMBOLC=symbolc-name
VSYMBOLD=symbold-name VSYMBOLE=symbole-name
The options specied in this statement are in effect only for this statement, and they
may override the options specied in the PROC DTREE statement.
VARIABLES Statement
VARIABLES / options ;
The VARIABLES statement species the variable lists in the input data sets. This
statement is optional but if it is used, it must appear immediately after the PROC
DTREE statement. The options that can appear in the VARIABLES statement are
340
Chapter 3. The DTREE Procedure
divided into groups according to the data set in which they occur. Table 3.25 lists
all the variables or variable lists associated with each input data set and their types. It
also lists the default variables if they are not specied in this statement.
Table 3.25. Input Data Sets and Their Associated Variables
Data Set Variable Type
4
Interpretation Default
STAGEIN= OUTCOME= C/N Outcome names Variables with prex
OUT
REWARD= N Instant reward Variables with prex
REW
STAGE= C/N Stage name
STNAME
OUT in the data set. It is necessary to have at least one OUTCOME= variable in
the STAGEIN= data set. The OUTCOME= variables can be either all character or all
numeric. You cannot mix character and numeric variables as outcomes.
REWARD=(variables)
COST=(variables)
identies all variables in the STAGEIN= data set that contain the reward for each
outcome specied by the OUTCOME= variables. If the REWARD= option is not
specied, PROC DTREE looks for the default variable names that have the prex
REW in the data set. The number of REWARD= variables must be equal to the
number of OUTCOME= variables in the data set. The REWARD= variables must
have numeric values.
STAGE=variable
species the variable in the STAGEIN= data set that names the stages in the decision
model. If the STAGE= option is omitted, PROCDTREE looks for the default variable
named
STNAME
STTYPE
PROB in the data set. The number of PROB= variables in the data set must be
equal to the number of EVENT= variables. The PROB= variables must have numeric
values between 0 and 1 inclusive.
Variables in PAYOFFS= Data Set
The following options specify the variables or variable lists in the PAYOFFS= in-
put data set that identify the possible scenarios (a sequence of outcomes), the nal
outcome names, and the evaluating values (payoff) of combinations of scenarios and
nal outcomes.
ACTION=(variables)
identies all variables in the PAYOFFS= data set that contain the name of the nal
outcome for each possible scenario. If the ACTION= option is not specied, PROC
DTREE looks for the default variable names that have the prex
ACT in the data
set. It is not necessary to have any ACTION= variables in the PAYOFFS= data set,
but if there are any, their values must be outcome names specied in the STAGEIN=
data set.
STATE=(variables)
identies all variables in the PAYOFFS= data set that contain the names of outcomes
that identify a possible scenario (a sequence of outcomes or a path in the decision
tree), or the names of outcomes which combine with every outcome specied by the
ACTION= variables to identify a possible scenario. If the STATE= option is not spec-
ied, PROC DTREE looks for the default variable names that have the prex
STAT
in the data set. It is not necessary to have any STATE= variables in the PAYOFFS=
data set, but if there are any, their values must be outcome names specied in the
STAGEIN= data set.
VALUE=(variables)
PAYOFFS=(variables)
UTILITY=(variables)
LOSS=(variables)
identies all variables in the PAYOFFS= data set that contain the evaluating values or
payoffs for all possible scenarios identied by the outcomes specied by the STATE=
variables and the outcomes specied by the associated ACTION= variables. If the
VALUE= option is not specied, PROC DTREE looks for the default variable names
Input Data Sets
343
that have the prex
VALU in the data set. The number of VALUE= variables must
be equal to the number of ACTION= variables if there are any ACTION= variables.
If there are no ACTION= variables in the data set, at least one STATE= variable must
be in the data set, and the number of VALUE= variables must be exactly 1. The
VALUE= variables must have numeric values.
VPC Statement
VPC chance-stage-name ;
The VPC statement causes PROC TREE to compute the value of perfect control (the
value of controlling an uncertainty). The effect of perfect control is that you can pick
the outcome of an uncertain stage. This value gives an upper limit on the amount
you should be willing to spend on any control procedure. Only the name of a chance
stage can be used to calculate the value of perfect control. The procedure evaluates
the decision tree, if it has not already done so, before computing this value.
VPI Statement
VPI chance-stage-name ;
The VPI statement causes PROC DTREE to compute the value of perfect informa-
tion. The value of perfect information is the benet of resolving an uncertain stage
before making a decision. This value is the upper limit on the improvement that can
be expected for any information gathering effort. Only the name of a chance stage
can be used to calculate the value of perfect information. The procedure evaluates the
decision tree, if it has not already done so, before computing this value.
Details
Input Data Sets
A decision problem is normally constructed in three steps:
1. A structuring of the problem in terms of decisions, uncertainties, and conse-
quences.
2. Assessment of probabilities for the events.
3. Assessment of values (payoffs, losses, or preferences) for each consequence or
scenario.
PROC DTREE represents these three steps in three SAS data sets. The STAGEIN=
data set describes the structure of the problem. In this data set, you dene all deci-
sions and dene all key uncertainties. This data set also contains the relative order
of when decisions are made and uncertainties are resolved (planning horizon). The
PROBIN= data set assigns probabilities for the uncertain events, and the PAYOFFS=
data set contains the values (or utility measure) for each consequence or scenario.
See the Overview section (beginning on page 305) and the Getting Started sec-
tion (beginning on page 307) for a description of these three data sets.
344
Chapter 3. The DTREE Procedure
PROC DTREE is designed to minimize the rules for describing a problem. For ex-
ample, the PROBIN= data set is required only when the evaluation and analysis of a
decision problem is necessary. Similarly, if the PAYOFFS= data set is not specied,
the DTREE procedure assumes all payoff values are 0. The order of the observations
is not important in any of the input data sets. Since a decision problem can be struc-
tured in many different ways and the data format is so exible, all possible ways of
describing a given decision problem cannot be shown here. However, some alternate
ways of supplying the same problem are demonstrated. For example, the following
statements show another way to input the oil wildcatters problem described in the
Introductory Example section beginning on page 307.
data Dtoils3;
format _STNAME_ $12. _STTYPE_ $2. _OUTCOM_ $10.
_REWARD_ dollar12.0 _SUCCES_ $12.;
input _STNAME_ $ _STTYPE_ $ _OUTCOM_ $
_REWARD_ dollar12.0 _SUCCES_ $;
datalines;
Drill D Drill . Cost
. . Not_drill . .
Cost C Low -$150,000 Oil_deposit
. . Fair -$300,000 Oil_deposit
. . High -$500,000 Oil_deposit
Oil_deposit C Dry . .
. . Wet $700,000 .
. . Soaking $1,200,000 .
;
data Dtoilp3;
input _EVENT1 $ _PROB1 _EVENT2 $ _PROB2;
datalines;
Low 0.2 Dry 0.5
Fair 0.6 Wet 0.3
High 0.2 Soaking 0.2
;
title "Oil Wildcatters Problem";
proc dtree stagein=Dtoils3 probin=Dtoilp3
nowarning;
evaluate / summary;
Note that the STAGEIN= data set describes the problem structure and the payoffs
(using the REWARD= variable). Thus, the PAYOFFS= data set is no longer needed.
Note also the changes made to the PROBIN= data set. The results, shown in Figure
3.8, are the same as those shown in Figure 3.2 on page 311. However, the rewards
and the payoffs are entirely different entities in decision tree models. Recall that the
reward of an outcome means the instant returns when the outcome is realized. On
the other hand, the payoffs are the return from each scenario. In the other words,
the decision tree model described in the previous code and the model described in
the Introductory Example section beginning on page 307 are not equivalent, even
though they have the same optimal decision.
Input Data Sets
345
Oil Wildcatters Problem
The DTREE Procedure
Optimal Decision Summary
Order of Stages
Stage Type
-----------------------
Drill Decision
Cost Chance
Oil_deposit Chance
_ENDST_ End
Decision Parameters
Decision Criterion: Maximize Expected Value (MAXEV)
Optimal Decision Yields: 140000
Optimal Decision Policy
Up to Stage Drill
Alternatives Cumulative Evaluating
or Outcomes Reward Value
----------------------------------------
Drill 0 140000*
Not_drill 0 0
Figure 3.8. Optimal Decision Summary of the Oil Wildcatters Problem
You can try many alternative ways to specify your decision problem. Then you can
choose the model that is most convenient and closest to your real problem. If PROC
DTREE cannot interpret the input data, it writes a message to that effect to the SAS
log unless the NOWARNING option is specied. However, there are mistakes that
PROC DTREE cannot detect. These often occur after the model has been modied
with either the MOVE statement or the MODIFYstatement. After a MOVE statement
is specied, it is a good idea to display the decision tree (using the TREEPLOT
statement) and check the probabilities and value assessments to make sure they are
reasonable.
For example, using the REWARD= variable in the STAGEIN= data set to input the
payoff information as shown in the previous code may cause problems if you change
the order of the stages. Suppose you move the stage Cost to the beginning of
the tree, as was done in the Sensitivity Analysis and Value of Perfect Information
section on page 313:
move Cost before Drill;
evaluate / summary;
The optimal decision yields $140, 000, as shown on the optimal decision summary in
Figure 3.9.
346
Chapter 3. The DTREE Procedure
Oil Wildcatters Problem
The DTREE Procedure
Optimal Decision Summary
Order of Stages
Stage Type
-----------------------
Cost Chance
Drill Decision
Oil_deposit Chance
_ENDST_ End
Decision Parameters
Decision Criterion: Maximize Expected Value (MAXEV)
Optimal Decision Yields: 140000
Optimal Decision Policy
Up to Stage Drill
Alternatives Cumulative Evaluating
or Outcomes Reward Value
--------------------------------------------------
Low Drill -150000 450000*
Low Not_drill -150000 0
Fair Drill -300000 450000*
Fair Not_drill -300000 0
High Drill -500000 450000*
High Not_drill -500000 0
Figure 3.9. Optimal Decision Summary of the Oil Wildcatters Problem
Recall that when this was done in the Sensitivity Analysis and Value of Perfect
Information section (page 313), the optimal decision yielded $150, 000. The
reason for this discrepancy is that the cost of drilling, implemented as (nega-
tive) instant rewards here, is imposed on all scenarios including those that con-
tain the outcome Not_drill. This mistake can be observed easily from the
Cumulative Reward column of the optimal decision summary shown Figure 3.9.
Changing a decision stage to a chance stage is another example where using the
MODIFY statement without care may cause problems. PROC DTREE cannot deter-
mine the probabilities of outcomes for this new chance stage unless they are included
in the PROBIN= data set. In contrast to changing a chance stage to a decision stage
(which yields insight on the value of gaining control of an uncertainty), changing a
decision stage to a chance stage is not likely to yield any valuable insight even if
the needed probability data are included in the PROBIN= data set, and it should be
avoided.
Options on Multiple Statements
347
Missing Values
In the STAGEIN= data set, missing values are allowed only for the STAGE= and
TYPE= variables when the information of a stage is specied in more than one
observation. In this case, missing values for the STAGE= and TYPE= variables
are not allowed for the rst observation dening the stage. Missing values for the
OUTCOME=, GIVEN=, EVENT=, STATE=, and ACTION= variables are ignored.
Missing values for the REWARD=, PROB=, and VALUE= variables are treated as
0. Missing values for the SUCCESSOR= variables are ignored if the value for the
corresponding OUTCOME= variable is also missing.
Interactivity
The DTREE procedure is interactive. You start the procedure with the PROC DTREE
statement and terminate it with the QUIT statement. It is not necessary to have a
VARIABLES statement, although if you do include one, it must appear immediately
after the PROC DTREE statement. The other statements such as the EVALUATE,
MODIFY, MOVE, RECALL, RESET, SAVE, SUMMARY, TREEPLOT, VPC, and
VPI, as well as the FOOTNOTE, GOPTIONS, NOTE, SYMBOL, and TITLE state-
ments of SAS/GRAPH Software can be used in any order and as often as needed.
One exception is that the RECALL statement has to be preceded by at least one
SAVE statement.
When an error is detected during processing a statement other than the PROC
DTREE statement and the QUIT statement, the procedure terminates if the option
ERRHANDLE=QUIT is specied; otherwise it stops processing the current state-
ment and waits for the next statement. In either case, an error message is written
to the SAS log. If an error is detected in the PROC DTREE statement or the QUIT
statement, the procedure terminates immediately with an error message.
Options on Multiple Statements
Many options that can be specied in the PROC DTREE statement can also appear
in other statements. The options specied in the PROC DTREE statement remain
in effect for all statements until the end of processing or until they are changed by a
RESET statement. In this sense, those options are global options. The options spec-
ied in other statements are in effect only for the statement in which they are speci-
ed; hence, they are local options. If an option is specied both in the PROC DTREE
statement and in another statement, the local specication overrides the global speci-
cation.
For example, the following statements
reset criterion=maxev;
evaluate / criterion=maxce rt=700000;
summary;
imply that the decision problem is evaluated and the optimal decision is deter-
mined based on the criterion MAXCE with RT=700000. However, the optimal
348
Chapter 3. The DTREE Procedure
decision summary produced by the SUMMARY statement is based on the option
CRITERION=MAXEV and not the MAXCE criterion. If you want an option to be
set permanently, use the RESET statement.
The Order of Stages
The order of stages is an important issue in structuring the decision problem. This
sets the sequence of events or a time horizon and determines when a decision has to
be made and when a chance stage has its uncertainty resolved. If a decision stage pre-
cedes another decision stage in the stages order, the decision to the right is made after
the decision to the left. Moreover, the choice made in the rst decision is remembered
by the decision maker when he or she makes the second decision. Any chance stages
that occur to the left of a decision stage have their uncertainty resolved before the
decision is made. In other words, the decision maker knows what actually happened
when he or she makes the decision. However, the order of two chance stages is fairly
arbitrary if there are no other decision stages between them. For example, you can
change the order of stages Cost and Oil_Deposit in the oil wildcatters
problem without affecting the results.
PROC DTREE determines the order (from left to right) of all stages specied in the
STAGEIN= data set. The ordering is based on the rule that if stage A is the successor
of an outcome of stage B, then stage A should occur to the right of (or after) stage
B. With the MOVE statement, you can change this order. The MOVE statement is
very useful in determining the value (benet or penalty) of postponing or hurrying a
decision. In particular, the value of perfect information about an uncertainty can be
determined by moving the corresponding chance stage to the beginning. However,
as mentioned in early sections, the results may be misleading if you use the MOVE
statement without care. See the Input Data Sets section beginning on page 343 for
an example.
Suggestions for preventing misleading results are as follows:
Using the SAVE statement, always save the original structure before making
any changes.
Use the TREEPLOT statement to display the complete decision tree and check
all details after you change the order.
Evaluation
The EVALUATE statement causes PROC DTREE to calculate the optimal decision.
The evaluate process is done by successive use of two devices:
Find a certain equivalent for the uncertain evaluating values at each chance
node.
Choose the best alternative at each decision node.
Evaluation
349
The certain equivalent of an uncertainty is the certain amount you would accept in
exchange for the uncertain venture. In other words, it is a single number that charac-
terizes an uncertainty described by a probability distribution. This value is subjective
and can vary widely from person to person. There are two quantities, closely related
to the certain equivalent, that are commonly used by decision-makers: the most likely
value and the expected value. The most likely value of an uncertainty is the value with
the largest probability. The expected value is the sum of all outcomes multiplied by
their probabilities.
Perhaps the most popular way to nd the certain equivalent for an uncertainty is the
use of utility function or utility curve. Utility is a measurement of relative preference
to the decision maker for particular outcomes. The utility function assigns a utility to
payoff when it is in terms of continuous values such as money. The certain equivalent
of an uncertainty (a random variable) is calculated by the following steps:
1. Use the utility function or the utility curve to nd the utility values of the out-
comes.
2. Calculate the expected utility of the uncertainty.
3. Determine the certain equivalent of the uncertainty as the value that corre-
sponding utility value is the expected utility.
Refer to Raiffa (1970) for a complete discussion of the utility function.
A simple case that is commonly used is the straight line utility curve or the linear
utility function. The linear utility function has the form
u(x) = a + bx
where x is the evaluating value, and a and b are parameters set by the choice of two
points in the utility curve. For example, if the utility curve passes two points u(0) = 0
and u(1000) = 1, then parameters a and b are set by a = 0 and b = 1/1000. The
certain equivalent of an uncertainty based on this function is the expected value.
Another special case that is commonly used is the exponential utility function, as
u(x) = a b exp(x/r)
where, again, a and b can be set by the choice of two arbitrary points in the utility
curve. For example, if your utility curve goes through points (0, 0) and (1000, 1),
then a and b are given by
a = b = 1/[1 exp(1000/r)]
If an uncertain venture A has n events, event i having probability p
i
and payoff x
i
,
and if the utility function is an exponential function as in the preceding example, then
the certain equivalent of A is
CE(A) = r ln
i=1
p
i
exp(x
i
/r)
350
Chapter 3. The DTREE Procedure
and is independent of the choice of values for a and b (provided that b > 0) (Raiffa
1970).
The parameter r, called the risk tolerance, describes the curvature of the utility func-
tion. Moreover, the quantity 1/r, called risk aversion coefcient (Howard 1968) is a
measure of risk aversion.
Experimental results show that within a reasonable range of values, many utility
curves can be t quite well by an exponential function.
If your utility function is an exponential function as in the preceding example, the risk
tolerance can be estimated by the largest number R for which the following venture
is still acceptable to you.
i
0.5
R
E
E
E
E
E
0.5
R/2
A similar way to approximate the risk tolerance is to nd the largest value R for
which the venture is acceptable (Howard 1988).
i
0.75
R
E
E
E
E
E
0.25
R
Evaluation
351
For corporate decision making, there are some rules of thumb for estimating the risk
tolerance. Examples are to set risk tolerance about equal to one of the following:
net income of the company
one sixth of equity
six percent of net sales
To reveal how well these rules perform in assessing corporate risk tolerance, Howard
(1988) provided the following two tables: Table 3.26 shows the relationship between
the risk tolerance and nancial measures of four large oil and chemicals companies.
There, the risk tolerances are obtained from the top executives of the companies. The
net sales, net income, and equity are obtained from the annual reports of the four
companies.
Table 3.26. Relating Corporate Risk Tolerance to Financial Measures
Measure Company
($ millions) A B C D
Net Sales 2, 300 3, 307 16, 000 31, 000
Net Income 120 152 700 1, 900
Equity 1, 000 1, 153 6, 500 12, 000
Risk Tolerance 150 200 1, 000 2, 000
Table 3.27 shows the ratio of risk tolerance to each of the other quantities.
Table 3.27. Ratios of Corporate Risk Tolerance to Financial Measures
Company
Measure A B C D Average
RT/Sales 0.0652 0.0605 0.0625 0.0645 0.0632
RT/Income 1.25 1.32 1.43 1.05 1.26
RT/Equity 0.150 0.174 0.154 0.167 0.161
Once the certain equivalents for all chance nodes are assessed, the choice process at
each decision node is fairly simple; select the alternative yielding either the maximum
or the minimum(depending on the problem) future certain equivalent value.
You can
use the CRITERION= option to control the way the certain equivalent is calculated
for each chance node and the optimal alternative is chosen at each decision node.
Possible values for the CRITERION= option are listed in Table 3.19 on page 323.
If you use an exponential utility function, the RT= option can be used to specify
your risk tolerance. You also have control over how to present the solution. By
default, PROC DTREE writes the value of the optimal decisions to the SAS log. In
addition, with the SUMMARY option, you can ask PROC DTREE to display the
optimal decision summary to the output.
The future certain equivalent value is often referred to as the evaluating value in this documenta-
tion.
352
Chapter 3. The DTREE Procedure
Displayed Output
The SUMMARY statement and the SUMMARY option in an EVALUATE statement
cause PROC DTREE to display a optimal decision summary for the decision model.
This output is organized into various tables, and they are discussed in order of ap-
pearance.
Order of stages
The Order of stages table lists all stages, and their types, in order of appearance in
the decision model. See the The Order of Stages section on page 348 for details.
For ODS purposes, the label of the Order of stages table is Stages.
Decision Parameters
The Decision Parameters table describes the criterion used for determining the op-
timal decision and the certain equivalent for replacing uncertainties. If you specify
the option CRITERION=MAXCE or CRITERION=MINCE in the PROC DTREE
statement or in the EVALUATE statement, an additional row is added to the table
listing the value of the risk tolerance. It also contains a row showing the value of
the optimal decision yields. For additional information, see the Evaluation section
beginning on page 348.
For ODS purposes, the label of the Decision Parameters table is Parameters.
Optimal Decision Policy
By default, PROC DTREE produces an Optimal Decision Policy table for each
decision stages. You can use the TARGET= option to force PROCDTREE to produce
only one table for a particular stage. The Alternatives or Outcomes columns list
the events in the scenario that leads to the current stage. The Cumulative Reward
column lists the rewards accumulated along the scenario to the events of the current
target stage. The Evaluating Value column lists the values that can be expected form
the events of the target stage. An asterisk (*) is placed beside an evaluating value
indicates the current event is the best alternative of the given scenario.
For ODS purposes, the label of the Optimal Decision Policy table is Policy.
Displaying the Decision Tree
PROC DTREE draws the decision tree either in line-printer mode or in graphics
mode. However, you need to have SAS/GRAPH software licensed at your site to
use graphics mode. In many cases, the procedure draws the decision tree across page
boundaries. If the decision tree diagram is drawn on multiple pages, the procedure
numbers each page of the diagram on the upper right corner of the page (unless the
NOPAGENUM option is specied). The pages are numbered starting with the upper
left corner of the entire diagram. Thus, if the decision tree diagram is broken into
three horizontal and four vertical levels and you want to paste all the pieces together
to form one picture, they should be arranged as shown in Figure 3.10.
Displaying the Decision Tree
353
1
2
3
4
5
6
7
8
9
10
11
12
Figure 3.10. Page Layout of the Decision Tree Diagram
The number of pages that are produced depends on the size of the tree and on the
number of print positions that are available in the horizontal and vertical directions.
Table 3.28 lists all options you can use to control the number of pages.
Table 3.28. Options That Control the Number of Pages
Option Effect
DISPLAY= amounts of information displayed on the diagram
MAXPREC= maximum decimal width allowed (the precision) to format
numerical values into w.d format
MAXWIDTH= maximum eld width allowed to format numerical values
NOLABEL no labels are displayed on the diagram
NWIDTH= maximum eld width allowed to format outcome names
YBETWEEN= vertical spaces between two successive end nodes
If the GRAPHICS option is used, the following options can be used to control the
number of pages:
The COMPRESS option draws the entire decision tree on one page.
The HSYMBOL= option controls the height of all symbols.
The HTEXT= option controls the height of text in the tree.
The HEIGHT= option in a SYMBOL denition species the height of a sym-
bol.
The HTEXT= option in a GOPTIONS statement species the height of all text.
The HTITLE= option in a GOPTIONS statement species the height of the
rst title line.
354
Chapter 3. The DTREE Procedure
The HPOS= and VPOS= options in a GOPTIONS statement change the num-
ber of rows and columns.
Note that the font used for all text may also affect the number of pages needed. Some
fonts take more space than others.
If the decision tree diagram is produced on a line printer, you can use the
FORMCHAR= option to control the appearance the links and the junctions of the
diagram. When the GRAPHICS options is specied, several options are available
to enhance the appearance of the decision tree diagram. These are described in the
Graphics Options section on page 326. In addition, there are many other options
available in the GOPTIONS statement and the SYMBOL statement for controlling
the details of graphics output. Refer to the relevant chapters in SAS/GRAPHSoftware:
Reference for a detailed discussion of the GOPTIONS and SYMBOL statements.
Table 3.29, Table 3.30, and Table 3.31, show the relationship among the options for
controlling the appearance of texts, nodes, and links, respectively. The order that
PROC DTREE uses in determining which option is in effect is also provided.
For ODS purposes, the label of the decision tree diagram drawn in line-printer quality
is Treeplot.
Table 3.29. Options That Control Text Appearance
Object Specication Search Order
Text Font 1. the FTEXT= option
2. the FTEXT= option in a GOPTIONS statement
3. hardware font
Color 1. the CTEXT= option
2. the CTEXT= option in a GOPTIONS statement
3. the rst color in the colors list
Height 1. the value of the HTEXT= option
5
times the value of the
HTEXT= option
6
in a GOPTIONS statement
5
If this option is not specied, the default value 1 is used.
6
The default value of this option is 1 unit.
Displaying the Decision Tree
355
Table 3.30. Options That Control Node Appearance
Object Specication Search Order
Chance Symbol 1. the VSYMBOLC= option
Nodes 2. the VALUE= and FONT= options in the mth generated
SYMBOL denition, if SYMBOLC=m is used
3. the default symbol, CIRCLE
Color 1. the CSYMBOLC= option
2. the CV= option in the mth generated SYMBOL denition,
if SYMBOLC=m is used
3. the CSYMBOL= option in a GOPTIONS statement
4. the fth color in the colors list
Height 1. h times the value of the HEIGHT= option in the mth gener-
ated SYMBOL denition, if both the HSYMBOL=h and
the SYMBOLC=m are specied
2. the HSYMBOL= option, if it is specied
3. the HEIGHT= option in the mth generated symbol deni-
tion, if SYMBOLC=m is used.
4. the default value, 1 cell
Decision Symbol 1. the VSYMBOLD= option
Nodes 2. the VALUE= and FONT= options in the dth generated
SYMBOL denition, if SYMBOLD=d is used
3. the default value, SQUARE
Color 1. the CSYMBOLD= option
2. the CV= option in the dth generated SYMBOL denition,
if SYMBOLD=d is used
3. the CSYMBOL= option in a GOPTIONS statement
4. the fourth color in the colors list
Height 1. h times the value of the HEIGHT= option in the dth gener-
ated SYMBOL denition, if both the HSYMBOL=h and
the SYMBOLD=d are specied
2. the HSYMBOL= option, if it is specied
3. the HEIGHT= option in the dth generated symbol deni-
tion, if SYMBOLD=d is used.
4. the default value, 1 cell
End Symbol 1. the VSYMBOLE= option
Nodes 2. the VALUE= and FONT= options in the nth generated
SYMBOL denition, if SYMBOLE=n is used
3. the default value, DOT
Color 1. the CSYMBOLE= option
2. the CV= option in the nth generated SYMBOL denition
if the option SYMBOLE=n is specied
3. the CSYMBOL= option in a GOPTIONS statement
4. the sixth color in the colors list
Height 1. h times the value of the HEIGHT= option in the nth gener-
ated SYMBOL denition, if both the HSYMBOL=h and
the SYMBOLE=n are specied
2. the HSYMBOL= option, if it is specied
3. the HEIGHT= option in the nth generated symbol deni-
tion, if SYMBOLE=n is used.
4. the default value, 1 cell
356
Chapter 3. The DTREE Procedure
Table 3.31. Options That Control Link Appearance
Object Specication Search Order
Links Type 1. the LSTYLE= option
for 2. the LINE= in the ith generated SYMBOL denition,
Regular if LINKA=i is used
Outcomes 3. the default value, 1 (solid line)
Color 1. the CLINK= option
2. the CI= option in the ith generated SYMBOL denition,
if LINKA=i is used
3. the third color in the colors list
Thickness 1. the LWIDTH= option
2. the WIDTH= option in the ith generated SYMBOL de-
nition, if LINKA=i is used
3. the default value, 1
Links Type 1. the LSTYLEB= option
for 2. the LINE= in the jth generated SYMBOL denition,
Optimal if LINKB=j is used
Decision 3. the default value, 1 (solid line)
Color 1. the CBEST= option
2. the CI= option in the jth generated SYMBOL denition,
if LINKB=j is used
3. the second color in the colors list
Thickness 1. the LWIDTHB= option
2. the WIDTH= option in the jth generated SYMBOL de-
nition, if LINKB=j is used
3. 2 times the thickness of links that represent regular out-
comes
Links Type 1. the LSTYLEC= option
That 2. the LINE= in the kth generated SYMBOL denition,
Fall if LINKC=k is used
Across 3. the default value, 2 (dot line)
Pages Color 1. depends on whether or not it represents an optimal deci-
sion
Thickness 1. depends on whether or not it represents an optimal deci-
sion
Web-Enabled Decision Tree
The WEB= variable in the STAGEIN= data set enables you to dene an HTML refer-
ence for each stage. This HTML reference is currently associated with all the decision
tree nodes that correspond to the stage. The WEB= variable is a character variable,
and the values need to be of the form HREF=htmlpage.
In addition, you can also store the coordinate and link information dened by the
WEB= option in a SAS data set by specifying the IMAGEMAP= option in the PROC
DTREE statement or in the TREEPLOT statement. By processing this SAS data set
using a DATA step, you can generate customized HTML pages for your decision tree
diagram.
Precision Errors
357
ODS Table Names
PROC DTREE assigns a name to each table it creates. You can use these names to
reference the table when using the Output Delivery System (ODS) to select tables
and create output data sets. These names are listed in the following table. For more
information on ODS, refer to the chapter on ODS in the SAS/STAT Users Guide.
Table 3.32. ODS Tables Produced in PROC DTREE
ODS Table Name Description Statement / Option
Parameters Decision parameters SUMMARY or EVALUATE /
SUMMARY
Policy Optimal decision policy SUMMARY or EVALUATE /
SUMMARY
Stages List of stages in order SUMMARY or EVALUATE /
SUMMARY
Treeplot Line-printer plot of deci-
sion tree
TREEPLOT / LINEPRINTER
Precision Errors
When PROC DTREE detects an error, it displays a message on the SAS log to call it
to your attention. If the error is in a statement other than the PROC DTREE statement
and the QUIT statement, and if the ERRHANDLE=QUIT option is not specied,
the procedure ignores the erroneous statement and waits for you to enter another
statement. This gives you a chance to correct the mistake you made and keep running.
You can exit the procedure at any time by specifying the QUIT statement.
If the error is in an input data set, typically, you will have to edit the data set and then
reinvoke PROC DTREE. In one case, however, you can use an option to correct the
problem. You may receive an error message indicating that the sum of probabilities
for a particular chance stage does not equal 1.0. If it is caused by roundoff errors in
the summation, then you can reset the TOLERANCE= option to correct this error. For
example, suppose that your problem contains a chance stage that has three outcomes,
Out1, Out2 and Out3, and each has probability 1/3. Suppose also that
you input their probabilities in the PROBIN= data set as follows:
Out1 Out2 Out3 0.3333 0.3333 0.3333
Then, PROC DTREE detects the total probabilities for that stage as 0.9999, not equal
to 1, and hence displays an error message. The following RESET statement xes the
error:
reset tolerance=0.00015;
Alternatively, you can specify the AUTOSCALE option to ask the procedure to
rescale the probabilities whenever this situation occurs.
358
Chapter 3. The DTREE Procedure
Computer Resource Requirements
There is no inherent limit on the size of the decision tree model that can be evaluated
and analyzed with the DTREE procedure. The numbers of stages and outcomes are
constrained only by the amount of memory available. Naturally, there needs to be a
sufcient amount of core memory available in order to invoke and initialize the SAS
system. Furthermore, more memory is required to load the graphics sublibrary if the
GRAPHICS option is specied. As far as possible, the procedure attempts to store all
the data in core memory. However, if the problem is too large to t in core memory,
the procedure resorts to the use of utility data sets and swaps between core memory
and utility data sets as necessary.
The storage requirement for the data area required by the procedure is proportional
to the number of stages and outcomes as well as the number of nodes
in the decision
tree model. The time required depends heavily on the number of nodes in the decision
tree.
Examples
This section contains six examples that illustrate several features and applications of
the DTREE procedure. The aim of this section is to show you how to use PROC
DTREE to solve your decision problem and gain valuable insight into its structure.
Example 3.1 on page 359 and Example 3.2 on page 364 show two methods frequently
used to spread the risk of a venture: buy insurance and enter a partnership. Example
3.1 also illustrates the use of the VARIABLE statement to identify the variables in the
input data sets. Example 3.3 on page 376 illustrates the use of the graphics options to
produce a graphics quality decision tree diagram. Example 3.4 on page 380 illustrates
the use of SYMBOL and GOPTIONS statements and the Annotate facility to control
the appearance of the decision tree diagram. Example 3.5 on page 384 demonstrates
an application of PROC DTREE for nancial decision problems. It also illustrates a
situation where redundant data are necessary to determine the value of information.
In addition, it shows a case where the results from the VPI and VPC statements
are misleading if they are used without care. Example 3.6 on page 394 shows an
application in litigation, a sophisticated use of sensitivity analysis. It also shows you
how to deal with the value of future money.
Finally, Table 3.40 (page 404) and Table 3.41 (page 404) list all the examples in this
chapter, and the options and statements in the DTREE procedure that are illustrated
by each example.
The number of nodes depends on the number of stages and the number of outcomes for each stage.
Example 3.1. Oil Wildcatters Problem with Insurance
359
Example 3.1. Oil Wildcatters Problem with Insurance
Again consider the oil wildcatters problem introduced in the Introductory Example
section beginning on page 307. Suppose that the wildcatter is concerned that the
probability of a dry well may be as high as 0.5.
The wildcatter has learned that an insurance company is willing to offer him a policy
that, with a premium of $130, 000, will redeem $200, 000 if the well is dry. He would
like to include the alternative of buying insurance into his analysis. One way to do
this is to include a stage for this decision in the model. The following DATA step
reads this new decision problem into the STAGEIN= data set named Dtoils4. Notice
the new stage named Insurance, which represents the decision of whether or
not to buy the insurance. Also notice that the cost of the insurance is represented as a
negative reward of $130, 000.
/* -- create the STAGEIN= data set -- */
data Dtoils4;
format Stage $12. Stype $2. Outcome $14.
Succ $12. Premium dollar12.0;
input Stage $ Stype $ Outcome $ Succ $
Premium dollar12.0;
datalines;
Drill D Drill Insurance .
. . Not_Drill . .
Insurance D Buy_Insurance Cost -$130,000
. . Do_Not_Buy Cost .
Cost C Low Oil_Deposit .
. . Fair Oil_Deposit .
. . High Oil_Deposit .
Oil_Deposit C Dry . .
. . Wet . .
. . Soaking . .
;
Probabilities associated with the uncertain events are given in the PROBIN= data set
named Dtoilp4. Except for the order of the variables in this data set, it is the same as
the Dtoilp1 data set given in the Introductory Example section beginning on page
307.
/* -- create the PROBIN= data set -- */
data Dtoilp4;
input (V1-V3) ($) P1-P3 ;
datalines;
Low Fair High 0.2 0.6 0.2
Dry Wet Soaking 0.5 0.3 0.2
;
360
Chapter 3. The DTREE Procedure
The payoffs for this problem are now calculated to include the cost and value of the
insurance. The following DATA step does this.
/* -- create PAYOFFS= data set -- */
data Dtoilu4;
format Drill $9. Insuran $14. Payoff dollar12.0;
input Cost $ Deposit $ Drill $ Insuran $ ;
/* determine the cost for this scenario */
if Cost=Low then Rcost=150000;
else if Cost=Fair then Rcost=300000;
else Rcost=500000;
/* determine the oil deposit and the corresponding */
/* net payoff for this scenario */
if Deposit=Dry then Return=0;
else if Deposit=Wet then Return=700000;
else Return=1200000;
/* calculate the net return for this scenario */
if Drill=Not_Drill then Payoff=0;
else Payoff=Return-Rcost;
/* determine redeem received for this scenario */
if Insuran=Buy_Insurance and Deposit=Dry then
Payoff=Payoff+200000;
/* drop unneeded variables */
drop Rcost Return;
datalines;
Low Dry Not_Drill .
Low Dry Drill Buy_Insurance
Low Dry Drill Do_Not_Buy
Low Wet Not_Drill .
Low Wet Drill Buy_Insurance
Low Wet Drill Do_Not_Buy
Low Soaking Not_Drill .
Low Soaking Drill Buy_Insurance
Low Soaking Drill Do_Not_Buy
Fair Dry Not_Drill .
Fair Dry Drill Buy_Insurance
Fair Dry Drill Do_Not_Buy
Fair Wet Not_Drill .
Fair Wet Drill Buy_Insurance
Fair Wet Drill Do_Not_Buy
Fair Soaking Not_Drill .
Fair Soaking Drill Buy_Insurance
Fair Soaking Drill Do_Not_Buy
High Dry Not_Drill .
High Dry Drill Buy_Insurance
High Dry Drill Do_Not_Buy
High Wet Not_Drill .
Example 3.1. Oil Wildcatters Problem with Insurance
361
High Wet Drill Buy_Insurance
High Wet Drill Do_Not_Buy
High Soaking Not_Drill .
High Soaking Drill Buy_Insurance
High Soaking Drill Do_Not_Buy
;
The payoff table can be displayed with the following PROC PRINT statement:
/* -- print the payoff table -- */
title "Oil Wildcatters Problem";
title3 "The Payoffs";
proc print data=Dtoilu4;
run;
The table is shown in Output 3.1.1.
Output 3.1.1. Payoffs of the Oil Wildcatters Problem with an Insurance Option
Oil Wildcatters Problem
The Payoffs
Obs Cost Deposit Drill Insuran Payoff
1 Low Dry Not_Drill $0
2 Low Dry Drill Buy_Insurance $50,000
3 Low Dry Drill Do_Not_Buy $-150,000
4 Low Wet Not_Drill $0
5 Low Wet Drill Buy_Insurance $550,000
6 Low Wet Drill Do_Not_Buy $550,000
7 Low Soaking Not_Drill $0
8 Low Soaking Drill Buy_Insurance $1,050,000
9 Low Soaking Drill Do_Not_Buy $1,050,000
10 Fair Dry Not_Drill $0
11 Fair Dry Drill Buy_Insurance $-100,000
12 Fair Dry Drill Do_Not_Buy $-300,000
13 Fair Wet Not_Drill $0
14 Fair Wet Drill Buy_Insurance $400,000
15 Fair Wet Drill Do_Not_Buy $400,000
16 Fair Soaking Not_Drill $0
17 Fair Soaking Drill Buy_Insurance $900,000
18 Fair Soaking Drill Do_Not_Buy $900,000
19 High Dry Not_Drill $0
20 High Dry Drill Buy_Insurance $-300,000
21 High Dry Drill Do_Not_Buy $-500,000
22 High Wet Not_Drill $0
23 High Wet Drill Buy_Insurance $200,000
24 High Wet Drill Do_Not_Buy $200,000
25 High Soaking Not_Drill $0
26 High Soaking Drill Buy_Insurance $700,000
27 High Soaking Drill Do_Not_Buy $700,000
362
Chapter 3. The DTREE Procedure
To nd the optimal decision, call PROC DTREE with the following statements:
/* -- PROC DTREE statements -- */
title "Oil Wildcatters Problem";
proc dtree stagein=Dtoils4
probin=Dtoilp4
payoffs=Dtoilu4
nowarning
;
variables / stage=Stage type=Stype outcome=(Outcome)
reward=(Premium) successor=(Succ)
event=(V1 V2 V3) prob=(P1 P2 P3)
state=(Cost Deposit Drill Insuran)
payoff=(Payoff);
evaluate;
summary / target=Insurance;
The VARIABLES statement identies the variables in the input data sets. The yield
of the optimal decision is written to the SAS log as:
NOTE: Present order of stages:
Drill(D), Insurance(D), Cost(C), Oil_Deposit(C),
_ENDST_(E).
NOTE: The currently optimal decision yields 140000.
The optimal decision summary produced by the SUMMARY statements are shown
in Output 3.1.2. The summary in Output 3.1.2 shows that the insurance policy is
worth $240, 000$140, 000 = $100, 000, but since it costs $130, 000, the wildcatter
should reject such an insurance policy.
Example 3.1. Oil Wildcatters Problem with Insurance
363
Output 3.1.2. Summary of the Oil Wildcatters Problem
Oil Wildcatters Problem
The DTREE Procedure
Optimal Decision Summary
Order of Stages
Stage Type
-----------------------
Drill Decision
Insurance Decision
Cost Chance
Oil_Deposit Chance
_ENDST_ End
Decision Parameters
Decision Criterion: Maximize Expected Value (MAXEV)
Optimal Decision Yields: $140,000
Optimal Decision Policy
Up to Stage Insurance
Cumulative Evaluating
Alternatives or Outcomes Reward Value
------------------------------------------------------------
Drill Buy_Insurance -130000 $240,000
Drill Do_Not_Buy 0 $140,000*
Now assume that the oil wildcatter is risk averse and has an exponential utility func-
tion with a risk tolerance of $1, 200, 000. In order to evaluate his problem based
on this decision criterion, the wildcatter reevaluates the problem with the following
statements:
reset criterion=maxce rt=1200000;
summary / target=Insurance;
The output from PROC DTREE given in Output 3.1.3 shows that the decision to
purchase an insurance policy is favorable in the risk-averse environment. Note that
an EVALUATE statement is not necessary before the SUMMARY statement. PROC
DTREE evaluates the decision tree automatically when the decision criterion has been
changed using the RESET statement.
364
Chapter 3. The DTREE Procedure
Output 3.1.3. Summary of the Oil Wildcatters Problem with RT = 1, 200, 000
Oil Wildcatters Problem
The DTREE Procedure
Optimal Decision Summary
Order of Stages
Stage Type
-----------------------
Drill Decision
Insurance Decision
Cost Chance
Oil_Deposit Chance
_ENDST_ End
Decision Parameters
Decision Criterion: Maximize Certain Equivalent Value (MAXCE)
Risk Tolerance: $1,200,000
Optimal Decision Yields: $45,728
Optimal Decision Policy
Up to Stage Insurance
Cumulative Evaluating
Alternatives or Outcomes Reward Value
------------------------------------------------------------
Drill Buy_Insurance -130000 $175,728*
Drill Do_Not_Buy 0 $44,499
Example 3.2. Oil Wildcatters Problem in Risk-Averse Setting
Continuing with the oil wildcatters problem, suppose that in addition to possibly
buying insurance to spread the risk of the venture, the wildcatter is considering shar-
ing the risk by selling a portion of this venture to other investors. Now, the decision
he faces is whether to buy insurance or not and what percentage of the investment
to divest. Again, assume that the wildcatter is risk averse with a risk tolerance of
$1, 200, 000. Notice that in the program that follows the Divestment decision
includes possibilities of no divestment to 100% divestment in 10% increments.
Example 3.2. Oil Wildcatters Problem in Risk-Averse Setting
365
/* -- create the STAGEIN= data set -- */
data Dtoils4;
format _STNAME_ $12. _OUTCOM_ $15. _SUCCES_ $12.;
input _STNAME_ $ _STTYPE_ $ _OUTCOM_ $
_SUCCES_ $ ;
datalines;
Divestment Decision No_Divestment Insurance
. . 10%_Divestment Insurance
. . 20%_Divestment Insurance
. . 30%_Divestment Insurance
. . 40%_Divestment Insurance
. . 50%_Divestment Insurance
. . 60%_Divestment Insurance
. . 70%_Divestment Insurance
. . 80%_Divestment Insurance
. . 90%_Divestment Insurance
. . 100%_Divestment .
Insurance Decision Buy_Insurance Cost
. . Do_Not_Buy Cost
Cost Chance Low Oil_Deposit
. . Fair Oil_Deposit
. . High Oil_Deposit
Oil_Deposit Chance Dry .
. . Wet .
. . Soaking .
;
The probabilities associated with the uncertain events are given in the PROBIN= data
set named Dtoilp4. Except for the order of the variables in this data set, it is the same
as the Dtoilp1 data set used in the Introductory Example section beginning on page
307.
/* -- create the PROBIN= data set -- */
data Dtoilp4;
input _EVENT1 $ _PROB1 _EVENT3 $ _PROB3 ;
datalines;
Low 0.2 Dry 0.5
Fair 0.6 Wet 0.3
High 0.2 Soaking 0.2
;
/* -- create the PAYOFFS= data set -- */
data Dtoilu4(drop=i j k l);
length _STATE1-_STATE4 $16. ;
format _VALUE_ dollar12.0;
366
Chapter 3. The DTREE Procedure
/* define and initialize arrays */
array DIVEST{11} $16. _TEMPORARY_ (No_Divestment,
10%_Divestment,
20%_Divestment,
30%_Divestment,
40%_Divestment,
50%_Divestment,
60%_Divestment,
70%_Divestment,
80%_Divestment,
90%_Divestment,
100%_Divestment );
array INSUR{3} $16. _TEMPORARY_ (Do_Not_Buy,
Buy_Insurance,
);
array COST{4} $ _TEMPORARY_ (Low,
Fair,
High,
);
array DEPOSIT{4} $ _TEMPORARY_ (Dry,
Wet,
Soaking,
);
do i=1 to 10; /* loop for each divestment */
_STATE1=DIVEST{i};
/* determine the percentage of ownership */
/* retained for this scenario */
PCT=1.0-((i-1)*0.1);
do j=1 to 2; /* loop for insurance decision */
_STATE2=INSUR{j};
/* determine the premium need to pay */
/* for this scenario */
if _STATE2=Buy_Insurance then PREMIUM=130000;
else PREMIUM=0;
do k=1 to 3; /* loop for each well cost */
_STATE3=COST{k};
/* determine the cost for this scenario */
if _STATE3=Low then _COST_=150000;
else if _STATE3=Fair then _COST_=300000;
else _COST_=500000;
Example 3.2. Oil Wildcatters Problem in Risk-Averse Setting
367
do l=1 to 3; /* loop for each deposit type */
_STATE4=DEPOSIT{l};
/* determine the oil deposit and the */
/* corresponding net payoff for this */
/* scenario */
if _STATE4=Dry then _PAYOFF_=0;
else if _STATE4=Wet then _PAYOFF_=700000;
else _PAYOFF_=1200000;
/* determine redeem received for this */
/* scenario */
if _STATE2=Buy_Insurance and _STATE4=Dry then
REDEEM=200000;
else REDEEM=0;
/* calculate the net return for this */
/*scenario */
_VALUE_=(_PAYOFF_-_COST_-PREMIUM+REDEEM)*PCT;
/* drop unneeded variables */
drop _COST_ _PAYOFF_ PREMIUM REDEEM PCT;
/* output this record */
output;
end;
end;
end;
end;
/* output an observation for the scenario */
/* 100%_Divestment */
_STATE1=DIVEST{11};
_STATE2=INSUR{3};
_STATE3=COST{4};
_STATE4=DEPOSIT{4};
_VALUE_=0;
output;
run;
The Dtoilu4 data set for this problem, which contains 181 observations and 5 vari-
ables, is displayed in Output 3.2.1.
368
Chapter 3. The DTREE Procedure
Output 3.2.1. Payoffs of the Oil Wildcatters Problem with Risk Sharing
Oil Wildcatters Problem
The Payoffs
Obs _STATE1 _STATE2 _STATE3 _STATE4 _VALUE_
1 No_Divestment Do_Not_Buy Low Dry $-150,000
2 No_Divestment Do_Not_Buy Low Wet $550,000
3 No_Divestment Do_Not_Buy Low Soaking $1,050,000
4 No_Divestment Do_Not_Buy Fair Dry $-300,000
5 No_Divestment Do_Not_Buy Fair Wet $400,000
6 No_Divestment Do_Not_Buy Fair Soaking $900,000
7 No_Divestment Do_Not_Buy High Dry $-500,000
8 No_Divestment Do_Not_Buy High Wet $200,000
9 No_Divestment Do_Not_Buy High Soaking $700,000
10 No_Divestment Buy_Insurance Low Dry $-80,000
11 No_Divestment Buy_Insurance Low Wet $420,000
12 No_Divestment Buy_Insurance Low Soaking $920,000
13 No_Divestment Buy_Insurance Fair Dry $-230,000
14 No_Divestment Buy_Insurance Fair Wet $270,000
15 No_Divestment Buy_Insurance Fair Soaking $770,000
16 No_Divestment Buy_Insurance High Dry $-430,000
17 No_Divestment Buy_Insurance High Wet $70,000
18 No_Divestment Buy_Insurance High Soaking $570,000
19 10%_Divestment Do_Not_Buy Low Dry $-135,000
20 10%_Divestment Do_Not_Buy Low Wet $495,000
21 10%_Divestment Do_Not_Buy Low Soaking $945,000
22 10%_Divestment Do_Not_Buy Fair Dry $-270,000
23 10%_Divestment Do_Not_Buy Fair Wet $360,000
24 10%_Divestment Do_Not_Buy Fair Soaking $810,000
25 10%_Divestment Do_Not_Buy High Dry $-450,000
26 10%_Divestment Do_Not_Buy High Wet $180,000
27 10%_Divestment Do_Not_Buy High Soaking $630,000
28 10%_Divestment Buy_Insurance Low Dry $-72,000
29 10%_Divestment Buy_Insurance Low Wet $378,000
30 10%_Divestment Buy_Insurance Low Soaking $828,000
31 10%_Divestment Buy_Insurance Fair Dry $-207,000
32 10%_Divestment Buy_Insurance Fair Wet $243,000
33 10%_Divestment Buy_Insurance Fair Soaking $693,000
34 10%_Divestment Buy_Insurance High Dry $-387,000
35 10%_Divestment Buy_Insurance High Wet $63,000
36 10%_Divestment Buy_Insurance High Soaking $513,000
37 20%_Divestment Do_Not_Buy Low Dry $-120,000
38 20%_Divestment Do_Not_Buy Low Wet $440,000
39 20%_Divestment Do_Not_Buy Low Soaking $840,000
40 20%_Divestment Do_Not_Buy Fair Dry $-240,000
41 20%_Divestment Do_Not_Buy Fair Wet $320,000
42 20%_Divestment Do_Not_Buy Fair Soaking $720,000
43 20%_Divestment Do_Not_Buy High Dry $-400,000
44 20%_Divestment Do_Not_Buy High Wet $160,000
45 20%_Divestment Do_Not_Buy High Soaking $560,000
46 20%_Divestment Buy_Insurance Low Dry $-64,000
47 20%_Divestment Buy_Insurance Low Wet $336,000
48 20%_Divestment Buy_Insurance Low Soaking $736,000
Example 3.2. Oil Wildcatters Problem in Risk-Averse Setting
369
Oil Wildcatters Problem
The Payoffs
Obs _STATE1 _STATE2 _STATE3 _STATE4 _VALUE_
49 20%_Divestment Buy_Insurance Fair Dry $-184,000
50 20%_Divestment Buy_Insurance Fair Wet $216,000
51 20%_Divestment Buy_Insurance Fair Soaking $616,000
52 20%_Divestment Buy_Insurance High Dry $-344,000
53 20%_Divestment Buy_Insurance High Wet $56,000
54 20%_Divestment Buy_Insurance High Soaking $456,000
55 30%_Divestment Do_Not_Buy Low Dry $-105,000
56 30%_Divestment Do_Not_Buy Low Wet $385,000
57 30%_Divestment Do_Not_Buy Low Soaking $735,000
58 30%_Divestment Do_Not_Buy Fair Dry $-210,000
59 30%_Divestment Do_Not_Buy Fair Wet $280,000
60 30%_Divestment Do_Not_Buy Fair Soaking $630,000
61 30%_Divestment Do_Not_Buy High Dry $-350,000
62 30%_Divestment Do_Not_Buy High Wet $140,000
63 30%_Divestment Do_Not_Buy High Soaking $490,000
64 30%_Divestment Buy_Insurance Low Dry $-56,000
65 30%_Divestment Buy_Insurance Low Wet $294,000
66 30%_Divestment Buy_Insurance Low Soaking $644,000
67 30%_Divestment Buy_Insurance Fair Dry $-161,000
68 30%_Divestment Buy_Insurance Fair Wet $189,000
69 30%_Divestment Buy_Insurance Fair Soaking $539,000
70 30%_Divestment Buy_Insurance High Dry $-301,000
71 30%_Divestment Buy_Insurance High Wet $49,000
72 30%_Divestment Buy_Insurance High Soaking $399,000
73 40%_Divestment Do_Not_Buy Low Dry $-90,000
74 40%_Divestment Do_Not_Buy Low Wet $330,000
75 40%_Divestment Do_Not_Buy Low Soaking $630,000
76 40%_Divestment Do_Not_Buy Fair Dry $-180,000
77 40%_Divestment Do_Not_Buy Fair Wet $240,000
78 40%_Divestment Do_Not_Buy Fair Soaking $540,000
79 40%_Divestment Do_Not_Buy High Dry $-300,000
80 40%_Divestment Do_Not_Buy High Wet $120,000
81 40%_Divestment Do_Not_Buy High Soaking $420,000
82 40%_Divestment Buy_Insurance Low Dry $-48,000
83 40%_Divestment Buy_Insurance Low Wet $252,000
84 40%_Divestment Buy_Insurance Low Soaking $552,000
85 40%_Divestment Buy_Insurance Fair Dry $-138,000
86 40%_Divestment Buy_Insurance Fair Wet $162,000
87 40%_Divestment Buy_Insurance Fair Soaking $462,000
88 40%_Divestment Buy_Insurance High Dry $-258,000
89 40%_Divestment Buy_Insurance High Wet $42,000
90 40%_Divestment Buy_Insurance High Soaking $342,000
91 50%_Divestment Do_Not_Buy Low Dry $-75,000
92 50%_Divestment Do_Not_Buy Low Wet $275,000
93 50%_Divestment Do_Not_Buy Low Soaking $525,000
94 50%_Divestment Do_Not_Buy Fair Dry $-150,000
95 50%_Divestment Do_Not_Buy Fair Wet $200,000
96 50%_Divestment Do_Not_Buy Fair Soaking $450,000
370
Chapter 3. The DTREE Procedure
Oil Wildcatters Problem
The Payoffs
Obs _STATE1 _STATE2 _STATE3 _STATE4 _VALUE_
97 50%_Divestment Do_Not_Buy High Dry $-250,000
98 50%_Divestment Do_Not_Buy High Wet $100,000
99 50%_Divestment Do_Not_Buy High Soaking $350,000
100 50%_Divestment Buy_Insurance Low Dry $-40,000
101 50%_Divestment Buy_Insurance Low Wet $210,000
102 50%_Divestment Buy_Insurance Low Soaking $460,000
103 50%_Divestment Buy_Insurance Fair Dry $-115,000
104 50%_Divestment Buy_Insurance Fair Wet $135,000
105 50%_Divestment Buy_Insurance Fair Soaking $385,000
106 50%_Divestment Buy_Insurance High Dry $-215,000
107 50%_Divestment Buy_Insurance High Wet $35,000
108 50%_Divestment Buy_Insurance High Soaking $285,000
109 60%_Divestment Do_Not_Buy Low Dry $-60,000
110 60%_Divestment Do_Not_Buy Low Wet $220,000
111 60%_Divestment Do_Not_Buy Low Soaking $420,000
112 60%_Divestment Do_Not_Buy Fair Dry $-120,000
113 60%_Divestment Do_Not_Buy Fair Wet $160,000
114 60%_Divestment Do_Not_Buy Fair Soaking $360,000
115 60%_Divestment Do_Not_Buy High Dry $-200,000
116 60%_Divestment Do_Not_Buy High Wet $80,000
117 60%_Divestment Do_Not_Buy High Soaking $280,000
118 60%_Divestment Buy_Insurance Low Dry $-32,000
119 60%_Divestment Buy_Insurance Low Wet $168,000
120 60%_Divestment Buy_Insurance Low Soaking $368,000
121 60%_Divestment Buy_Insurance Fair Dry $-92,000
122 60%_Divestment Buy_Insurance Fair Wet $108,000
123 60%_Divestment Buy_Insurance Fair Soaking $308,000
124 60%_Divestment Buy_Insurance High Dry $-172,000
125 60%_Divestment Buy_Insurance High Wet $28,000
126 60%_Divestment Buy_Insurance High Soaking $228,000
127 70%_Divestment Do_Not_Buy Low Dry $-45,000
128 70%_Divestment Do_Not_Buy Low Wet $165,000
129 70%_Divestment Do_Not_Buy Low Soaking $315,000
130 70%_Divestment Do_Not_Buy Fair Dry $-90,000
131 70%_Divestment Do_Not_Buy Fair Wet $120,000
132 70%_Divestment Do_Not_Buy Fair Soaking $270,000
133 70%_Divestment Do_Not_Buy High Dry $-150,000
134 70%_Divestment Do_Not_Buy High Wet $60,000
135 70%_Divestment Do_Not_Buy High Soaking $210,000
136 70%_Divestment Buy_Insurance Low Dry $-24,000
137 70%_Divestment Buy_Insurance Low Wet $126,000
138 70%_Divestment Buy_Insurance Low Soaking $276,000
139 70%_Divestment Buy_Insurance Fair Dry $-69,000
140 70%_Divestment Buy_Insurance Fair Wet $81,000
141 70%_Divestment Buy_Insurance Fair Soaking $231,000
142 70%_Divestment Buy_Insurance High Dry $-129,000
143 70%_Divestment Buy_Insurance High Wet $21,000
144 70%_Divestment Buy_Insurance High Soaking $171,000
Example 3.2. Oil Wildcatters Problem in Risk-Averse Setting
371
Oil Wildcatters Problem
The Payoffs
Obs _STATE1 _STATE2 _STATE3 _STATE4 _VALUE_
145 80%_Divestment Do_Not_Buy Low Dry $-30,000
146 80%_Divestment Do_Not_Buy Low Wet $110,000
147 80%_Divestment Do_Not_Buy Low Soaking $210,000
148 80%_Divestment Do_Not_Buy Fair Dry $-60,000
149 80%_Divestment Do_Not_Buy Fair Wet $80,000
150 80%_Divestment Do_Not_Buy Fair Soaking $180,000
151 80%_Divestment Do_Not_Buy High Dry $-100,000
152 80%_Divestment Do_Not_Buy High Wet $40,000
153 80%_Divestment Do_Not_Buy High Soaking $140,000
154 80%_Divestment Buy_Insurance Low Dry $-16,000
155 80%_Divestment Buy_Insurance Low Wet $84,000
156 80%_Divestment Buy_Insurance Low Soaking $184,000
157 80%_Divestment Buy_Insurance Fair Dry $-46,000
158 80%_Divestment Buy_Insurance Fair Wet $54,000
159 80%_Divestment Buy_Insurance Fair Soaking $154,000
160 80%_Divestment Buy_Insurance High Dry $-86,000
161 80%_Divestment Buy_Insurance High Wet $14,000
162 80%_Divestment Buy_Insurance High Soaking $114,000
163 90%_Divestment Do_Not_Buy Low Dry $-15,000
164 90%_Divestment Do_Not_Buy Low Wet $55,000
165 90%_Divestment Do_Not_Buy Low Soaking $105,000
166 90%_Divestment Do_Not_Buy Fair Dry $-30,000
167 90%_Divestment Do_Not_Buy Fair Wet $40,000
168 90%_Divestment Do_Not_Buy Fair Soaking $90,000
169 90%_Divestment Do_Not_Buy High Dry $-50,000
170 90%_Divestment Do_Not_Buy High Wet $20,000
171 90%_Divestment Do_Not_Buy High Soaking $70,000
172 90%_Divestment Buy_Insurance Low Dry $-8,000
173 90%_Divestment Buy_Insurance Low Wet $42,000
174 90%_Divestment Buy_Insurance Low Soaking $92,000
175 90%_Divestment Buy_Insurance Fair Dry $-23,000
176 90%_Divestment Buy_Insurance Fair Wet $27,000
177 90%_Divestment Buy_Insurance Fair Soaking $77,000
178 90%_Divestment Buy_Insurance High Dry $-43,000
179 90%_Divestment Buy_Insurance High Wet $7,000
180 90%_Divestment Buy_Insurance High Soaking $57,000
181 100%_Divestment $0
The optimal decisions for this problem can be identied by invoking PROC DTREE
and using the SUMMARY statement as follows:
title "Oil Wildcatters Problem";
proc dtree stagein=Dtoils4
probin=Dtoilp4
payoffs=Dtoilu4
criterion=maxce rt=1200000
nowarning;
evaluate;
summary / target=Divestment;
summary / target=Insurance;
quit;
372
Chapter 3. The DTREE Procedure
The optimal decision summaries in Output 3.2.2 and Output 3.2.3 show the optimal
strategy for the wildcatter.
The wildcatter should sell 30% of his investment to other companies and reject
the insurance policy offered to him.
The insurance policy should be accepted only if the decision to not divest is
made.
If the decision to buy the insurance policy is made, then it is optimal to divest
10% of the venture.
Output 3.2.2. Summary of the Oil Wildcatters Problem for DIVESTMENT
Oil Wildcatters Problem
The DTREE Procedure
Optimal Decision Summary
Order of Stages
Stage Type
-----------------------
Divestment Decision
Insurance Decision
Cost Chance
Oil_Deposit Chance
_ENDST_ End
Decision Parameters
Decision Criterion: Maximize Certain Equivalent Value (MAXCE)
Risk Tolerance: $1,200,000
Optimal Decision Yields: $50,104
Optimal Decision Policy
Up to Stage Divestment
Alternatives Cumulative Evaluating
or Outcomes Reward Value
---------------------------------------------
No_Divestment $45,728
10%_Divestment $48,021
20%_Divestment $49,907
30%_Divestment $50,104*
40%_Divestment $48,558
50%_Divestment $45,219
60%_Divestment $40,036
70%_Divestment $32,965
80%_Divestment $23,961
90%_Divestment $12,985
100%_Divestment $0
Example 3.2. Oil Wildcatters Problem in Risk-Averse Setting
373
Output 3.2.3. Summary of the Oil Wildcatters Problem for INSURANCE
Oil Wildcatters Problem
The DTREE Procedure
Optimal Decision Summary
Order of Stages
Stage Type
-----------------------
Divestment Decision
Insurance Decision
Cost Chance
Oil_Deposit Chance
_ENDST_ End
Decision Parameters
Decision Criterion: Maximize Certain Equivalent Value (MAXCE)
Risk Tolerance: $1,200,000
Optimal Decision Yields: $50,104
Optimal Decision Policy
Up to Stage Insurance
Cumulative Evaluating
Alternatives or Outcomes Reward Value
----------------------------------------------------------------
No_Divestment Buy_Insurance $45,728*
No_Divestment Do_Not_Buy $44,499
10%_Divestment Buy_Insurance $46,552
10%_Divestment Do_Not_Buy $48,021*
20%_Divestment Buy_Insurance $46,257
20%_Divestment Do_Not_Buy $49,907*
30%_Divestment Buy_Insurance $44,812
30%_Divestment Do_Not_Buy $50,104*
40%_Divestment Buy_Insurance $42,186
40%_Divestment Do_Not_Buy $48,558*
50%_Divestment Buy_Insurance $38,350
50%_Divestment Do_Not_Buy $45,219*
60%_Divestment Buy_Insurance $33,273
60%_Divestment Do_Not_Buy $40,036*
70%_Divestment Buy_Insurance $26,927
70%_Divestment Do_Not_Buy $32,965*
80%_Divestment Buy_Insurance $19,284
80%_Divestment Do_Not_Buy $23,961*
90%_Divestment Buy_Insurance $10,317
90%_Divestment Do_Not_Buy $12,985*
This information can be illustrated graphically using the GPLOT procedure. Output
3.2.4 on page 375, produced by the PROC GPLOT statements shown in the following
code, provides a clear picture of the effects of the divestment possibilities and the
insurance options.
374
Chapter 3. The DTREE Procedure
/* create a data set for the return corresponds to each */
/* divestment possibilities and the insurance options */
data Data2g;
input INSURE DIVEST VALUE;
datalines;
1 0 45728
0 0 44499
1 10 46552
0 10 48021
1 20 46257
0 20 49907
1 30 44812
0 30 50104
1 40 42186
0 40 48558
1 50 38350
0 50 45219
1 60 33273
0 60 40036
1 70 26927
0 70 32965
1 80 19284
0 80 23961
1 90 10317
0 90 12985
1 100 0
0 100 0
;
/* -- define a format for INSURE variable -- */
proc format;
value sample 0=Do_Not_Buy 1=Buy_Insurance;
run;
/* -- define title -- */
title h=3 "Oil Wildcatters Problem";
/* -- set graphics options -- */
goptions lfactor=3;
/* define legend -- */
legend1 frame cframe=white label=none
cborder=black position=center ;
/* define symbol characteristics of the data points */
/* and the interpolation line for returns vs divestment */
/* when INSURE=0 */
symbol1 c=black i=join v=dot l=1 h=1.5;
/* define symbol characteristics of the data points */
/* and the interpolation line for returns vs divestment */
/* when INSURE=1 */
symbol2 c=black i=join v=square l=2 h=1.5;
Example 3.2. Oil Wildcatters Problem in Risk-Averse Setting
375
/* -- define axis characteristics -- */
axis1 minor=none label=(Divestment (in percentage));
axis2 minor=none label=(angle=90 rotate=0 Certainty Equivalent);
/* plot VALUE vs DIVEST using INSURE as third variable */
proc gplot data=Data2g ;
plot VALUE*DIVEST=INSURE / haxis=axis1
vaxis=axis2
legend=legend1
name="dt2"
frame
cframe=white ;
format INSURE SAMPLE.;
run;
quit;
Note that the data input into the Data2g data set is obtained fromthe optimal decision
summary as in Output 3.2.3 on page 373. The value 1 of the INSURE variable repre-
sents the alternative Buy_Insurance and the value 0 represents the alternative
Do_Not_Buy.
Output 3.2.4. Returns of the Oil Wildcatters Problem
376
Chapter 3. The DTREE Procedure
Example 3.3. Contract Bidding Problem
This example illustrates the use of several of the graphics options for producing
graphics quality decision tree diagrams.
The production manager of a manufacturing company is planning to bid on a project
to manufacture a new type of machine. He has the choice of bidding low or high. The
evaluation of the bid will more likely be favorable if the bidder has built a prototype
of the machine and includes it with the bid. However, he is uncertain about the cost of
building the prototype. His technical staff has provided him a probability distribution
on the cost of the prototype.
Table 3.33. Probability on the Cost of Building Prototype
Outcome Cost Probability
Expensive $4, 500 0.4
Moderate $2, 500 0.5
Inexpensive $1, 000 0.1
There is also uncertainty in whether he will win the contract or not. He has estimated
the probability distribution of winning the contract as shown in Table 3.34.
Table 3.34. Probability of Winning the Contract
Events
Givens Win the Contract Lose the Contract
Build Prototype High Bid 0.4 0.6
Build Prototype Low Bid 0.8 0.2
No Prototype High Bid 0.2 0.8
No Prototype Low Bid 0.7 0.3
In addition, the payoffs of this bidding venture are affected by the cost of building the
prototype. Table 3.35 shows his payoffs. The rst row of the table shows the payoff
is 0 if he loses the contract, regardless of whether or not he builds the prototype and
whether he bids low or high. The remainder of the entries in the table give the payoff
under the various scenarios.
Table 3.35. The Payoffs of the Contract Bidding Decision
States Actions
Result Cost Bid low Bid high
Lose the Contract 0 0
Win the Contract $35, 000 $75, 000
Win the Contract Expensive $25, 000 $65, 000
Win the Contract Moderate $35, 000 $75, 000
Win the Contract Inexpensive $45, 000 $85, 000
The production manager must decide whether to build the prototype and how to bid.
He uses PROC DTREE to help him to make these decisions. The structure of the
model is stored in the STAGEIN= data set named Stage3. There are two decision
stages, Choose and Bid, and two chance stages, Cost_Prototype and
Contract. The Choose stage represents the decision whether or not to
Example 3.3. Contract Bidding Problem
377
build a prototype. The chance stage Cost_Prototype represents the uncer-
tain cost for building a prototype. It can be Expensive, which costs $4, 500,
or Moderate, which costs $2, 500, or Inexpensive, which costs $1, 000.
The Bid stage represents the decision whether to bid high or bid low. The last
stage, Contract, represents the result, either win the contract or lose the con-
tract.
/* -- create the STAGEIN= data set -- */
data Stage3;
format _STNAME_ $14. _STTYPE_ $2. _OUTCOM_ $15.
_SUCCES_ $14. _REWARD_ dollar8.0 ;
input _STNAME_ $ _STTYPE_ $ _OUTCOM_ $
_SUCCES_ $ _REWARD_ dollar8.0;
datalines;
Choose D Build_Prototype Cost_Prototype .
. . No_Prototype Bid .
Cost_Prototype C Expensive Bid -$4,500
. . Moderate Bid -$2,500
. . Inexpensive Bid -$1,000
Bid D High_Bid Contract .
. . Low_Bid Contract .
Contract C Win_Contract . .
. . Lose_Contract . .
;
The PROBIN= data set, named Prob3, contains the probability information as in
Table 3.33 (page 376) and Table 3.34 (page 376).
/* -- create the PROBIN= data set -- */
data Prob3;
format _GIVEN1_ $15. _EVENT_ $14. ;
input (_GIVEN1_ _GIVEN2_ _EVENT_) ($) _PROB_;
datalines;
. . Expensive 0.4
. . Moderate 0.5
. . Inexpensive 0.1
Build_Prototype High_Bid Win_Contract 0.4
Build_Prototype High_Bid Lose_Contract 0.6
Build_Prototype Low_Bid Win_Contract 0.8
Build_Prototype Low_Bid Lose_Contract 0.2
No_Prototype High_Bid Win_Contract 0.2
No_Prototype High_Bid Lose_Contract 0.8
No_Prototype Low_Bid Win_Contract 0.7
No_Prototype Low_Bid Lose_Contract 0.3
;
The PAYOFFS= data set named Payoff3 contains the payoff information as in Table
3.35 on page 376. Notice that the payoff to outcome Lose_Contract is not in
the data set Payoff3. Since PROC DTREE assigns the default value 0 to all scenarios
that are not in the PAYOFFS= data set, it is not necessary to include it.
378
Chapter 3. The DTREE Procedure
/* -- create the PAYOFFS= data set -- */
data Payoff3;
format _STATE1_ _STATE2_ $12.;
input (_STATE1_ _STATE2_ _ACTION_) ($)
_VALUE_ dollar8.0;
datalines;
Win_Contract . Low_Bid $35,000
Win_Contract . High_Bid $75,000
Win_Contract Expensive Low_Bid $25,000
Win_Contract Expensive High_Bid $65,000
Win_Contract Moderate Low_Bid $35,000
Win_Contract Moderate High_Bid $75,000
Win_Contract Inexpensive Low_Bid $45,000
Win_Contract Inexpensive High_Bid $85,000
;
The solution, as in Output 3.3.1 on page 379, is displayed on a graphics device with
the following code. Notice that the title is specied before invoking PROC DTREE.
The GRAPHICS option is given on the PROC DTREE statement. Specifying the
COMPRESS option in the TREEPLOT statement causes the decision tree diagram to
be drawn completely on one page. The vertical distance between two successive end
nodes is 1 character cell (ybetween=1 cell). All text, except that in the rst title
line is drawn with font SWISS and height 1 character cell. The height for all nodes is
3 character cells, which is specied by the HSYMBOL= option. The thickness for all
links in the diagram, except those that represent optimal decisions, is specied by the
LWIDTH= option as 20. The thickness of the links that represent optimal decisions
is specied as 25 (lwidthb=25) , and the type of those links is 3 (lstyleb=3), the
dash line. Colors for the text, links and nodes, and symbols to be used for nodes are
not specied and hence defaults are used.
/* -- define title -- */
title1 font=swissb h=2 "Contract Bidding Example" ;
/* -- PROC DTREE statements -- */
proc dtree stagein=Stage3 probin=Prob3 payoffs=Payoff3
graphics
nowarning
;
evaluate;
treeplot / name="dt3" compress ybetween=1 cell
ftext=swiss htext=1 hsymbol=3
lstyleb=3 lwidth=20 lwidthb=25;
quit;
Example 3.3. Contract Bidding Problem
379
Output 3.3.1. Decision Tree for the Contract Bidding Problem
380
Chapter 3. The DTREE Procedure
With the information on this decision tree, the production manager can select the
optimal bidding strategy:
He should build a prototype to accompany the bid and always bid high unless
the cost for building the prototype is as low as $1, 000. This optimal strategy
yields an expected return of $25, 850.
If no prototype is built, the preferred decision is to make a low bid. In this case
the expected return is $24, 500.
Example 3.4. Research and Development Decision Problem
This example illustrates the use of the SYMBOL and GOPTIONS statements for con-
trolling the appearance of the decision tree diagram. It also uses the ANNOTATE=
option to add a customized legend to the diagram.
A typical problem encountered in a research and development setting involves two
decisions: whether or not to conduct research, and whether or not to commercialize
the results of that research. Suppose that research and development for a specic
project will cost $350, 000, and there is a 0.4 probability that it will fail. Also suppose
that the different levels of market success and their corresponding probabilities are:
Table 3.36. Levels of Market Success and Their Probabilities
Market Success Net Return Probability
Great $1, 000, 000 0.25
Good $500, 000 0.35
Fair $200, 000 0.30
Poor -$250, 000 0.10
The structure of the model is represented in the STAGEIN= data set Stage4.
/* -- create the STAGEIN= data set -- */
data Stage4;
format _STNAME_ $10. _STTYPE_ $2. _OUTCOM_ $12.
_REWARD_ dollar12.0 _SUCC_ $10.;
input _STNAME_ $ _STTYPE_ $ _OUTCOM_ $
_REWARD_ dollar12.0 _SUCC_ $ ;
datalines;
R_and_D D Not_Conduct . .
. . Conduct -$350,000 RD_Outcome
RD_Outcome C Success . Production
. . Failure . .
Production D Produce . Sales
. . Abandon . .
Sales C Great . .
. . Good . .
. . Fair . .
. . Poor . .
;
Example 3.4. Research and Development Decision Problem
381
The probability distributions for the various outcomes of the chance stages are given
in the PROBIN= data set named Prob4.
/* -- create the PROBIN= data set -- */
data Prob4;
input _EVENT1_ $ _PROB1_ _EVENT2_ $ _PROB2_;
datalines;
Success 0.6 Failure 0.4
Great 0.25 Good 0.35
Fair 0.30 poor 0.1
;
The payoffs are given in the PAYOFFS= data set Payoff4.
/* -- create the PAYOFFS= data set -- */
data Payoff4;
input _STATE_ $ _VALUE_ dollar12.0;
datalines;
Great $1,000,000
Good $500,000
Fair $200,000
Poor -$250,000
;
The following DATA step builds a data set that contains the Annotate description
of a legend. Refer to the chapter on the annotate facility in SAS/GRAPH Software:
Reference for a description of the Annotate facility.
/* -- create the ANNOTATE= data set for legend -- */
data Legends;
length FUNCTION STYLE $ 8;
WHEN = B; POSITION=0;
XSYS=4; YSYS=4;
input FUNCTION $ X Y STYLE $ SIZE COLOR $ TEXT $ & 16.;
datalines;
move 8 2.1 . . . .
draw 12 2.1 . 8 black .
label 14 2 swiss 0.7 black BEST ACTION
symbol 9 3.5 marker 0.7 black A
label 14 3.2 swiss 0.7 black END NODE
symbol 9 4.7 marker 0.7 black P
label 14 4.4 swiss 0.7 black CHANCE NODE
symbol 9 5.9 marker 0.7 black U
label 14 5.6 swiss 0.7 black DECISION NODE
label 8 7.0 swiss 0.7 black LEGEND:
move 5 8.5 . . black .
draw 27 8.5 . 2 black .
draw 27 1 . 2 black .
draw 5 1 . 2 black .
draw 5 8.5 . 2 black .
;
382
Chapter 3. The DTREE Procedure
The following program invokes PROC DTREE, which evaluates the decision tree and
plots it on a graphics device using the Annotate data set Legends to draw the legend.
/* define symbol characteristics for chance nodes and */
/* links except those that represent optimal decisions */
symbol1 f=marker h=2 v=P c=black w=5 l=1;
/* define symbol characteristics for decision nodes */
/* and links that represent optimal decisions */
symbol2 f=marker h=2 v=U c=black w=10 l=1;
/* define symbol characteristics for end nodes */
symbol3 f=marker h=2 v=A c=black;
/* -- define title -- */
title f=swissb h=2 Research and Development Decision;
/* -- PROC DTREE statements -- */
proc dtree stagein=Stage4 probin=Prob4 payoffs=Payoff4
criterion=maxce rt=1800000
graphics annotate=Legends nolegend;
evaluate;
treeplot / linka=1 linkb=2 symbold=2 symbolc=1 symbole=3
compress name="dt4";
quit;
The SYMBOL1, SYMBOL2, and SYMBOL3 statements create three SYMBOL def-
initions that contain information for drawing nodes and links. The Legends data
set and the ANNOTATE= option specied in the PROC DTREE statement cause
the procedure to produce a customized legend for the decision tree diagram. The
LINKA=, LINKB=, SYMBOLD=, SYMBOLC=, and SYMBOLE= specications in
the TREEPLOT statement tell PROC DTREE how to use SYMBOL denitions to
draw decision tree. Table 3.37 on page 383 describes the options in SYMBOL de-
nitions used to draw the decision tree diagram.
The decision tree diagram produced by the TREEPLOT statement is shown in Output
3.4.1 (page 383). As illustrated on the decision tree, the program recommends that
one should not conduct the research and development of the product if he or she is
risk averse with a risk tolerance of $1, 800, 000. However, if he or she decides to
undertake the research and development and it is a success, then he or she should
commercialize the product.
Example 3.4. Research and Development Decision Problem
383
Table 3.37. The Usage of SYMBOL Denitions
SYMBOL Denition Specication Description Used to Draw
The First C=black Color All links except
L=1 Line Type those that indicate
W=5 Thickness optimal decisions
C=black Color Chance nodes
F=marker Font
H=2 Height
V=P Symbol
The Second C=black Color All links that
L=1 Line Type indicate optimal
W=10 Thickness decisions
C=black Color Decision nodes
F=marker Font
H=2 Height
V=U Symbol
The Third C=black Color End nodes
F=marker Font
H=2 Height
V=A Symbol
Output 3.4.1. Research and Development Decision Tree
384
Chapter 3. The DTREE Procedure
Example 3.5. Loan Grant Decision Problem
Many nancial decisions are difcult to analyze because of the variety of available
strategies and the continuous nature of the problem. However, if the alternatives and
time frame can be restricted, then decision analysis can be a useful analysis tool.
For example, a loan ofcer is faced with the problem of deciding whether to approve
or deny an application for a one-year $30, 000 loan at the current rate of 15% of
interest. If the application is approved, the borrower will either pay off the loan in full
after one year or default. Based on experience, the default rate is about 36 out of 700.
If the loan is denied, the money is put in government bonds at the interest rate of 8%.
To obtain more information about the applicant, the loan ofcer engages a credit
investigation unit at a cost of $500 per person that will give either a positive recom-
mendation for making a loan or a negative recommendation. Past experience with
this investigator yields that of those who ultimately paid off their loans, 570 out of
664 were given a positive recommendation. On the other hand, 6 out of 26 that had
defaulted had also been given a positive recommendation by the investigator.
The STAGEIN= data set, Stage6, gives the structure of the decision problem.
/* -- create the STAGEIN= data set -- */
data Stage6;
format _STNAME_ $14. _STTYPE_ $2. _OUTCOM_ $20. _SUCC_ $14. ;
input _STNAME_ $ _STTYPE_ $ _OUTCOM_ & _SUCC_ $ ;
datalines;
Application D Approve loan Payment
. . Deny loan .
Payment C Pay off .
. . Default .
Investigation D Order investigation Recommendation
. . Do not order Application
Recommendation C Positive Application
. . Negative Application
;
The PROBIN= data set Prob6 gives the probability distributions for the random
events at the chance nodes.
/* -- create the PROBIN= data set -- */
data Prob6;
length _GIVEN_ _EVENT1_ _EVENT2_ $16;
_EVENT1_=Pay off; _EVENT2_=Default;
_PROB1_=664/700; _PROB2_=1.0-_PROB1_;
output;
_GIVEN_=Pay off;
_EVENT1_=Positive; _EVENT2_=Negative;
_PROB1_=570/664; _PROB2_=1.0-_PROB1_;
output;
Example 3.5. Loan Grant Decision Problem
385
_GIVEN_=Default;
_EVENT1_=Positive; _EVENT2_=Negative;
_PROB1_=6/26; _PROB2_=1.0-_PROB1_;
output;
run;
The PAYOFFS= data set Payoff6 gives the payoffs for the various scenarios. Notice
that the rst observation in this data set indicates that if the ofcer denies the loan
application, then payoffs are the interest from the money invested in government
bonds. The second and the third observations are redundant for the basic analysis but
are needed to determine the value of information as shown later.
/* -- create the PAYOFFS= data set -- */
data Payoff6(drop=loan);
length _STATE_ _ACT_ $24;
loan=30000;
_ACT_=Deny loan; _VALUE_=loan*0.08; output;
_STATE_=Pay off; _VALUE_=loan*0.08; output;
_STATE_=Default; _VALUE_=loan*0.08; output;
_ACT_=Approve loan;
_STATE_=Pay off; _VALUE_=loan*0.15; output;
_STATE_=Default; _VALUE_=-1.0*loan; output;
run;
The following code invokes the DTREE procedure to solve this decision problem.
/* -- define title -- */
title Loan Grant Decision;
/* -- PROC DTREE statements -- */
proc dtree
stagein=Stage6 probin=Prob6 payoffs=Payoff6
summary target=investigation nowarning;
modify Order investigation reward -500;
evaluate;
OPTIONS LINESIZE=85;
summary / target=Application;
OPTIONS LINESIZE=80;
Note that the $500 investigation fee is not included in the Stage6 data set. Since
the outcome Order investigation is the only outcome that has a nonzero
386
Chapter 3. The DTREE Procedure
reward, it is easier to set the reward for this outcome using the MODIFY statement.
The quotes that enclose the outcome name in the MODIFY statement are necessary
because the outcome name contains a space.
The results in Output 3.5.1 and Output 3.5.2 indicate that it is optimal to do the
following:
The loan ofcer should order the credit investigation and approve the loan ap-
plication if the investigator gives the applicant a positive recommendation. On
the other hand, he should deny the application if a negative recommendation is
given to the applicant.
Furthermore, the loan ofcer should order a credit investigation if the cost for
the investigation is less than $3, 725 $2, 726 = $999.
Output 3.5.1. Summary of the Loan Grant Decision for Investigation
Loan Grant Decision
The DTREE Procedure
Optimal Decision Summary
Order of Stages
Stage Type
--------------------------
Investigation Decision
Recommendation Chance
Application Decision
Payment Chance
_ENDST_ End
Decision Parameters
Decision Criterion: Maximize Expected Value (MAXEV)
Optimal Decision Yields: 3225
Optimal Decision Policy
Up to Stage Investigation
Alternatives Cumulative Evaluating
or Outcomes Reward Value
-----------------------------------------------
Order investigation -500 3725*
Do not order 0 2726
Example 3.5. Loan Grant Decision Problem
387
Output 3.5.2. Summary of the Loan Grant Decision for Application
Loan Grant Decision
The DTREE Procedure
Optimal Decision Summary
Order of Stages
Stage Type
--------------------------
Investigation Decision
Recommendation Chance
Application Decision
Payment Chance
_ENDST_ End
Decision Parameters
Decision Criterion: Maximize Expected Value (MAXEV)
Optimal Decision Yields: 3225
Optimal Decision Policy
Up to Stage Application
Cumulative Evaluating
Alternatives or Outcomes Reward Value
-------------------------------------------------------------------------------------
Order investigation Positive Approve loan -500 4004*
Order investigation Positive Deny loan -500 2400
Order investigation Negative Approve loan -500 -3351
Order investigation Negative Deny loan -500 2400*
Do not order Approve loan 0 2726*
Do not order Deny loan 0 2400
Now, the loan ofcer learns of another credit investigation company that claims to
have a more accurate credit checking system for predicting whether the applicants
will default on their loans. However, he has not been able to nd out what the
company charges for their service or how accurate their credit checking system is.
Perhaps the best thing he can do at this stage is to assume that the company can pre-
dict perfectly whether or not applicants will default on their loans and determine the
maximum amount to pay for this perfect investigation. The answer to this question
can be found with the PROC DTREE statements:
save;
move payment before investigation;
evaluate;
recall;
Notice that moving the stage Payment to the beginning of the tree means
that the new decision tree contains two scenarios that are not in the original tree:
the scenario Pay off and Deny loan, and the scenario Default and
Deny loan. The second and third observations in the Payoff6 data set supply
values for these new scenarios. If these records are not included in the PAYOFFS=
data set, then PROC DTREE assumes they are 0.
Also notice that the SUMMARY and TARGET= options are specied globally in the
PROC DTREE statement and hence are not needed in the EVALUATE statement.
The results from the DTREE procedure are displayed in Output 3.5.3.
388
Chapter 3. The DTREE Procedure
Output 3.5.3. Summary of the Loan Grant Decision with Perfect Information
Loan Grant Decision
The DTREE Procedure
Optimal Decision Summary
Order of Stages
Stage Type
--------------------------
Payment Chance
Investigation Decision
Recommendation Chance
Application Decision
_ENDST_ End
Decision Parameters
Decision Criterion: Maximize Expected Value (MAXEV)
Optimal Decision Yields: 4392
Optimal Decision Policy
Up to Stage Investigation
Cumulative Evaluating
Alternatives or Outcomes Reward Value
----------------------------------------------------------------------
Pay off Order investigation -500 4500
Pay off Do not order 0 4500*
Default Order investigation -500 2400
Default Do not order 0 2400*
The optimal decision summary in Output 3.5.3 shows that the yields with perfect in-
vestigation is $4, 392. Recall that the yield of alternative Do not order the
investigation, as shown in Output 3.5.1 on page 386, is $2, 726. Therefore, the max-
imum amount he should pay for the perfect investigation can be determined easily
as
VPI = Value with Perfect Investigation Value without Investigation
= $4, 392 $2, 726
= $1, 666
Note that if you use the VPI statement to determine the value of a perfect investiga-
tion, the result is different from the value calculated previously.
vpi payment;
Example 3.5. Loan Grant Decision Problem
389
NOTE: The currently optimal decision yields 3225.4725275.
NOTE: The new optimal decision yields 4392.
NOTE: The value of perfect information of stage Payment
yields 1166.5274725.
The reason for this difference is that the VPI statement causes PROC DTREE rst
to determine the value with perfect information, then to compare this value with the
value with current information available (in this example, it is the recommendation
from the original investigation unit). Therefore, the VPI statement returns a value
that is calculated as
VPI = Value with Perfect Information Value with Current Information
= $4, 392 $3, 225
= $1, 167
The loan ofcer considered another question regarding the maximum amount he
should pay to a company to help collect the principal and the interest if an appli-
cant defaults on the loan. This question is similar to the question concerning the
improvement that can be expected if he can control whether or not an applicant will
default on his loan (of course he will always want the applicant to pay off in full after
one year). The answer to this question can be obtained with the following statements:
modify payment type;
evaluate;
390
Chapter 3. The DTREE Procedure
Output 3.5.4. Summary of the Loan Grant Decision with Perfect Control
Loan Grant Decision
The DTREE Procedure
Optimal Decision Summary
Order of Stages
Stage Type
--------------------------
Investigation Decision
Recommendation Chance
Application Decision
Payment Decision
_ENDST_ End
Decision Parameters
Decision Criterion: Maximize Expected Value (MAXEV)
Optimal Decision Yields: 4500
Optimal Decision Policy
Up to Stage Investigation
Alternatives Cumulative Evaluating
or Outcomes Reward Value
-----------------------------------------------
Order investigation -500 4500
Do not order 0 4500*
The result is obvious and is shown in Output 3.5.4. Using a calculation similar to
the one used to calculate the value of a perfect investigation, the maximum amount
one should pay for this kind of service is $4, 500 $2, 726 = $1, 774. As previously
described, this value is different from the value obtained by using the VPC statement.
In fact, if you specify the statement
vpc payment;
you get the value of VPC, which is $1, 274.53, from the SAS log as
NOTE: The currently optimal decision yields 3225.4725275.
NOTE: The new optimal decision yields 4500.
NOTE: The value of perfect control of stage Payment yields
1274.5274725.
Obviously, all of the values of investigation and other services depend on the value
of the loan. Since each of the payoffs for the various scenarios given in the Payoff6
data set is proportional to the value of loan, you can safely assume that the value of
the loan is 1 unit and determine the ratio of the value for a particular service to the
value of the loan. To obtain these ratios, change the value of the variable LOAN to 1
in the Payoff6 data set and invoke PROC DTREE again as follows:
Example 3.5. Loan Grant Decision Problem
391
/* -- create the alternative PAYOFFS= data set -- */
data Payoff6a(drop=loan);
length _STATE_ _ACT_ $24;
loan=1;
_ACT_=Deny loan; _VALUE_=loan*0.08; output;
_STATE_=Pay off; _VALUE_=loan*0.08; output;
_STATE_=Default; _VALUE_=loan*0.08; output;
_ACT_=Approve loan;
_STATE_=Pay off; _VALUE_=loan*0.15; output;
_STATE_=Default; _VALUE_=-1.0*loan; output;
run;
/* -- PROC DTREE statements -- */
title Loan Grant Decision;
proc dtree
stagein=Stage6 probin=Prob6 payoffs=Payoff6a
nowarning;
evaluate / summary target=investigation;
save;
move payment before investigation;
evaluate;
recall;
modify payment type;
evaluate;
quit;
The optimal decision summary given in Output 3.5.5 shows that the ratio of the value
of investigation that the loan ofcer currently engages in to the value of the loan is
0.1242 0.0909 = 0.0333 to 1.
392
Chapter 3. The DTREE Procedure
Output 3.5.5. Summary of the Loan Grant Decision with 1 Unit Loan
Loan Grant Decision
The DTREE Procedure
Optimal Decision Summary
Order of Stages
Stage Type
--------------------------
Investigation Decision
Recommendation Chance
Application Decision
Payment Chance
_ENDST_ End
Decision Parameters
Decision Criterion: Maximize Expected Value (MAXEV)
Optimal Decision Yields: 0.1242
Optimal Decision Policy
Up to Stage Investigation
Alternatives Cumulative Evaluating
or Outcomes Reward Value
-----------------------------------------------
Order investigation 0.1242*
Do not order 0.0909
The following messages are written to the SAS log:
NOTE: Present order of stages:
Investigation(D), Recommendation(C), Application(D),
Payment(C), _ENDST_(E).
NOTE: The current problem has been successfully saved.
NOTE: Present order of stages:
Payment(C), Investigation(D), Recommendation(C),
Application(D), _ENDST_(E).
NOTE: The currently optimal decision yields 0.1464.
NOTE: The original problem has been successfully recalled.
NOTE: Present order of stages:
Investigation(D), Recommendation(C), Application(D),
Payment(C), _ENDST_(E).
NOTE: The type of stage Payment has been changed.
NOTE: The currently optimal decision yields 0.15.
Example 3.5. Loan Grant Decision Problem
393
The preceding messages show that the ratio of the value of perfect investigation
to the value of a loan is 0.1464 0.0909 = 0.0555 to 1, and the ratio of the
maximum amount the ofcer should pay for perfect control to the value of loan is
0.15 0.0909 = 0.591 to 1.
Output 3.5.6 on page 394, produced by the following statements, shows a table of the
values of the investigation currently engaged in, the values of perfect investigation,
and the values of perfect control for loans ranging from $10, 000 to $100, 000.
/* create the data set for value of loan */
/* and corresponding values of services */
data Datav6(drop=k ratio1 ratio2 ratio3);
label loan="Value of Loan"
vci="Value of Current Credit Investigation"
vpi="Value of Perfect Credit Investigation"
vpc="Value of Perfect Collecting Service";
/* calculate ratios */
ratio1=0.1242-0.0909;
ratio2=0.1464-0.0909;
ratio3=0.15-0.0909;
Loan=0;
do k=1 to 10;
/* set the value of loan */
loan=loan+10000;
/* calculate the values of various services */
vci=loan*ratio1;
vpi=loan*ratio2;
vpc=loan*ratio3;
/* output current observation */
output;
end;
run;
/* print the table of the value of loan */
/* and corresponding values of services */
title Value of Services by Value of Loan;
proc print label;
format loan vci vpi vpc dollar12.0;
run;
394
Chapter 3. The DTREE Procedure
Output 3.5.6. Values of Loan and Associated Values of Service
Value of Services by Value of Loan
Value of Value of Value of
Current Perfect Perfect
Value of Credit Credit Collecting
Obs Loan Investigation Investigation Service
1 $10,000 $333 $555 $591
2 $20,000 $666 $1,110 $1,182
3 $30,000 $999 $1,665 $1,773
4 $40,000 $1,332 $2,220 $2,364
5 $50,000 $1,665 $2,775 $2,955
6 $60,000 $1,998 $3,330 $3,546
7 $70,000 $2,331 $3,885 $4,137
8 $80,000 $2,664 $4,440 $4,728
9 $90,000 $2,997 $4,995 $5,319
10 $100,000 $3,330 $5,550 $5,910
Example 3.6. Petroleum Distributors Decision Problem
The president of a petroleum distribution company currently faces a serious problem.
His company supplies rened products to its customers under long-term contracts
at guaranteed prices. Recently, the price for petroleum has risen substantially and
his company will lose $450, 000 this year because of its long-term contract with a
particular customer. After a great deal of discussion with his legal advisers and his
marketing staff, the president learns that the contract contains a clause that may be
benecial to his company. The clause states that when circumstances are beyond its
control, the company may ask its customers to pay the prevailing market prices for
up to 10% of the promised amount.
Several scenarios are possible if the clause is invoked. If the customer accepts the
invocation of the clause and agrees to pay the higher price for the 10%, the company
would turn a loss of $450, 000 into a net prot of $600, 000. If the customer does
not accept the invocation, the customer may sue for damages or accept a settlement
of $900, 000 (resulting in a loss of $400, 000) or simply decline to press the issue. In
any case, the distribution company could then sell the 10% on the open market for
an expected value of $500, 000. However, the lawsuit would result in one of three
possible outcomes: the company wins and pays no damages; the company loses and
pays normal damages of $1, 500, 000; the company loses and pays double damages
of $3, 000, 000. The lawyers also feel that this case might last three to ve years if the
customer decides to sue the company. The cost of the legal proceedings is estimated
as $30, 000 for the initial fee and $20, 000 per year. The likelihood of the various
outcomes are also assessed and reported as in Table 3.38. Suppose that the company
decides to use a discount rate of 10% to determine the present value of future funds.
Example 3.6. Petroleum Distributors Decision Problem
395
Table 3.38. Likelihood of the Outcomes in the Petroleum Distributors Decision
Uncertainty Outcome Probability
Customers Response Accept the Invocation 0.1
Reject the Invocation 0.9
Customers Action Press the Issue 0.1
if the Invocation Settle the Case 0.45
is being Rejected Sue for Damages 0.45
Case Last 3 Years 0.3
4 Years 0.4
5 Years 0.3
Lawsuit Result Pay No Damages 0.15
Pay Normal Damages 0.65
Pay Double Damages 0.2
The structure for this decision problem is given in the STAGEIN= data set named
Stage7.
/* -- create the STAGEIN= data set -- */
data Stage7;
format _OUTCOM1 $14. _OUTCOM2 $14. ;
input _STNAME_ $ _STTYPE_ $ _OUTCOM1 $
_SUCC1 $ _OUTCOM2 $ _SUCC2 $ ;
datalines;
Action D Invoking Response Not_Invoking .
Response C Accept . Refuse Lawsuit
Lawsuit C Press_Issue . Settle .
. . Sue Last . .
Last C 3_Years Result 4_Years Result
. . 5_Years Result . .
Result C No_Damages . Normal_Damages .
. . Double_Damages . . .
;
The PROBIN= data set Prob7 contains the probability distributions for the chance
nodes.
/* -- create the PROBIN= data set -- */
data Prob7;
format _EVENT1_ _EVENT2_ $14.;
input _EVENT1_ $ _PROB1_ _EVENT2_ $ _PROB2_ ;
datalines;
Accept 0.1 Refuse 0.9
Press_Issue 0.1 Settle 0.45
Sue 0.45 . .
3_Years 0.3 4_Years 0.4
5_Years 0.3 . .
No_Damages 0.15 Normal_Damages 0.65
Double_Damages 0.20 . .
;
396
Chapter 3. The DTREE Procedure
The PAYOFFS= data set Payoff7 denes the payoffs for the various scenarios.
/* -- create the PAYOFFS= data set -- */
data Payoff7(drop=i j k D PCOST);
length _ACTION_ _STATE1-_STATE4 $16;
/* possible outcomes for the case last */
array YEARS{3} $16. _TEMPORARY_ (3_Years,
4_Years,
5_Years );
/* numerical values for the case last */
array Y{3} _TEMPORARY_ (3, 4, 5);
/* possible outcomes for the size of judgment */
array DAMAGES{3} $16. _TEMPORARY_ (No_Damages,
Normal_Damages,
Double_Damages );
/* numerical values for the size of judgment */
array C{3} _TEMPORARY_ (0, 1500, 3000);
D=0.1; /* discount rate */
/* payoff for the scenario which the */
/* 10 percent clause is not invoked */
_ACTION_=Not_Invoking; _VALUE_=-450; output;
/* the clause is invoked */
_ACTION_=Invoking;
/* payoffs for scenarios which the clause is */
/* invoked and the customer accepts the */
/* invocation */
_STATE1=Accept; _VALUE_=600; output;
/* the customer refuses the invocation */
_STATE1=Refuse;
/* payoffs for scenarios which the clause is */
/* invoked and the customer refuses the */
/* invocation but decline to press the issue */
_STATE2=Press_Issue; _VALUE_=500; output;
/* payoffs for scenarios which the clause is */
/* invoked and the customer refuses the */
/* invocation but willing to settle out of */
/* court for 900K */
_STATE2=Settle; _VALUE_=500-900; output;
Example 3.6. Petroleum Distributors Decision Problem
397
/* the customer will sue for damages */
_STATE2=Sue;
do i=1 to 3;
_STATE3=YEARS{i};
/* determine the cost of proceedings */
PCOST=30; /* initial cost of the proceedings */
/* additional cost for every years in */
/* in present value */
do k=1 to Y{i};
PCOST=PCOST+(20/((1+D)**k));
end;
/* loop for all poss. of the lawsuit result */
do j=1 to 3;
_STATE4=DAMAGES{j}; /* the damage have to paid */
/* compute the net return in present value */
_VALUE_=500-PCOST-(C{j}/((1+D)**Y{i}));
/* output an observation for the payoffs */
/* of this scenario */
output;
end;
end;
run;
/* -- print the payoff table -- */
title "Petroleum Distributors Decision";
title3 "Payoff table";
proc print;
run;
The payoff table of this problem is displayed in Output 3.6.1.
398
Chapter 3. The DTREE Procedure
Output 3.6.1. Payoffs for the Petroleum Distributors Problem
Petroleum Distributors Decision
Payoff table
Obs _ACTION_ _STATE1 _STATE2 _STATE3 _STATE4 _VALUE_
1 Not_Invoking -450.00
2 Invoking Accept 600.00
3 Invoking Refuse Press_Issue 500.00
4 Invoking Refuse Settle -400.00
5 Invoking Refuse Sue 3_Years No_Damages 420.26
6 Invoking Refuse Sue 3_Years Normal_Damages -706.71
7 Invoking Refuse Sue 3_Years Double_Damages -1833.68
8 Invoking Refuse Sue 4_Years No_Damages 406.60
9 Invoking Refuse Sue 4_Years Normal_Damages -617.92
10 Invoking Refuse Sue 4_Years Double_Damages -1642.44
11 Invoking Refuse Sue 5_Years No_Damages 394.18
12 Invoking Refuse Sue 5_Years Normal_Damages -537.20
13 Invoking Refuse Sue 5_Years Double_Damages -1468.58
Note that the payoffs of the various scenarios in Output 3.6.1 are in thousands of
dollars and are net present values (NPV) (Baird 1989). For example, the payoff for
the following scenario invoking the clause; the customer refuses to accept this and
sues for damages; the case lasts four years and the petroleum distribution company
loses and pays double damages is calculated as
Payoff = 500 NPV of proceedings cost
NPV of damages of 3,000,000
= 1642.44
where
NPV of proceedings cost = 30 +
4
k=1
20/(1 + 0.1)
k
and
NPV of damages of 3, 000, 000 = 3000/(1 + 0.1)
4
This is because the company can sell the 10% for $500, 000 immediately and pay the
$3, 000, 000 damages four years from now. The net present value of the proceedings
is determined by paying the $30, 000 initial fee now and a fee of $20, 000 after every
year up to four years. The value of 0.1 is the discount rate used.
Example 3.6. Petroleum Distributors Decision Problem
399
The following statements evaluate the problem and plot the optimal solution.
/* -- define colors list -- */
goptions colors=(black);
/* -- define title -- */
title f=zapfb h=2.5 "Petroleum Distributors Decision";
/* -- PROC DTREE statements -- */
proc dtree stagein=Stage7 probin=Prob7 payoffs=Payoff7;
evaluate / summary;
treeplot / graphics compress nolg name="dt6p1"
ybetween=1 cell lwidth=8 lwidthb=20 hsymbol=3;
quit;
The optimal decision summary in Output 3.6.2 suggests that the president should
invoke the 10% clause because it would turn a loss of $450, 000 into an expected loss
of $329, 000 in present value.
Output 3.6.2. Summary of the Petroleum Distributors Decision
Petroleum Distributors Decision
The DTREE Procedure
Optimal Decision Summary
Order of Stages
Stage Type
--------------------
Action Decision
Response Chance
Lawsuit Chance
Last Chance
Result Chance
_ENDST_ End
Decision Parameters
Decision Criterion: Maximize Expected Value (MAXEV)
Optimal Decision Yields: -329
Optimal Decision Policy
Up to Stage Action
Alternatives Cumulative Evaluating
or Outcomes Reward Value
------------------------------------------
Invoking -329*
Not_Invoking -450
The decision tree for this problem is shown in Output 3.6.3. There you can nd the
expected value of each scenario.
400
Chapter 3. The DTREE Procedure
Output 3.6.3. Decision Tree for the Petroleum Distributors Decision
Example 3.6. Petroleum Distributors Decision Problem
401
The president feels that the estimated likelihood of lawsuit outcomes is fairly reliable.
However, the assessment of the likelihood of the customers response and reaction is
extremely difcult to estimate. Because of this, the president would like to keep the
analysis as general as possible. His staff suggests using the symbols p and q to rep-
resent the probability that the customer will accept the invocation and the probability
that the customer will decline to press the issue if he refuses the invocation, respec-
tively. The probabilities of the other possible outcomes about the customers response
and reaction to the invocation of the 10% clause are listed in Table 3.39.
Table 3.39. Probabilities of the Petroleum Distributors Decision
Uncertainty Outcome Probability
Customers Response Accept the Invocation p
Reject the Invocation 1 p
Customers Action Press the Issue q
if the Invocation Settle the Case (1 q)/2
is being Rejected Sue for Damages (1 q)/2
Now from the decision tree shown in Output 3.6.3 on page 400, the expected value
of the outcome Refuse is
EV = 500q 400(1 q)/2 672(1 q)/2
= 500q 200 + 200q 336 + 336q
= 1036q 536
Hence, the expected payoff if the petroleum distribution company invokes the clause
is
EV = 600p + (1036q 536)(1 p)
= 1136p + 1036q 1036pq 536
= 1136p + 1036(1 p)q 536
Therefore, the president should invoke the 10% clause if
1136p + 1036(1 p)q 536 > 450
or
q >
86 1136p
1036 1036p
402
Chapter 3. The DTREE Procedure
This result is depicted in Output 3.6.4 on page 403, which is produced by the follow-
ing statements:
/* -- create data set for decision diagram -- */
data Data7(drop=i);
P=0.0; /* initialize P */
/* loop for all possible values of P */
do i=1 to 21;
/* determine the corresponding Q */
Q=(86-(1136*P))/(1036*(1.0-P));
if Q < 0.0 then Q=0.0;
/* output this data point */
output;
/* set next possible value of P */
P=P+0.005;
end;
run;
/* create the ANNOTATE= data set for labels of */
/* decision diagram */
data label;
length FUNCTION STYLE COLOR $8;
length XSYS YSYS $1;
length WHEN POSITION $1;
length X Y 8;
length SIZE ROTATE 8;
WHEN = A;
POSITION=0;
XSYS=2;
YSYS=2;
input FUNCTION $ X Y STYLE $ SIZE COLOR $
ROTATE TEXT $ & 16.;
datalines;
label 0.01 0.04 centx 2 black . Do Not
label 0.01 0.03 centx 2 black . Invoke
label 0.01 0.02 centx 2 black . The Clause
label 0.06 0.06 centx 2 black . Invoke The
label 0.06 0.05 centx 2 black . Clause
;
/* -- set graphics environment -- */
goptions lfactor=3;
Example 3.6. Petroleum Distributors Decision Problem
403
/* -- define symbol characteristics for boundary -- */
symbol1 i=joint v=NONE l=1 ci=black;
/* -- define pattern for area fill -- */
pattern1 value=M2N0 color=black;
pattern2 value=M2N90 color=black;
/* -- define axis characteristics -- */
axis1 label=(Pr(Accept the Invocation))
order=(0 to 0.1 by 0.01) minor=none;
axis2 label=(angle=90 Pr(Press the Issue))
order=(0 to 0.1 by 0.01) minor=none;
/* -- plot decision diagram -- */
title h=2.5 "Petroleum Distributors Decision";
proc gplot data=Data7 ;
plot Q*P=1 / haxis=axis1
vaxis=axis2
annotate=label
name="dt6p2"
frame
areas=2;
run;
quit;
Output 3.6.4. Decision Diagram for the Petroleum Distributors Problem
404
Chapter 3. The DTREE Procedure
The decision diagram in Output 3.6.4 is an analysis of the sensitivity of the solution
to the probabilities that the customer will accept the invocation and that the customer
will decline to press the issue. He should invoke the clause if he feels the customers
probabilities of outcomes Accept and Press_Issue, p and q, are located
in the upper-right area marked as Invoke The Clause in Output 3.6.4 and
should not invoke the clause otherwise. Note that the values p = 0.1 and q = 0.1
used in this example are located on the upper right corner on the diagram.
Statement and Option Cross-Reference Tables
The following tables reference the statements and options in the DTREE procedure
(except the PROC DTREE statement and the QUIT statement) that are illustrated by
the examples in this section.
Table 3.40. Statements Specied in Examples
Examples
Statement 1 2 3 4 5 6
EVALUATE X X X X X X
MODIFY X
MOVE X
RECALL X
RESET X
SAVE X
SUMMARY X X X
TREEPLOT X X X
VARIABLES X
VPC X
VPI X
Statement and Option Cross-Reference Tables
405
Table 3.41. Options Specied in Examples
Examples
Option 1 2 3 4 5 6
ANNOTATE= X
COMPRESS X X X
CRITERION= X X X
EVENT= X
FTEXT= X X
GRAPHICS X X X
HSYMBOL= X X
HTEXT= X
LINKA= X
LINKB= X
LINKC=
LSTYLEB= X
LWIDTH= X X
LWIDTHB= X X
NAME= X X X
NOLEGEND X X
NOWARNING X X X X
OUTCOME= X
PAYOFFS= X X X X X X
PROB= X
PROBIN= X X X X X X
REWARD= X
RT= X X X
STAGE= X
STAGEIN= X X X X X X
STATE= X
SUCCESSOR= X
SUMMARY X X
SYMBOLC= X
SYMBOLD= X
SYMBOLE= X
TARGET= X X X
TYPE= X
VALUE= X
YBETWEEN= X X
406
Chapter 3. The DTREE Procedure
References
Baird, B. F. (1989), Managerial Decisions Under Uncertainty: An Introduction to
the Analysis of Decision Making, New York: John Wiley and Sons, Inc.
Howard, R. A. (1968), The Foundations of Decision Analysis, IEEE Transactions
on System Science and Cybernetics, SSC-4, 211219.
Howard, R. A. (1988), Decision Analysis: Practice and Promise, Management
Science, 34, 679695.
Raiffa, H. (1970), Decision Analysis Introductory Lectures on Choices under
Uncertainty, Reading, MA: Addison-Wesley.
Chapter 4
The GANTT Procedure
Chapter Contents
OVERVIEW . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 409
GETTING STARTED . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 412
SYNTAX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 416
Functional Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417
PROC GANTT Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . 421
BY Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 424
CHART Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 424
ID Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 451
DETAILS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 451
Schedule Data Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 451
Missing Values in Input Data Sets . . . . . . . . . . . . . . . . . . . . . . . 453
Specifying the PADDING= Option . . . . . . . . . . . . . . . . . . . . . . 454
Page Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 455
Multiple Calendars and Holidays . . . . . . . . . . . . . . . . . . . . . . . 457
Full-Screen Version . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 458
Graphics Version . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 463
Specifying the Logic Options . . . . . . . . . . . . . . . . . . . . . . . . . 473
Automatic Text Annotation . . . . . . . . . . . . . . . . . . . . . . . . . . 481
Web-Enabled Gantt Charts . . . . . . . . . . . . . . . . . . . . . . . . . . 486
Mode-Specic Differences . . . . . . . . . . . . . . . . . . . . . . . . . . 486
Displayed Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 487
Macro Variable
ORGANTT . . . . . . . . . . . . . . . . . . . . . . . . . 490
Computer Resource Requirements . . . . . . . . . . . . . . . . . . . . . . 491
EXAMPLES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 492
Line-Printer Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 492
Example 4.1. Printing a Gantt Chart . . . . . . . . . . . . . . . . . . . . . . 492
Example 4.2. Customizing the Gantt Chart . . . . . . . . . . . . . . . . . . 496
Graphics Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 499
Example 4.3. Marking Holidays . . . . . . . . . . . . . . . . . . . . . . . . 501
Example 4.4. Marking Milestones and Special Dates . . . . . . . . . . . . . 504
Example 4.5. Using the COMPRESS Option . . . . . . . . . . . . . . . . . 507
Example 4.6. Using the MININTERVAL= and SCALE= Options . . . . . . 508
Example 4.7. Using the MINDATE= and MAXDATE= Options . . . . . . . 511
408
Chapter 4. The GANTT Procedure
Example 4.8. Variable Length Holidays . . . . . . . . . . . . . . . . . . . . 512
Example 4.9. Multiple Calendars . . . . . . . . . . . . . . . . . . . . . . . 516
Example 4.10. Plotting the Actual Schedule . . . . . . . . . . . . . . . . . 519
Example 4.11. Comparing Progress Against a Baseline Schedule . . . . . . 521
Example 4.12. Using the COMBINE Option . . . . . . . . . . . . . . . . . 524
Example 4.13. Plotting the Resource-Constrained Schedule . . . . . . . . . 526
Example 4.14. Specifying the Schedule Data Directly . . . . . . . . . . . . 528
Example 4.15. BY Processing . . . . . . . . . . . . . . . . . . . . . . . . . 531
Example 4.16. Gantt Charts by Persons . . . . . . . . . . . . . . . . . . . . 535
Example 4.17. Using the HEIGHT= and HTOFF= Options . . . . . . . . . 539
Example 4.18. Drawing a Logic Gantt Chart Using AON Representation . . 540
Example 4.19. Specifying the Logic Control Options . . . . . . . . . . . . . 542
Example 4.20. Nonstandard Precedence Relationships . . . . . . . . . . . . 549
Example 4.21. Using the SAS/GRAPH ANNOTATE= Option . . . . . . . . 552
Example 4.22. Using the Automatic Text Annotation Feature . . . . . . . . 557
Example 4.23. Multiproject Gantt Charts . . . . . . . . . . . . . . . . . . . 560
Example 4.24. Multisegment Gantt Charts . . . . . . . . . . . . . . . . . . 563
Example 4.25. Zoned Gantt Charts . . . . . . . . . . . . . . . . . . . . . . 565
Example 4.26. Web-Enabled Gantt Charts . . . . . . . . . . . . . . . . . . 566
Example 4.27. Using the CHARTWIDTH= Option . . . . . . . . . . . . . . 573
Statement and Option Cross-Reference Tables . . . . . . . . . . . . . . . . 577
REFERENCES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 579
Chapter 4
The GANTT Procedure
Overview
The GANTT procedure produces a Gantt chart that is a graphical scheduling tool
for the planning and control of a project. In its most basic form, a Gantt chart is
a bar chart that plots the tasks of a project versus time. PROC GANTT displays a
Gantt chart corresponding to a project schedule such as that produced by the CPM
procedure or one that is input directly to the procedure, and it offers several options
and statements for tailoring the chart to your needs.
Using PROCGANTT, you can plot the predicted early and late schedules and identify
critical, supercritical, and slack activities. In addition, you can visually monitor a
project in progress with the actual schedule and compare the actual schedule against
a target baseline schedule. You can also graphically view the effects of scheduling
a project subject to resource limitations. Any combination of these schedules can
be viewed simultaneously (provided the relevant data exist) together with any user-
specied variables of interest, such as project deadlines and other important dates.
PROC GANTT enables you to display the early, late, and actual schedules in a single
bar to produce a more meaningful schedule for tracking an activity in progress.
PROC GANTT can display the project logic on the Gantt chart by exhibiting depen-
dencies between tasks using directed arcs to link the related activities. You can use
either the Activity-on-Arc (AOA) or Activity-on-Node (AON) style of input for den-
ing the project network. In addition, the GANTT procedure recognizes nonstandard
precedence types. With PROC GANTT, you can display weekends, holidays, and
multiple calendars, and you can depict milestones, reference lines, and a timenow
line on the chart. PROC GANTT enables you to annotate text and graphics on the
Gantt chart and provides you with a wide variety of options to control and customize
the graphical appearance of the chart.
The GANTT procedure also supports an automatic text annotation facility that is
designed specically for labeling Gantt charts independently of the SAS/GRAPH
Annotate facility. It enables you to display label strings with a minimum of effort and
data entry while providing the capability for more complex chart labeling situations.
An important feature of this facility is the ability to link label coordinates and text
strings to variables in the Schedule data set. This means that you can preserve the
Label data set even though the schedule dates may change. Several options enable
you to customize the annotation, such as the clipping of text strings that run off the
page or the chart and the specication of a split character to split labels that are too
long.
Using the GANTT procedure, you can produce a wide variety of Gantt charts. You
can generate zoned Gantt charts with several options to control its appearance. You
can display a zone variable column as well as draw a line demarcating the different
410
Chapter 4. The GANTT Procedure
zones. You can also control the bar height and bar offset of each type of schedule
bar. This enables you to change the display order of the schedules as well as giving
you the capability to produce a Gantt chart with embedded bars. You can override
the default schedule bar pattern assignments at the activity level. In addition, you
can restrict the schedule types to which the specied pattern is to be applied. You
can also override the text color for selected columns of activity text at the activity
level. These features facilitate the production of multiproject and multiprocess Gantt
charts. Finally, you can also associate HTML pages with activity bars and create
Web-enabled Gantt charts.
The GANTT procedure enables you to control the number of pages output by the
procedure in both horizontal and vertical directions. In addition, you can control the
number of jobs displayed per page as well as the number of tickmarks displayed per
page. You can display ID variables on every page and even let the procedure display
the maximum number of ID variables that can t on one page. You can number the
pages, justify the Gantt chart in the horizontal and vertical directions with respect to
the page boundaries, and maintain the original aspect ratio of the Gantt chart on each
page.
PROC GANTT gives you the option of displaying the Gantt chart in one of three
modes: line-printer, full-screen, or graphics mode. The default mode is graphics
mode, which enables you to produce charts of high resolution quality. Graphics
mode requires SAS/GRAPH software. See the Graphics Version section on page
463 for more information on producing high-quality Gantt charts. You can also pro-
duce line-printer quality Gantt charts by specifying the LINEPRINTER option in the
PROC GANTT statement. In addition to submitting the output to either a plotter or
printer, you can view the Gantt chart at the terminal in full-screen mode by specify-
ing the FULLSCREEN option in the PROC GANTT statement. See the Full-Screen
Version section on page 458 for more information on viewing Gantt charts in full-
screen mode. The GANTT procedure also produces a macro variable that indicates
the status of the invocation and also contains other useful statistics about the Gantt
charts generated by the invocation.
There are several distinctive features that characterize the appearance of the chart
produced by the GANTT procedure:
The horizontal axis represents time, and the vertical axis represents the se-
quence of observations in the data set.
Both the time axis and the activity axis can be plotted across more than one
page.
The procedure automatically provides extensive labeling of the time axis, en-
abling you to determine easily the exact time of events plotted on the chart. The
labels are determined on the basis of the formats of the times being plotted. You
can also specify user-dened formats for the labeling.
In graphics mode, the COMPRESS option in the CHART statement enables
you to produce the entire Gantt chart on one page. The PCOMPRESS option
enables you to produce the entire Gantt chart on one page while maintaining the
original aspect ratio of the Gantt chart. Both these options work in conjunction
Overview
411
with the HPAGES= and VPAGES= options, which specify the number of pages
in the horizontal and vertical directions for the chart.
Project information is communicated into PROC GANTT using SAS data sets. The
input data sets used by PROC GANTT are as follows:
The Schedule data set contains the early, late, actual, resource-constrained,
and baseline schedules and any other activity-related information. The activity-
related information can include precedence information, calendar used by the
activity, special dates, and any other information that you want to identify with
each activity. This data set can be the same as the Schedule data set produced by
PROC CPM, or it can be created separately by a DATA step. Each observation
in the Schedule data set represents an activity and is plotted on a separate row
of the chart unless activity splitting during resource-constrained scheduling has
caused an activity to split into disjoint segments. For details regarding the
output format in this case, see the Displayed Output section on page 487.
The Precedence (Logic) data set contains the precedence information of the
project in AON format in order to draw a Logic Gantt chart of the project.
Specifying this data set is not necessary if the precedence information exists
in the Schedule data set. If the data set is specied, however, the ACTIVITY
variable must exist in both the Schedule and Precedence data sets.
Typically you would use this feature when scheduling in PROC CPM with
nonstandard precedence constraints where the LAG variables are not trans-
ferred to the Schedule data set or with the COLLAPSE option. Setting the
Precedence data set for PROC GANTT to be the Activity data set (used in
PROC CPM) establishes the required precedence relationships. This is also a
convenient feature when drawing several Gantt charts for the same project with
different schedule information (such as when monitoring a project in progress).
Specifying a Precedence data set avoids having to duplicate the precedence in-
formation in every Schedule data set.
The Label data set contains the label information of the project that en-
ables you to to draw labeled Gantt charts independently of the SAS/GRAPH
Annotate facility. It requires a minimum of effort and provides you with a con-
venient mechanism to link label strings and their coordinates to variables in the
Schedule data set. Another convenient feature is its ability to replicate labels
across all activities. Both these features facilitate reuse of the Label data set.
The Workday and the Calendar data sets together enable you to represent
any type of work pattern, during a week and within each day of the week, on
the Gantt chart. The same Workday and Calendar data sets used by PROC
CPM can also be passed to PROC GANTT.
The Holiday data set enables you to associate standard holidays and vacation
periods with each calendar and represent them on the Gantt chart. Like the
Workday and Calendar data sets, the same Holiday data set used by PROC
CPM can also be used by PROC GANTT.
412
Chapter 4. The GANTT Procedure
The Annotate data set contains the graphics and text that are to be annotated
on the Gantt chart. This data set is used by the GANTT procedure in conjunc-
tion with the Annotate facility in SAS/GRAPH software.
The GANTT procedure produces one output data set.
The Imagemap data set contains the outline coordinates for the schedule bars
used in the Gantt chart that can be used to generate HTML MAP tags.
When displaying the precedence relationships between activities on the Gantt chart,
bear in mind the following facts with regard to data sets used by PROC GANTT:
The Schedule data set (and optionally the Precedence data set) contains the
variables that dene the precedence relationships between activities in the
project.
You can handle nonstandard precedence constraints in PROC GANTT when
using AON format by identifying the LAG variables in the CHART statement.
When you use PROC CPM to produce the schedule for a project with non-
standard precedence relationships, the LAG variables are not automatically in-
cluded in the Schedule data set. Use an ID statement or the XFERVARS option
in the PROC CPM statement to add them.
When you generate the schedule using PROC CPM with the COLLAPSE op-
tion, it is recommended that you use the Activity data set to dene the prece-
dence relationships for the Gantt procedure by specifying the PRECDATA=
option in the PROC GANTT statement. This ensures that all the relevant prece-
dence information is extracted.
Each option and statement available in the GANTT procedure is explained in the
Syntax section on page 416. The Examples section on page 492 illustrates most
of these options and statements.
Getting Started
In order to draw a Gantt chart, at the very minimum you need a Schedule data set.
This data set is expected to be similar to the OUT= Schedule data set produced by
PROC CPM, with each observation representing an activity in the project. It is pos-
sible to obtain a detailed Gantt chart by specifying the single statement
PROC GANTT DATA= SAS-data-set ;
where the data set specied is the Schedule data set produced by PROC CPM.
Getting Started
413
As an example of this, consider the software development project in the Getting
Started section in Chapter 2, The CPM Procedure. The output schedule for this
example is saved in a data set, INTRO1, which is displayed in Figure 4.1.
Project Schedule
Obs activity succesr1 succesr2 duration descrpt
1 TESTING RECODE 20 Initial Testing
2 PRELDOC DOCEDREV QATEST 15 Prel. Documentation
3 MEETMKT RECODE 1 Meet Marketing
4 RECODE DOCEDREV QATEST 5 Recoding
5 QATEST PROD 10 QA Test Approve
6 DOCEDREV PROD 10 Doc. Edit and Revise
7 PROD 1 Production
Obs E_START E_FINISH L_START L_FINISH T_FLOAT F_FLOAT
1 01MAR04 20MAR04 01MAR04 20MAR04 0 0
2 01MAR04 15MAR04 11MAR04 25MAR04 10 10
3 01MAR04 01MAR04 20MAR04 20MAR04 19 19
4 21MAR04 25MAR04 21MAR04 25MAR04 0 0
5 26MAR04 04APR04 26MAR04 04APR04 0 0
6 26MAR04 04APR04 26MAR04 04APR04 0 0
7 05APR04 05APR04 05APR04 05APR04 0 0
Figure 4.1. Software Project Plan
414
Chapter 4. The GANTT Procedure
The following code produces the Gantt chart shown in Figure 4.2.
proc gantt lineprinter data=intro1;
run;
The DATA= option could be omitted if the INTRO1 data set is the most recent data
set created; by default, PROC GANTT uses the
LAST
data set.
Line-Printer Gantt Chart
MAR MAR MAR MAR MAR MAR MAR MAR MAR MAR MAR MAR MAR MAR MAR MAR APR APR APR
Job 01 03 05 07 09 11 13 15 17 19 21 23 25 27 29 31 02 04 06
-+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+-
| |
1 |*=======================================* |
| |
2 |<-------------------<--------->...................> |
| |
3 |<->...................................<.> |
| |
4 | *=========* |
| |
5 | *===================* |
| |
6 | *===================* |
| |
7 | *=*|
| |
-+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+-
LEGEND
Symbol Explanation
<----> Duration of a Normal Job
>....> Slack Time for a Normal Job
*====* Duration of a Critical Job
Figure 4.2. Line-Printer Gantt Chart
Getting Started
415
You can produce a high-resolution graphics quality Gantt chart by specifying the
GRAPHICS option instead of the LINEPRINTER option in the PROC GANTT state-
ment. Graphics mode is also the default display mode. The resulting Gantt chart is
shown in Figure 4.3.
proc gantt graphics data=intro1;
run;
Figure 4.3. Graphics Gantt Chart
416
Chapter 4. The GANTT Procedure
Finally, you can draw a Logic Gantt chart by dening the precedence information to
PROC GANTT in AON format using the ACTIVITY= and SUCCESSOR= options
in the CHART statement. The Logic Gantt chart is shown in Figure 4.4.
proc gantt data=intro1;
chart / activity=activity successor=(succesr1-succesr2);
run;
Figure 4.4. Logic Gantt Chart
For further examples illustrating typical invocations of the GANTT procedure when
managing projects, see Chapter 1, Introduction to Project Management.
Syntax
The following statements are used in PROC GANTT:
PROC GANTT options ;
BY variables ;
CHART specications / options ;
ID variables ;
Functional Summary
417
Functional Summary
The following tables outline the options available for the GANTT procedure classi-
ed by function.
Table 4.1. Axis Formatting Options
Description Statement Option
increment for labeling axis CHART INCREMENT=
ending time for axis CHART MAXDATE=
starting time for axis CHART MINDATE=
smallest interval identied on chart CHART MININTERVAL=
suppress time portion of datetime tickmark CHART NOTMTIME
number of columns per mininterval CHART SCALE=
use rst plot variable format for tickmarks CHART USEFORMAT
Table 4.2. Bar Enhancement Options
Description Statement Option
actual bar height CHART ABARHT=
actual bar offset CHART ABAROFF=
default bar height CHART BARHT=
default bar offset CHART BAROFF=
baseline bar height CHART BBARHT=
baseline bar offset CHART BBAROFF=
color of connect line CHART CHCON=
early/late bar height CHART EBARHT=
early/late bar offset CHART EBAROFF=
holiday bar height CHART HBARHT=
holiday bar offset CHART HBAROFF=
character for drawing connect line CHART HCONCHAR=
draw a horizontal connect line CHART HCONNECT
characters for drawing schedule CHART JOINCHAR=
line style of connect line CHART LHCON=
suppress pattern variable for bar lls CHART NOPATBAR
overprint character for schedule variables CHART OVERLAPCH=
overprint character for CHART variables CHART OVPCHAR=
schedule types that use pattern variable CHART PATLEVEL=
pattern variable for bar lls and text color CHART PATTERN=
resource bar height CHART RBARHT=
resource bar offset CHART RBAROFF=
characters for plotting times CHART SYMCHAR=
Table 4.3. Calendar Options
Description Statement Option
calendar identier CHART CALID=
length of workday CHART DAYLENGTH=
beginning of workday CHART DAYSTART=
mark all breaks in a day CHART MARKBREAK
mark all non-working days CHART MARKWKND
418
Chapter 4. The GANTT Procedure
Table 4.4. Data Set Options
Description Statement Option
Annotate data set GANTT ANNOTATE=
CHART ANNOTATE=
Calendar data set GANTT CALEDATA=
Schedule data set GANTT DATA=
Holiday data set GANTT HOLIDATA=
Imagemap output data set GANTT IMAGEMAP=
Label data set GANTT LABDATA=
Precedence (Logic) data set GANTT PRECDATA=
Work pattern data set GANTT WORKDATA=
Table 4.5. Graphics Catalog Options
Description Statement Option
description of catalog entry CHART DESCRIPTION=
name of graphics catalog GANTT GOUT=
name of catalog entry CHART NAME=
Table 4.6. Holiday Options
Description Statement Option
character for plotting holidays CHART HOLICHAR=
holiday start variable CHART HOLIDAY=
holiday duration variable CHART HOLIDUR=
holiday nish variable CHART HOLIFIN=
holiday duration units CHART INTERVAL=
Table 4.7. ID Variable Options
Description Statement Option
number of columns between ID variables CHART BETWEEN=
mark critical activities CHART CRITFLAG
activity text columns that use pattern color CHART CTEXTCOLS=
allow duplicate ID values CHART DUPOK
display ID variables on every page CHART IDPAGES
maximize number of ID variables on page CHART MAXIDS
suppress job number CHART NOJOBNUM
split character for dividing ID labels GANTT SPLIT=
strip leading blanks from character variables GANTT STRIPIDBLANKS
Table 4.8. Labeling Options
Description Statement Option
label variable linking to Schedule data set CHART LABVAR=
rules for label layout CHART LABRULE=
split character for labels CHART LABSPLIT=
maximum number of digits in integer label GANTT LABMAXINT=
Functional Summary
419
Table 4.9. Logic Options
Description Statement Option
activity variable for AON format CHART ACTIVITY=
use AOA precedence specications CHART AOA
color of precedence connections CHART CPREC=
headnode variable for AOA format CHART HEAD=
lag variable for AON format CHART LAG=
schedule bar associated with connections CHART LEVEL=
line style of precedence connections CHART LPREC=
maximum displacement of local vertical CHART MAXDISLV=
minimum interdistance of global verticals CHART MININTGV=
minimum offset of global vertical CHART MINOFFGV=
minimum offset of local vertical CHART MINOFFLV=
suppress drawing arrow head CHART NOARROWHEAD
suppress automatic range extension CHART NOEXTRANGE
terminate procedure if bad precedence data CHART SHOWPREC
successor variable for AON format CHART SUCCESSOR=
tailnode variable for AOA format CHART TAIL=
width of precedence connections CHART WPREC=
Table 4.10. Milestone Options
Description Statement Option
color of milestone CHART CMILE=
duration variable CHART DUR=
font for milestone symbol CHART FMILE=
height of milestone CHART HMILE=
character for milestone CHART MILECHAR=
value for milestone symbol CHART VMILE=
Table 4.11. Miscellaneous Options
Description Statement Option
invoke full-screen version GANTT FS
invoke graphics version GANTT GRAPHICS
invoke line-printer version GANTT LP
maximum number of decimals for a number GANTT MAXDEC=
unit for padding nish times CHART PADDING=
upper limit on number of pages CHART PAGES=
display summary of symbols and patterns CHART SUMMARY
420
Chapter 4. The GANTT Procedure
Table 4.12. Page Layout Options
Description Statement Option
position chart at bottom of page CHART BOTTOM
color for drawing axes CHART CAXIS=
color for frame ll CHART CFRAME=
width of chart axis area CHART CHARTWIDTH=
draw chart on one page in graphics mode CHART COMPRESS
ll each page as much as possible CHART FILL
characters for table outlines and dividers CHART FORMCHAR=
number of pages spanning time axis CHART HPAGES=
left justify chart CHART LEFT
line width CHART LWIDTH=
number of activities on each page CHART NJOBS=
suppress frame CHART NOFRAME
suppress legend CHART NOLEGEND
suppress page number at upper right corner CHART NOPAGENUM
number of tickmarks on each page CHART NTICKS=
display page number at upper right corner CHART PAGENUM
draw chart proportionally on one page CHART PCOMPRESS
right justify chart CHART RIGHT
number of rows between consecutive activities CHART SKIP=
position chart at top of page CHART TOP
number of pages spanning activity axis CHART VPAGES=
Table 4.13. Reference Line Options
Description Statement Option
color of reference lines CHART CREF=
values of reference lines CHART REF=
character for drawing reference line CHART REFCHAR=
label reference lines CHART REFLABEL
Table 4.14. Schedule Selection Options
Description Statement Option
actual start variable CHART A
START=
actual nish variable CHART A
FINISH=
baseline start variable CHART B
START=
baseline nish variable CHART B
FINISH=
concatenate early/late and actual schedules CHART COMBINE
early start variable CHART E
START=
early nish variable CHART E
FINISH=
late start variable CHART L
START=
late nish variable CHART L
FINISH=
resource-constrained start variable CHART S
START=
resource-constrained nish variable CHART S
FINISH=
PROC GANTT Statement
421
Table 4.15. Timenow Line Options
Description Statement Option
color of timenow line CHART CTNOW=
line style of timenow line CHART LTNOW=
suppress timenow label CHART NOTNLABEL
value of timenow line CHART TIMENOW=
character for drawing timenow line CHART TNCHAR=
width of timenow line CHART WTNOW=
Table 4.16. Text Formatting Options
Description Statement Option
color of text CHART CTEXT=
font of text CHART FONT=
height multiplier of text CHART HEIGHT=
height offset for activity text CHART HTOFF=
Table 4.17. Web Options
Description Statement Option
imagemap output data set GANTT IMAGEMAP=
web reference variable CHART WEB=
Table 4.18. Zone Options
Description Statement Option
color of zone line CHART CZONE=
line style of zone line CHART LZONE=
suppress zone column CHART NOZONECOL
display only new zone values CHART ONEZONEVAL
width of zone line CHART WZONE=
zone variable CHART ZONE=
offset of zone line CHART ZONEOFF=
span of zone line CHART ZONESPAN=
PROC GANTT Statement
PROC GANTT options ;
The following options can appear in the PROC GANTT statement.
ANNOTATE=SAS-data-set
ANNO=SAS-data-set
species the input data set that contains the appropriate Annotate variables for the
purpose of adding text and graphics to the Gantt chart. The data set specied must be
an Annotate-type data set. See also the Annotate Processing section on page 464
for information specically on annotate processing with the GANTT procedure.
The data set specied with the ANNOTATE= option in the PROC GANTT statement
is a global ANNOTATE= data set, in the sense that the information in this data set is
displayed on every Gantt chart produced in the current invocation of PROC GANTT.
This option is available only in graphics mode.
422
Chapter 4. The GANTT Procedure
See Example 4.21, Using the SAS/GRAPH ANNOTATE= Option, for further il-
lustration of this option.
CALEDATA=SAS-data-set
CALENDAR=SAS-data-set
identies a SAS data set that species the work pattern during a standard week for
each of the calendars that is to be used in the project. Each observation of this data
set (also referred to as the Calendar data set) contains the name or the number of the
calendar being dened in that observation, the names of the shifts or work patterns
used each day, and, optionally, a standard workday length in hours. For details on
the structure of this data set, see the Multiple Calendars and Holidays section on
page 457. The work shifts referred to in the CALEDATA data set are dened in the
WORKDATA data set.
DATA=SAS-data-set
names the SAS data set that carries the schedule information to be used by PROC
GANTT. If the DATA= option is omitted, the most recently created SAS data set
is used. This data set, also known as the Schedule data set, contains all the time
variables (early, late, actual, resource-constrained, and baseline start and nish times,
and any other variables to be specied in a CHART statement) that are to be plotted
on the chart. For projects that use multiple calendars, this data set also identies the
calendar that is used by each activity. The Schedule data set also contains precedence
information when drawing a Logic Gantt chart in graphics mode. See the Schedule
Data Set section on page 451 for more details.
FULLSCREEN
FS
indicates that the Gantt chart be drawn in full-screen mode. This mode enables you
to scroll horizontally and vertically through the output using commands, pull-down
menus, or function keys. See the Full-Screen Version section on page 458 for more
information.
GOUT=graphics catalog
species the name of the graphics catalog used to save the output produced by PROC
GANTT for later replay. This option is available only in graphics mode.
GRAPHICS
indicates that the Gantt chart produced be of high-resolution quality. This is the
default mode of display. If you invoke the GANTT procedure in Graphics mode, but
you do not have SAS/GRAPH software licensed at your site, the procedure stops and
issues an error message. See the Graphics Version section on page 463 for more
information.
HOLIDATA=SAS-data-set
names the SAS data set that species holidays. These holidays can be associated with
specic calendars that are also identied in the HOLIDATA data set (also referred to
as the Holiday data set). The HOLIDATA= option must be used with the HOLIDAY=
option in the CHART statement, which species the variable in the SAS data set that
contains the start time of holidays. Optionally, the data set can include a variable
that species the length of each holiday or a variable that identies the nish time
PROC GANTT Statement
423
of each holiday (if the holidays are longer than one unit of the INTERVAL= option).
For projects involving multiple calendars, this data set can also include the variable
named by the CALID= option that identies the calendar to be associated with each
holiday.
IMAGEMAP=SAS-data-set
names the SAS data set that receives a description of the areas of a graph and a link
for each area. This information is for the construction of HTML image maps. You use
a SAS DATA step to process the output le and generate your own HTML les. The
graph areas correspond to the link information that comes from the WEB variable
in the schedule data set. This gives you complete control over the appearance and
structure of your HTML pages.
LABDATA=SAS-data-set
LABELDATA=SAS-data-set
LABEL=SAS-data-set
species the input data set that contains the label specic information. This option is
required to initiate the automatic text annotation of the Gantt chart. See the Label
Data Set section on page 482 for information on the variables it can contain. This
option is available only in graphics mode.
LABMAXINT=n
LMI=n
species the maximum number of digits in the integer part when displaying an un-
formatted numeric as a string. The default value is 16. The maximum number of
decimal positions is specied using the MAXDEC= option in the PROC GANTT
statement. This option is applicable only to labels dened with the Label data set.
LINEPRINTER
LP
indicates that the Gantt chart be drawn in line-printer mode.
MAXDEC=n
M=n
indicates the maximum number of decimal positions displayed for a number. A deci-
mal specication in a format overrides a MAXDEC= specication. The default value
of MAXDEC= is 2.
PRECDATA=SAS-data-set
names the SAS data set that contains the variables that dene the precedence con-
straints in AON format. This data set is required if the Schedule data set does not
contain the required precedence information as, for example, when the COLLAPSE
option in PROC CPM causes some observations to be excluded from the Schedule
data set. When this option is specied, it is mandatory that the ACTIVITY variable
exist in both data sets and be identical in both type and length. This option is available
only in graphics mode.
424
Chapter 4. The GANTT Procedure
SPLIT=character
S=character
splits labels used as column headings where the split character appears. When you
dene the value of the split character, you must enclose it in single quotes. In PROC
GANTT, column headings for ID variables consist of either variable labels (if they
are present and space permits) or variable names. If the variable label is used as the
column heading, then the split character determines where the column heading is to
be split.
WORKDATA=SAS-data-set
WORKDAY=SAS-data-set
identies a SAS data set that denes the work pattern during a standard working
day. Each numeric variable in this data set (also referred to as the Workday data set)
is assumed to denote a unique shift pattern during one working day. The variables
must be formatted as SAS time values, and the observations are assumed to specify,
alternately, the times when consecutive shifts start and end.
BY Statement
BY variables ;
A BY statement can be used with PROC GANTT to obtain separate Gantt charts for
observations in groups dened by the BY variables. When a BY statement appears,
the procedure expects the schedule data to be sorted in order of the BY variables.
If your Schedule data set is not sorted, use the SORT procedure with a similar BY
statement to sort the data. The chart for each BY group is formatted separately based
only on the observations within that group.
CHART Statement
CHART specications / options ;
The options that can appear in the CHART statement are listed below. The options
are classied under appropriate headings: rst, all options that are valid for all modes
of the procedure are listed, followed by the options classied according to the mode
(line-printer, full-screen, or graphics) of invocation of the procedure. Most of the
options in line-printer and full-screen modes are also valid in graphics mode with
similar interpretations. The differences and similarities in interpretation of the op-
tions are documented under the Mode-Specic Differences section on page 486.
General Options
The CHART statement controls the format of the Gantt chart and species additional
variables (other than early, late, actual, resource-constrained, and baseline start and
nish times) to be plotted on the chart. For example, suppose a variable that you want
to specify in the CHART statement is one that contains the target nish date for each
activity in a project; that is, if FDATE is a variable in the Schedule data set containing
the desired nish date for each activity, the CHART statement can be used to mark
the value of FDATE on the chart for each activity. A CHART specication can be
one of the following types:
CHART Statement
425
variable1 . . . variablen
variable1=symbol1 . . . variablen=symboln
(variables)=symbol1 . . . (variables)=symboln
variable1 . . . variablen
indicates that each variable is to be plotted using the default symbol, the rst character
of the variable name. For example, the following statement
CHART SDATE FDATE;
causes the values of SDATE to be plotted with an S and the values of FDATE with
an F.
variable1=symbol1 . . . variablen=symboln
indicates that each variable is to be plotted using the symbol specied. The symbol
must be a single character enclosed in quotes.
(variables)=symbol1 . . . (variables)=symboln
indicates that each variable within the parentheses is to be plotted using the symbol
associated with that group. The symbol must be a single character enclosed in single
quotes. For example, the following statement
CHART (ED SD)=*
(FD LD)=+;
plots the values of the variables in the rst group using an asterisk (*) and the values
of the variables in the second group using a plus sign (+).
A single CHART statement can contain specications in more than one of these
forms. Also, each CHART statement produces a separate Gantt chart.
Note: It is not necessary to specify a CHART statement if default values are to be
used to draw the Gantt chart.
The following options can appear in the CHART statement.
A
FINISH=variable
AF=variable
species the variable containing the actual nish time of each activity in the Schedule
data set. This option is not required if the default variable name A
FINISH is used.
A
START=variable
AS=variable
species the variable containing the actual start time of each activity in the Schedule
data set. This option is not required if the default variable name A
START is used.
426
Chapter 4. The GANTT Procedure
B
FINISH=variable
BF=variable
species the variable containing the baseline nish time of each activity in the
Schedule data set. This option is not required if the default variable name B
FINISH
is used.
B
START=variable
BS=variable
species the variable containing the baseline start time of each activity in the
Schedule data set. This option is not required if the default variable name B
START
is used.
BETWEEN=number
species the number of columns between two consecutive ID variable columns. This
option gives you greater exibility in spacing the ID columns. The default value of
the BETWEEN= option is 3.
CALID=variable
species the variable in the Schedule, Holiday, and Calendar data sets that is used
to identify the name or number of the calendar to which each observation refers.
This variable can be either numeric or character depending on whether the different
calendars are identied by unique numbers or names, respectively. If this variable is
not found in any of the three data sets, PROC GANTT looks for a default variable
named
CAL
in that data set (a warning message is issued to the log). For each
activity in the Schedule data set, this variable identies the calendar that is used to
mark the appropriate holidays and weekends for the activity. For further details, see
the Multiple Calendars and Holidays section on page 457.
COMBINE
concatenates the early/late and actual schedule bars of an activity into a single bar
and draws a timenow line on the Gantt chart. The COMBINE option does not affect
the resource-constrained or baseline schedule bars. If the TIMENOW= option is not
specied, it is implicitly assumed to exist and set to missing. The computation of
TIMENOW is then carried out as described in the TIMENOW= option. Since the
timenow line represents the instant at which a snapshot of the project is taken,
values less than TIMENOW can be regarded as the past and values greater or equal
to TIMENOW can be regarded as the future. The GANTT procedure uses this
property of the timenow line to partition the chart into two regions; the region to the
left of the timenow line reporting only the actual schedule (events that have already
taken place), and the region to the right (including the timenow line) reporting only
the predicted early/late schedule.
CRITFLAG
FLAG
indicates that critical jobs be agged as being critical or super-critical. An activity
is critical if its total oat is zero. If the total oat is negative, the activity is super-
critical. Critical activities are marked CR, and super-critical activities are marked
SC on the left side of the chart.
CHART Statement
427
DAYLENGTH=daylength
species the length of the workday. Each workday is plotted starting at the beginning
of the day as specied in the DAYSTART= option and ending daylength hours later.
The value of daylength should be a SAS time value. If the INTERVAL= option is
specied as DTSECOND, DTMINUTE, DTHOUR, or DTDAY, the default value of
daylength is 24 hours. If the INTERVAL= option is specied as WORKDAY or
DTWRKDAY, the default value of daylength is 8 hours. For other values of the
INTERVAL= option, the DAYLENGTH= option is ignored.
Note: The DAYLENGTH= option is needed to mark the non-worked periods within a
day correctly (if the MARKBREAK option is in effect). The DAYLENGTH= option
is also used to determine the start and end of a weekend precisely (to the nearest
second). This accuracy is needed if you want to depict on a Gantt chart the exact
time (for example, to within the nearest hour) for the start and nish of holidays
or weekends. This option is used only if the times being plotted are SAS datetime
values.
DAYSTART=daystart
species the start of the workday. The end of the day, dayend, is computed as
daylength seconds after daystart. The value of daystart should be a SAS time value.
This option is to be specied only when the value of the INTERVAL= option is one
of the following: WORKDAY, DTSECOND, DTMINUTE, DTHOUR, DTDAY, or
DTWRKDAY. For purposes of denoting on the Gantt chart, the weekend is assumed
to start at dayend on Friday and end at daystart on Monday morning. Of course, if
the SCALE= and MININTERVAL= values are such that the resolution is not very
high, you will be unable to discern the start and end of holidays and weekends to the
nearest hour. The default value of daystart is 9:00 a.m. if INTERVAL=WORKDAY
or INTERVAL=DTWRKDAY, and midnight otherwise.
DUPOK
causes duplicate values of ID variables not to be skipped. As described later in the
ID Statement section, if two or more consecutive observations have the same combi-
nation of values for all the ID variables, only the rst of these observations is plotted.
The DUPOK option overrides this behavior and causes all the observations to be
plotted.
DURATION=variable
DUR=variable
identies a variable in the Schedule data set that determines whether or not an activity
is to be regarded as a milestone with respect to a specic schedule. This option
is not required if the default variable name
DUR
FINISH=variable
EF=variable
species the variable containing the early nish time of each activity in the Schedule
data set. This option is not required if the default variable name E
FINISH is used.
E
START=variable
ES=variable
species the variable containing the early start time of each activity in the Schedule
data set. This option is not required if the default variable name E
START is used.
FILL
causes each page of the Gantt chart to be lled as completely as possible before a
new page is started (when the size of the project requires the Gantt chart to be split
across several pages). If the FILL option is not specied, the pages are constrained
to contain an approximately equal number of activities. The FILL option is not valid
in full-screen mode because all of the activities are plotted on one logical page.
HCONNECT
causes a line to be drawn for each activity from the left boundary of the chart to the
beginning of the bar for the activity. This feature is particularly useful when the Gantt
chart is drawn on a large page. In this case, the schedule bars for some of the activities
may not start close enough to the left boundary of the chart; the connecting lines help
to identify the activity associated with each bar.
HOLIDAY=(variable)
HOLIDAYS=(variable)
species the date or datetime variable in the Holiday data set that identies holidays
to be marked on the schedule. If there is no end time nor duration specied for the
holiday, it is assumed to start at the time specied by the HOLIDAY variable and last
one unit of interval , where interval is the value of the INTERVAL= option.
CHART Statement
429
HOLIDUR=(variable)
HDURATION=(variable)
species the variable in the Holiday data set that identies the durations of the holi-
days that are to be marked on the schedule.
HOLIFIN=(variable)
HOLIEND=(variable)
species the date or datetime variable in the Holiday data set that identies the nish
times of the holidays that are to be marked on the schedule.
IDPAGES
displays ID variables on every page. By default, the ID variables are displayed only
on the rst page.
INCREMENT=increment
species the number of minintervals between time axis labels on the Gantt chart. If the
INCREMENT= option is not specied, a value is chosen that provides the maximum
possible labeling.
INTERVAL=interval
HOLINTERVAL=interval
species the units for the values of the HOLIDUR variables. Valid values for this
option are DAY, WEEKDAY, WORKDAY, DTSECOND, DTMINUTE, DTHOUR,
DTDAY, or DTWRKDAY. If the value for the INTERVAL= option has been spec-
ied as WEEKDAY, WORKDAY, or DTWRKDAY, weekends are also marked on
the Gantt chart with the same symbol as holidays for line-printer quality charts.
Graphics-quality Gantt charts use the same PATTERN statement as the one used for
marking holidays. The default value of the INTERVAL= option is DAY if the times
being plotted are SAS date values and is DTDAY if the times being plotted are SAS
datetime values. See the Specifying the INTERVAL= Option section on page 458
for further information regarding this option.
L
FINISH=variable
LF=variable
species the variable containing the late nish time of each activity in the Schedule
data set. This option is not required if the default variable name L
FINISH is used.
L
START=variable
LS=variable
species the variable containing the late start time of each activity in the Schedule
data set. This option is not required if the default variable name L
START is used.
MARKBREAK
causes all breaks (non-worked periods) during a day to be marked on the Gantt chart.
The symbol used for marking the breaks is the same as the HOLICHAR= symbol.
This option may not be of much use unless the chart has been plotted with a scale
that enables you to discern the different hours within a day on the Gantt chart. For
instance, if the chart is in terms of days, there is no point in trying to show the breaks
within a day; on the other hand, if it is in terms of hours or seconds, you may want
to see the start and end of the various shifts within a day. This option turns on the
MARKWKND option.
430
Chapter 4. The GANTT Procedure
MARKWKND
causes all weekends (or non-worked days during a week) to be marked on the Gantt
chart. The symbol used for marking weekends is the same as the HOLICHAR= sym-
bol. Note that weekends are also marked on the chart if the value of the INTERVAL=
option is WEEKDAY, WORKDAY, or DTWRKDAY.
MAXDATE=maxdate
species the end time for the time axis of the chart. The default value is the largest
value of the times being plotted unless the logic options are invoked without the
NOEXTRANGE option in the CHART statement. For a discussion of the default
behavior in this instance, see the Formatting the Axis section on page 476.
MAXIDS
displays as many consecutive ID variables as possible in the presence of an ID state-
ment. In the absence of this option, the default displays all of the variables or none if
this is not possible.
MINDATE=mindate
species the starting time for the time axis of the chart. The default value is the
smallest value of the times being plotted unless the logic options are invoked without
the NOEXTRANGE option in the CHART statement. For a discussion of the default
behavior in this instance, see the Formatting the Axis section on page 476.
MININTERVAL=mininterval
species the smallest interval to be identied on the chart. For example, if
MININTERVAL=DAY, then one day is represented on the chart by scale (see the
SCALE= option) number of columns. The default value of the MININTERVAL= op-
tion is chosen on the basis of the formats of the times being plotted, as explained
in the Specifying the MININTERVAL= Option section on page 456. See also
the Page Format section on page 455 for a further explanation of how to use the
MININTERVAL= option in conjunction with the SCALE= option.
NOJOBNUM
suppresses displaying an identifying job number for each activity. By default, the job
number is displayed to the left of the Gantt chart.
NOLEGEND
suppresses displaying the concise default legend at the bottom of each page of the
Gantt chart. The NOLEGEND option is not effective in full-screen mode.
NOTNLABEL
suppresses displaying the timenow label. By default, the label is displayed on the
bottom border of the chart.
PADDING=padding
FINPAD=padding
requests that nish times on the chart be increased by one padding unit. An exception
to this is when a milestone is to be plotted. See the DUR= option for further informa-
tion regarding this. The PADDING= option enables the procedure to mark the nish
times as the end of the last time period instead of the beginning. Possible values for
padding are NONE, SECOND, MINUTE, HOUR, DAY, WEEK, MONTH, QTR,
CHART Statement
431
YEAR, DTSECOND, DTMINUTE, DTHOUR, DTWEEK, DTMONTH, DTQTR,
or DTYEAR. The default value is chosen on the basis of the format of the times be-
ing plotted. See the Specifying the PADDING= Option section on page 454 for
further explanation of this option.
PAGELIMIT=pages
PAGES=pages
species an upper limit on the number of pages allowed for the Gantt chart. The de-
fault value of pages is 100. This option is useful for preventing a voluminous amount
of output from being generated by a wrong specication of the MININTERVAL= or
SCALE= option. This option is ignored in full-screen mode.
REF=values
indicates the position of one or more vertical reference lines on the Gantt chart. The
values allowed are constant values. Only those reference lines that fall within the
scope of the chart are displayed.
In line-printer and full-screen modes, the reference lines are displayed using the char-
acter specied in the REFCHAR= option. In graphics mode, use the CREF=, LREF=,
and LWIDTH= options to specify the color, style, and width of the reference lines.
REFLABEL
species that the reference lines are to be labeled. The labels are formatted in the
same way as the time axis labels and are placed along the bottom border of the
Gantt chart at the appropriate points. If the reference lines are too numerous and
the scale does not allow all the labels to be nonoverlapping, then some of the labels
are dropped.
S
FINISH=variable
SF=variable
species the variable containing the resource-constrained nish time of each activity
in the Schedule data set. This option is not required if the default variable name
S
FINISH is used.
S
START=variable
SS=variable
species the variable containing the resource-constrained start time of each activity
in the Schedule data set. This option is not required if the default variable name
S
START is used.
SCALE=scale
requests that scale number of columns on the chart represent one unit of mininterval
where mininterval is the value of the MININTERVAL= option. In line-printer and
graphics modes, the default value of the SCALE= option is 1 if the time axis of the
chart is too wide to t on one page. If the time axis ts on less than one page, then a
default value is chosen that expands the time axis as much as possible but still ts the
time axis on one page. In full-screen mode, the default value of the SCALE= option
is always 1.
432
Chapter 4. The GANTT Procedure
SKIP=skip
S=skip
requests that skip number of lines be skipped between the plots of the schedules of
two activities. The SKIP= option can take integer values between 0 and 4, inclusive.
In graphics mode, 0 is not a valid value. The default value of the SKIP= option is 1.
STRIPIDBLANKS
STRIPID
strips all leading blanks from character ID variables. The default behavior is to pre-
serve any leading blanks.
SUMMARY
requests that a detailed description of all symbols and patterns used in the Gantt chart
be displayed before the rst page of the chart. In line-printer mode, this description
includes examples of some strings that could occur in the body of the Gantt chart.
The SUMMARY option is not supported in full-screen mode.
TIMENOW=value
species the position for the timenow line on the chart. If the value is invalid or set
to missing, TIMENOW is set to be the time period following the maximum of all
specied actual times. If there are no actual times, TIMENOW is set to be equal to
the current date. The value of TIMENOW is written to the log.
The timenow line has precedence over all other variables and reference lines and is
drawn only if it falls within the range of the chart axis. If TIMENOW is based on
the maximum of the actual times, and the MAXDATE= option is not specied, then
the range of the chart axis is increased, if necessary, to display the timenow line. The
timenow line is labeled by default; the label is formatted in the same way as the time
axis and is placed along the bottom border of the chart. The timenow line is displayed
in line-printer and full-screen modes using the character specied by the TNCHAR=
option (or T, if none is specied) in the CHART statement. In graphics mode, use the
CTNOW=, LTNOW=, and WTNOW= options in the CHART statement to specify
the color, style, and width of the timenow line. In the presence of a timenow line, the
actual schedule for an activity with an actual start less than TIMENOW and a missing
actual nish time is represented on the Gantt chart by a bar that begins at the actual
start and ends at TIMENOW to indicate that the activity is in progress at TIMENOW.
This behavior is consistent with the convention used by PROC CPM. A warning is
also issued to the log in this case.
USEFORMAT
species that the tickmark labels of the Gantt chart axis are to be displayed using
the format associated with the rst plot variable appearing in the order E
START=,
E
FINISH=, L
START=, L
FINISH=, A
START=, A
FINISH=, S
START=,
S
FINISH=, B
START=, B
START and
A
FINISH variables are specied. The seventh symbol is used to plot the resource-
constrained schedule of an activity if the S
START and S
START and B
START, E
FINISH, L
START, L
FINISH, A
START, A
FINISH, S
START,
S
FINISH, B
START, or B
Y implies linking of the label to every activity (assuming data values are used).
This is equivalent to specifying the LABVAR= option in the CHART statement and
linking every activity to the label. Note that any Label data set observation with dual
linkage denitions is ignored. That is, an observation with
Y equal to -1 and with a
nonmissing value for the LABVAR= variable is ignored.
The following rules apply to label denitions in the Label data set that are linked to
activities in the Schedule data set:
If the
X variable does not exist in the Label data set or its value is missing, the
horizontal coordinate is extracted from the Schedule data set using the
XVAR
variable.
If the
LABEL variable does not exist in the Label data set or its value is
missing, the text string is determined from the Schedule data set using the
LVAR variable.
LABRULE=rule
LABFMT=rule
species the rule to use for laying out labels that are dened in the Label data set.
Valid values for rule are PAGECLIP and FRAMCLIP. PAGECLIP displays a label at
the specied location and clips any part of the label that runs off the page. A value
of FRAMCLIP differs from PAGECLIP in that it clips all labels with data value
coordinates that run off the frame of the Gantt chart. The default value for rule is
PAGECLIP.
LABSPLIT=character
LABELSPLIT=character
splits labels that are dened in the Label data set wherever the split character appears.
By default, if there are embedded blanks, the GANTT procedure attempts to split
strings at suitable blanks so that the resulting lines are equal in length. To suppress
the default splitting when using strings embedded with blanks, specify a dummy
character not used in the labeling.
LAG=variable
LAG=(variables)
species the variables identifying the lag types of the precedence relationships be-
tween an activity and its successors. Each SUCCESSOR variable is matched with the
corresponding LAG variable; that is, for a given observation, the ith LAG variable de-
nes the relationship between the activities specied by the ACTIVITY variable and
the ith SUCCESSOR variable. The LAG variables must be character type and their
values are expected to be specied as one of FS, SS, SF, FF, which denote Finish-
to-Start, Start-to-Start, Start-to-Finish, Finish-to-Finish, respectively. You can
also use the keyword
duration
NO
in the CHART statement when using split activities results in each segment using a
different pattern.
Note that, if the value of the PATTERN variable is n for a particular activity, the
GANTT procedure uses the specications in the nth generated PATTERN denition,
not the specications in the PATTERN n statement.
The chart legend and summary, when displayed, indicate the default patterns that
identify the different schedule types represented on the Gantt chart as listed in Table
4.24. Since the PATTERN variable overrides these values at the activity level, you
must be careful in interpreting the summary and legend when using a PATTERN
variable, especially if any of the specied pattern denitions overlap with one of the
default patterns.
PCOMPRESS
species that every output page of the Gantt chart is to be produced maintaining
the original aspect ratio of the Gantt chart. The number of output pages is deter-
mined by the HPAGES= and VPAGES= options. In the absence of the HPAGES=
and VPAGES= options, the PCOMPRESS option displays the Gantt chart on a single
page.
RBARHT=h
SBARHT=h
species that the height of the resource-constrained schedule bar be h cellheights.
The value of h is restricted to be a positive real number. The default bar height is one
cellheight. This specication overrides a BARHT= specication. In the event that the
resource-constrained schedule bar corresponds to the logic bar (using the LEVEL=
option), the value is ignored and the default value is used instead. Any non-working
days corresponding to this schedule bar are also drawn using the same height as the
schedule bar unless the HBARHT= option is specied.
CHART Statement
449
RBAROFF=d
SBAROFF=d
species that the resource-constrained schedule bar be offset d cellheights from its
default position. A value of zero corresponds to the default position. The direction of
increase is from top to bottom. This specication overrides a BAROFF= specica-
tion. In the event that the resource-constrained schedule bar corresponds to the logic
bar (specied using the LEVEL= option), the value is ignored and the default value
is used instead. Any non-working days corresponding to this schedule bar are drawn
using the offset of the schedule bar unless the HBAROFF= option is specied.
RIGHT
RJUST
displays the Gantt chart right-justied with the right edge of the page. This option is
ignored in the presence of the LEFT or LJUST option.
SHOWPREC
causes PROC GANTT to terminate in the event that a valid AOA or AON speci-
cation exists, and an error occurs either in the logic system (memory allocation,
data structure creation, and so on) or simply due to bad data (missing values for the
ACTIVITY, TAIL, HEAD variables, and so on). The default behavior is to attempt
drawing the chart without the precedence connections.
SUCCESSOR=variable
SUCC=variable
SUCCESSOR=(variables)
SUCC=(variables)
species the variables identifying the names of the immediate successors of the node
specied by the ACTIVITY variable. This option is required when the precedence
information is specied in the AON format. These variables must have the same
type as the ACTIVITY variable. If the PRECDATA= option has been specied, the
SUCCESSOR variables are assumed to exist in the Precedence data set; otherwise,
they are assumed to exist in the Schedule data set.
TAIL=variable
TAILNODE=variable
species the variable in the Schedule data set that contains the name of the node
that represents the start of the activity. This option is required when the precedence
information is specied using the AOA format. The variable can be either numeric or
character in type.
TOP
TJUST
positions the top of the Gantt chart at the top of the page, just below the titles. This
option has priority over the BOTTOM or BJUST option.
VMILE=value
species a plot symbol from the font specied in the FMILE= option to be used as
the milestone symbol on the chart. If the FMILE= option is set to NONE or is not
specied, then the milestone symbol is the symbol specied by the VMILE= option
in the special symbol table shown in Table 4.25. The default milestone symbol is a
450
Chapter 4. The GANTT Procedure
lled diamond.
VPAGES=v
Species that the Gantt chart is to be produced using v vertical pages. This, however,
may not be possible due to intrinsic constraints on the output. For example, the
GANTT procedure requires that every vertical page represent at least one tickmark.
Thus, the number of vertical pages can never exceed the number of tickmarks in
the axis. Subject to such inherent constraints, the GANTT procedure attempts to
use the specied value for the VPAGES= option; if this fails, it uses v as an upper
bound. The exact number of vertical pages used by the Gantt chart is provided in
the
ORGANTT macro variable. See the Macro Variable
ORGANTT section on
page 490 for further details.
The appearance of the chart with respect to the VPAGES= option is also inuenced by
the presence of other related procedure options. The VPAGES= option performs the
task of determining the number of horizontal pages in the absence of the HPAGES=
option. If the COMPRESS or PCOMPRESS option is specied in this scenario, the
chart uses one horizontal page. If neither the COMPRESS nor PCOMPRESS option
is specied, the number of horizontal pages is computed in order to display as much
of the chart as possible in a proportional manner.
WEB=variable
HTML=variable
species the character variable in the schedule data set that identies an HTML page
for each activity. The procedure generates an HTML image map using this infor-
mation for all the schedule bars, milestones, and ID variables corresponding to an
activity.
WPREC=linewidth
species the line width to use for drawing the precedence connections. The default
width is 1.
WTNOW=linewidth
species the line width to use for drawing the timenow line. The default width is 4.
WZONE=linewidth
WZLINE=linewidth
species the line width to use for drawing the horizontal zone lines which demarcate
the different zones on the chart. The default linewidth is 1.
ZONE=variable
ZONEVAR=variable
names the variable in the Schedule data set that is used to separate the Gantt chart into
zones. This option enables you to produce a zoned Gantt chart. The GANTT proce-
dure does not sort the Schedule data set and processes the data in the order it appears
in the Schedule data set. A change in the value of the zone variable establishes a new
zone. By default, the GANTT procedure displays a ZONE variable column before the
ID variable columns. You can suppress this column using the NOZONECOL option.
The GANTT procedure also draws a horizontal line demarcating zones. By default,
the line spans the entire chart in the horizontal direction, both inside and outside the
axis area. You can control the span of this line using the ZONESPAN= option. You
Schedule Data Set
451
can also adjust the vertical offset of the line from its default position by using the
ZONEOFFSET= option. In addition, you can also control the graphical attributes as-
sociated with this line such as color, style, and width using the CZONE=, LZONE=,
and WZONE= options, respectively.
ZONEOFF=d
ZONEOFFSET=d
species the offset in cellheights of the zone line from its default position of 0.5 cell
height above the top of the rst schedule bar for the rst activity in the zone. The
default value of d is 0. The direction of increase is from top to bottom.
ZONESPAN=name
ZONELINE=name
species the span of the horizontal zone line that is drawn at the beginning of each
new zone. Valid values for name are LEFT, RIGHT, ALL, and NONE. The value
of LEFT draws a line that spans the width of the columns of text that appear on the
left hand side of the Gantt chart. The value of RIGHT draws a line that spans the
width of the axis area which appears on the right-hand side of the chart. The value
of ALL draws a line spanning both the preceding regions while the value of NONE
suppresses the line altogether. The default value is ALL.
ID Statement
ID variables ;
The ID statement species the variables to be displayed that further identify each
activity. If two or more consecutive observations have the same combination of val-
ues for all the ID variables, only the rst of these observations is plotted unless the
DUPOK option is specied in the CHART statement.
By default, if the ID variables do not all t on one page, they are all omitted and a
message explaining the omission is printed to the log. You can override this behavior
and display the maximum number of consecutive ID variables that can t on a page
by specifying the MAXIDS option in the CHART statement.
If the time axis of a Gantt chart spans more than one page, the ID variables are
displayed only on the rst page of each activity. You can display the ID variables on
every page by specifying the IDPAGES option in the CHART statement.
Details
Schedule Data Set
Often, the Schedule data set input to PROC GANTT is the output data set (the OUT=
data set) produced by PROC CPM, sometimes with additional variables. Typically,
this data set contains
the start and nish times for the early and late schedules (E
START,
E
FINISH, L
START, and L
FINISH variables)
452
Chapter 4. The GANTT Procedure
the actual start and nish times (A
START and A
START and
S
FINISH variables) for projects that have been scheduled subject to resource
constraints
the baseline start and nish times (B
START and B
FINISH variables) of
activities when monitoring and comparing the progress of a project against a
target schedule
When such a data set is input as the Schedule data set to PROC GANTT, the
procedure draws a Gantt chart showing ve different schedules for each activ-
ity: the predicted early/late schedules using E
START, E
FINISH, L
START, and
L
FINISH on the rst line for the activity, the actual schedule using A
START and
A
START
and S
START and
B
NO Variable
Normally, each observation of the Schedule data set causes one set of bars to be
plotted corresponding to the activity in that observation. If activity splitting has oc-
curred during resource-constrained scheduling, the Schedule data set produced by
PROC CPM contains more than one observation for each activity. It also contains
a variable named SEGMT
NO. For activities that are not split, this variable has a
missing value. For split activities, the number of observations in the Schedule data
set is equal to (1 + the number of disjoint segments that the activity is split into). The
rst observation corresponding to such an activity has SEGMT
NO equal to miss-
ing, and the S
START and S
NO,
S
START, S
START and S
FINISH are the resource-constrained start and nish times for this
segment, and duration is the duration of this segment. See the Displayed Output
section on page 487 for details on how PROC GANTT treats the observations in this
case.
Note: For a given observation in the Schedule data set, the nish times (E
FINISH,
L
FINISH, A
FINISH, S
FINISH, and B
START=2JUN04 and E
SUN
, . . . ,
SAT
CLABEL CTEXT=
FLABEL FONT=
HLABEL 1
JLABEL L
LABEL use
LVAR
PAGEBRK 0
RLABEL 0
X use
XVAR
XOFFSET 0
XSYS DATA
Y use LABVAR=
YOFFSET 0
YSYS DATA
LABVAR value ignored
PRECDATA ACTIVITY input error: logic options are ignored
LAG FS
SUCCESSOR value ignored
WORKDATA any numeric variable 00:00, if rst observation; 24:00, otherwise
Specifying the PADDING= Option
As explained in the Schedule Data Set section on page 451, the nish times in
the Schedule data set denote the nal time unit of an activitys duration; that is, the
activity nishes at the end of the day/second specied as the nish time. A plot of the
activitys duration should continue through the end of the nal time unit. Thus, if the
Page Format
455
value of the E
FINISH variable is 4JUN04, the early nish time for the activity is
plotted at the end of June 4, 2004 (or the beginning of June 5, 2004).
In other words, the nish times are padded by a day (second) if the nish time vari-
ables are formatted as SAS date (SAS time or datetime) values. This treatment is
consistent with the meaning of the variables as output by PROC CPM. Default val-
ues of PADDING corresponding to different format types are shown in Table 4.20.
The PADDING= option is provided to override the default padding explained
above. Valid values of this option are NONE, SECOND, MINUTE, HOUR, DAY,
WEEK, MONTH, QTR, YEAR, DTSECOND, DTMINUTE, DTHOUR, DTWEEK,
DTMONTH, DTQTR, and DTYEAR. Use the value NONE if you do not want the
nish times to be adjusted.
Table 4.20. Default Values of the PADDING= Option Corresponding to Format
Type
Format PADDING
SAS time value SECOND
SAS date value DAY
SAS datetime value DTSECOND
Other NONE
It is recommended that when plotting zero duration activities, you include a variable
in the Schedule data set that has value zero if and only if the activity has zero duration.
Dening this variable to the GANTT procedure using the DURATION= (or DUR=)
option in the CHART statement ensures that a zero duration activity is represented on
the chart by a Milestone. If this is not done, an activity with zero duration is shown
on the chart as having a positive duration since nish times are padded to show the
end of the last time unit.
Page Format
The GANTT procedure divides the observations (activities) into a number of sub-
groups of approximately equal numbers. The size of each group is determined by
the PAGESIZE system option. Similarly, the time axis is divided into a number of
approximately equal divisions depending on the LINESIZE system option.
If the FILL option is specied, however, each page is lled as completely as possible
before plotting on a new page. If both axes are split, the pages are ordered with the
chart for each group of activities being plotted completely (the time axis occupying
several consecutive pages, if needed) before proceeding to the next group.
If a BY statement is used, each BY group is formatted separately.
Two options that control the format of the chart are the MININTERVAL= and
SCALE= options. The value for the MININTERVAL= option, denoted by minin-
terval, is the smallest time interval unit to be identied on the chart. The value for the
SCALE= option, denoted by scale, is the number of columns to be used to denote
one unit of mininterval . For example, if MININTERVAL=MONTH and SCALE=10,
the chart is formatted so that 10 columns denote the period of one month. The rst
456
Chapter 4. The GANTT Procedure
of these 10 columns denotes the start of the month and the last denotes the end, with
each column representing approximately three days. Further, the INCREMENT= op-
tion can be used to control the labeling. In this example, if INCREMENT=2, then the
time axis would have labels for alternate months.
Specifying the MININTERVAL= Option
The value specied for the MININTERVAL= option is the smallest time interval unit
to be identied on the chart. If the time values being plotted are SAS date values, the
valid values for mininterval are DAY, WEEK, MONTH, QTR, or YEAR. If the values
are SAS datetime values, valid values for mininterval are DTSECOND, DTMINUTE,
DTHOUR, DTDAY, DTWEEK, DTMONTH, DTQTR, or DTYEAR. If they are SAS
time values, then valid values are SECOND, MINUTE, or HOUR.
Note: If the times being plotted are SAS datetime values and mininterval is either
DTSECOND, DTMINUTE, or DTHOUR, the output generated could run into several
thousands of pages. Therefore, be careful when choosing a value for mininterval .
Table 4.21 shows the default values of mininterval corresponding to different formats
of the times being plotted on the chart.
Table 4.21. Default Values of the MININTERVAL= Option
Format MININTERVAL= Value
DATEw. DAY
DATETIMEw.d DTDAY
HHMMw.d HOUR
MONYYw. MONTH
TIMEw.d HOUR
YYMMDDw. MONTH
YYQw. MONTH
Labeling on the Time Axis
If the variables being plotted in the chart are unformatted numeric values, the
time axis is labeled by the corresponding numbers in increments specied by the
INCREMENT= option. However, if the variables have date, datetime, or time for-
mats, then the time axis is labeled with two or three lines. Each line is determined
by the value of mininterval , which in turn is determined by the format of the plotted
times (see Table 4.21). Table 4.22 illustrates the format of the label corresponding to
different values of mininterval .
Table 4.22. Label Format Corresponding to MININTERVAL= Value
MININTERVAL= Value First Line Second Line Third Line
DAY, WEEK, DTWEEK month day
MONTH, QTR, YEAR,
DTMONTH, DTQTR,
DTYEAR
year month
DTSECOND, DTMINUTE,
DTHOUR, DTDAY
month day time
SECOND, MINUTE, HOUR time
Multiple Calendars and Holidays
457
Multiple Calendars and Holidays
Work pertaining to a given activity is assumed to be done according to a particular
calendar. A calendar is dened in terms of a work pattern for each day and a work-
week structure for each week. In addition, each calendar may include holidays during
the year. See the Multiple Calendars section in the PROC CPM chapter for details
on how calendars are dened and how all the options work together. In this chapter,
a less detailed description is provided. PROC GANTT uses the same structure as
PROC CPM for dening calendars, but the options for using them differ in minor
ways. The following are the differences in syntax:
The CALID variable is specied as an option in the CHART statement and is
not a separate statement as in PROC CPM.
The HOLIDAY variable is specied as an option in the CHART statement and
is not a separate statement as in PROC CPM.
The HOLIDUR and HOLIFIN variables are specied as options in the CHART
statement and not in a separate HOLIDAY statement.
The INTERVAL= option is specied in the CHART statement and not in the
procedure statement as in PROC CPM.
The WORKDATA (or Workday) data set species distinct shift patterns during a
day. The CALEDATA (or Calendar) data set species a typical workweek for all
the calendars in the project; for each day of a typical week, it species the shift
pattern that is followed. The HOLIDATA (or Holiday) data set species a list of
holidays and the calendars that they refer to; holidays are dened either by specifying
the start of the holiday and its duration in interval units, where the INTERVAL=
option has been specied as interval , or by specifying the start and end of the holiday
period. If both the HOLIDUR and the HOLIFIN variables have missing values in
a given observation, the holiday is assumed to start at the date and time specied
for the HOLIDAY variable and last one unit of interval . If a given observation has
valid values for both the HOLIDUR and the HOLIFIN variables, only the HOLIFIN
variable is used so that the holiday is assumed to start and end as specied by the
HOLIDAY and HOLIFIN variables, respectively. The Schedule data set (the DATA=
data set) , species the calendar that is used by each activity in the project through
the CALID variable (or a default variable
CAL
PATTERN variable.
Table 4.24. PATTERN Statements used by PROC GANTT
PATTERN Used to Denote
1 duration of a noncritical activity
2 slack time for a noncritical activity
3 duration of a critical activity
4 slack time for a supercritical activity
5 duration of a supercritical activity
6 actual duration of an activity
7 break due to a holiday
8 resource-constrained duration of an activity
9 baseline duration of an activity
466
Chapter 4. The GANTT Procedure
Refer to the SAS/GRAPH documentation for a detailed description of PATTERN
statements. Most of the relevant information is reproduced here for the sake of com-
pleteness.
PATTERN Statement Syntax
The general form of a PATTERN statement is
PATTERNn options;
where
n is a number ranging from 1 to 255. If you do not specify a number after the
keyword PATTERN, PATTERN1 is assumed.
options enables you to specify the colors and patterns used to ll the bars in
your output.
PATTERN statements are additive; if you specify a C= or V= option in a PATTERN
statement and then omit that option in a later PATTERN statement ending in the
same number, the option remains in effect. To turn off options specied in a previous
PATTERNn statement, either specify all options in a new PATTERNn statement, or
use the keyword PATTERNn followed by a semicolon. For example, the following
statement turns off any C= or V= option specied in previous PATTERN3 statements:
pattern3;
You can reset options in PATTERN statements to their default values by specifying
a null value. A comma can be used (but is not required) to separate a null parameter
from the next option.
For example, both of the following statements cause the C= option to assume its
default value (the value of the CPATTERN= option or the rst color in the COLORS=
list):
pattern c=, v=solid;
or
pattern c= v=solid;
In the following statement, both options are reset to their default values:
pattern2 c= v=;
You can also turn off options by specifying the RESET= option in a GOPTIONS
statement.
Graphics Version
467
General options
You can specify the following options in a PATTERN statement.
COLOR=color
C=color
species the color to use for a bar or other area to be lled. If you do not specify the
C= option in a PATTERN statement, the procedure uses the value you specied for
the CPATTERN= option in a GOPTIONS statement. If you omitted the CPATTERN=
option, the procedure uses the pattern specied by the V= option (see below) with
each color in the COLORS= list before it uses the next PATTERN statement.
REPEAT=n
R=n
species the number of times the PATTERN statement is to be reused. For example,
the following statement represents one pattern to be used by SAS/GRAPH software:
pattern1 v=x3 c=red;
You can use the REPEAT= option in the statement to repeat the pattern before going
to the next pattern. For example, if you specify the following statements, PATTERN1
is repeated ten times before PATTERN2 is used:
pattern1 v=x3 c=red r=10;
pattern2 v=s c=blue r=10;
Remember that if you omit the COLOR= option in the PATTERN statement and you
do not specify the CPATTERN= option, SAS/GRAPHsoftware repeats the pattern for
each color in the current COLORS= list. If you specify the R= option in a PATTERN
statement from which the C= option is omitted, the statement cycles through the
COLORS= list the number of times given by the value of the R= option.
For example, if the current device has seven colors, then the following statement re-
sults in 70 patterns because each group of seven patterns generated by cycling through
the COLORS= list is repeated ten times:
pattern v=x3 r=10;
VALUE=value
V=value
species the pattern to use for a bar or other area to be lled. The valid values you can
use depend on what procedure you are using and the type of graph you are producing.
In PROCGANTT, which produces bars, you must use one of the pattern values shown
in Figure 4.6.
In a PATTERN statement, if you specify a value for the V= option but not for the C=
option, the procedure uses the value you specied for the CPATTERN= option in a
GOPTIONS statement. If you omitted the CPATTERN= option, the procedure uses
the pattern specied for the V= option with each color in the COLORS= list before
468
Chapter 4. The GANTT Procedure
it uses the next PATTERN statement. Thus, if you specify the following statements,
the PATTERN1 statement is used for the rst type of bar, namely, for the duration of
a noncritical activity:
pattern1 c=red v=x3;
pattern2 v=s;
pattern3 c=blue v=l3;
pattern4 c=green v=r4;
proc gantt data=sched;
The PATTERN2 statement is used for the second type of bar, namely, for the slack
time of a noncritical activity. Because a C= value is not specied in the PATTERN2
statement, SAS/GRAPH software uses the PATTERN2 statement and cycles through
the colors in the COLORS= list for the device to obtain as many patterns as there are
colors in the list. If needed, the PATTERN3 and PATTERN4 values are then used for
any remaining types of bars.
Figure 4.6. Pattern Selection Guide
Using SYMBOL Statements
You can specify a SYMBOL statement anywhere in your SAS program. SYMBOL
statements give PROC GANTT information about the characters to be used for plot-
ting the CHART variables.
See also the Special Fonts for Project Management and Decision Analysis section
on page 471 for a description of some typically used Gantt chart symbols that can be
specied using a SYMBOL statement.
Refer to the SAS/GRAPH documentation for a detailed description of SYMBOL
statements. Most of the relevant information is reproduced here for the sake of com-
pleteness.
Graphics Version
469
SYMBOL Statement Syntax
The general form of a SYMBOL statement is
SYMBOLn options;
where
n is a number ranging from 1 to 255. Each SYMBOL statement remains in ef-
fect until you specify another SYMBOL statement ending in the same number.
If you do not specify a number following the keyword SYMBOL, SYMBOL1
is assumed.
options enables you to specify the plot characters and color.
SYMBOL statements are additive; that is, if you specify a given option in a SYMBOL
statement and then omit that option in a later SYMBOL statement ending in the same
number, the option remains in effect. To turn off all options specied in previous
SYMBOL statements, you can specify all options in a new SYMBOLn statement,
use the keyword SYMBOLn followed by a semicolon, or specify a null value. A
comma can be used (but is not required) to separate a null parameter from the next
option.
For example, both of the following statements cause the C= option to assume its
default value (the value of the CSYMBOL= option or the rst color in the COLORS=
list):
symbol1 c=, v=plus;
and
symbol1 c= v=plus;
In the following statement, both options are reset to their default values:
symbol4 c= v=;
You can also turn off options by specifying the RESET= option in a GOPTIONS
statement.
470
Chapter 4. The GANTT Procedure
General options
You can specify the following options in the SYMBOL statement.
COLOR=color
C=color
species the color to use for the corresponding plot specication. If you do not spec-
ify the C= option in a SYMBOL statement, the procedure uses the value you specied
for the CSYMBOL= option in a GOPTIONS statement. If you omit the CSYMBOL=
option, the procedure uses the value specied by the V= option with each color in the
COLORS= list before it uses the next SYMBOL statement.
FONT=font
F=font
species the font from which the symbol corresponding to the value specied with
the V= option is to be drawn. If you do not specify a font, the V= option species the
symbol from the special symbol table shown in Table 4.25.
H=height
species the height of the symbol that is to be drawn.
For example, this SYMBOL statement
symbol1 c=green v=K f=special h=2;
indicates that the symbol at each data point is the letter K from the SPECIAL font (a
lled square), drawn in green, the height being twice the bar height.
REPEAT=n
R=n
species the number of times the SYMBOL statement is to be reused.
V=special-symbol
V=string
identies the symbols from the font specied by the FONT= option in the SYMBOL
statement for the corresponding plot specications. If the FONT= option is not spec-
ied, the plot symbol is the symbol corresponding to the value of V= in the special
symbol table shown in Table 4.25. Also permitted without a FONT= specication are
the letters A through W and the numbers 0 through 9. If the font is a symbol font,
such as MARKER, the string specied with the V= option is the character code for
the symbol. If the font is a text font, such as SWISS, the string specied with the V=
option is displayed as the plot symbol. By default, the value of V= is PLUS, which
produces the plus symbol (+) from the special symbol table.
Note that if you use the special symbol comma (,) with the V= option, you must
enclose the comma in quotes as illustrated in the following statement:
symbol1 v=,;
Graphics Version
471
Table 4.25. Special Symbol Table
Special Fonts for Project Management and Decision Analysis
Two special marker fonts, ORFONT and ORFONTE, are available in versions 6.08
and later. These two fonts are meant to be used with SAS/OR software and provide
a variety of symbols that are typically used in Project Management and Decision
Analysis. The fonts ORFONT and ORFONTE are shown in Figure 4.7 and Figure
4.8, respectively. The fonts behave like any SAS/GRAPH font providing you with
the capability to control attributes such as color and height.
472
Chapter 4. The GANTT Procedure
Figure 4.7. ORFONT - A Filled Font
Figure 4.8. ORFONTE - An Empty Font
Specifying the Logic Options
473
For example, to use a lled yellow doghouse symbol to represent milestones on the
Gantt chart, specify the options
VMILE="H" FMILE=ORFONT CMILE=YELLOW
in the CHART statement.
If you wish to represent a CHART variable with an empty blue circled arrow, then
specify the following options in the corresponding SYMBOL statement.
V="Q" F=ORFONTE C=BLUE;
Specifying the Logic Options
The Logic options are a family of options used with the GANTT procedure that en-
able you to view the precedence relationships between activities on the Gantt chart.
The Logic options constitute a high-resolution graphics feature and, as such, are
only valid with specication of the GRAPHICS option in the PROC GANTT state-
ment. The Logic options can accommodate nonstandard precedence relationships.
The Logic options enable you to control the color, line style, and width of the con-
necting arcs as well as their layout and positioning on the Gantt chart. You can
specify the precedence information required to draw the connections in one of two
formats and store it in a data set different from the Schedule data set. You can also
use the Schedule data set produced by PROC CPM to provide the precedence infor-
mation. When using the Schedule data set from PROC CPM, you can ensure that
all the relevant precedence information exists in the data set by either specifying the
XFERVARS option in the PROC CPM statement or by using an ID statement.
The Logic options are not valid with the specication of either a BY statement or the
COMBINE option in the CHART statement.
In order to invoke the logic options, you need to, minimally, specify a set of variables
that denes the precedence relationships between tasks. This can be done using one
of two formats for dening project networks, the AOA specication or the AON
specication.
Activity-on-Arc (AOA) Specication
In the AOA specication, each activity of the project is represented by an arc. The
node at the tail of the arc represents the start of the activity, and the node at the head of
the arc represents the nish of the activity. The relationship between an activity and
its successor is represented by setting the tail node of the successor arc to be the head
node of the activity arc. One of the disadvantages of using the AOA method is that
it cannot accommodate nonstandard lag types; all lag types are of the Finish-to-Start
(FS) type.
The variables required by PROC GANTT to establish a valid AOA specication are
dened using the HEADNODE= and TAILNODE= options in the CHART statement.
474
Chapter 4. The GANTT Procedure
Activity-on-Node (AON) Specication
In the AON specication, each activity is represented by a node. All arcs originating
from an activity terminate at its successors. Consequently, all arcs terminating at an
activity originate from its predecessors.
The variables required by PROC GANTT to establish a valid AON specication are
dened by the ACTIVITY= and SUCCESSOR= options in the CHART statement.
Optionally, nonstandard precedence relationships can be specied using the LAG=
option in the CHART statement to dene a variable that denes the lag type of a
relationship.
Precedence Data Set
When using the AON specication, you can specify the precedence information using
a data set different from the Schedule data set. This is particularly useful when pro-
ducing several Gantt charts for the same project with different schedule information
as would typically be the case when monitoring a project in progress. It eliminates the
requirement that the precedence information exist in each Schedule data set and en-
ables for more compact data. This separate data set is specied by the PRECDATA=
option in the PROC GANTT statement statement and is referred to as the Precedence
data set.
In order to graphically represent the precedence relationships derived from the
Precedence data set on the Gantt chart, you must link the Precedence data set with
the Schedule data set by means of a common variable. This common variable is
selected as the ACTIVITY variable by virtue of the fact that it always exists in the
Precedence data set. Thus, when using the Precedence data set, you need to ensure
that the ACTIVITY variable exists in the Schedule data set, too.
In the event that both a valid AOA and a valid AON specication exist, PROC
GANTT uses the AON specication by default. To override the default, use the AOA
option in the CHART statement.
Drawing the Precedence Connections
The relationship between an activity and its successor is represented on the Gantt
chart by a series of horizontal and vertical line segments that connect their schedule
bars corresponding to a specied type (early/late, actual, and so forth). For a given
connection, the intersection of a horizontal segment with a vertical segment is called
a turning point of the connection. The type of the schedule bar used for the connec-
tion, also called the logic bar, is determined by the LEVEL= option in the CHART
statement.
Every connection is comprised of either three or ve segments and is termed a 3-
segment or a 5-segment connection, respectively. The segments are routed in the
following sequence:
a) a horizontal segment that originates from the appropriate end of the logic bar
corresponding to the activity. The length of this segment is controlled by the
MINOFFGV= and MININTGV= options in the CHART statement.
Specifying the Logic Options
475
b) a vertical segment traveling from activity to the successor
c) a horizontal segment traveling towards the appropriate end of the successors
logic bar. The length of this segment is determined by the MINOFFLV= and
MAXDISLV= options in the CHART statement.
d) a vertical and horizontal segment into the logic bar of the successor
Every connection begins with a horizontal line segment originating fromthe activitys
logic bar and ends with a a horizontal line segment terminating at the successors
logic bar. If the lag type of the relationship is SS or SF, the initial horizontal segment
originates from the left end of the activitys logic bar, otherwise it originates from
the right end of the logic bar. If the lag type of the relationship is SS or FS, the nal
horizontal segment terminates at the left end of the successors logic bar, otherwise it
terminates at the right end of the logic bar.
Note: The ends of the bars must be consistent with the lag type of the connection
if it is to be drawn; that is, the left end of the activitys logic bar must represent a
start time if an SS or SF lag type connection is to be drawn, and the right end of the
activitys logic bar must represent a nish time if an FS or FF lag type connection is
to be drawn.
Violation of these conditions is unlikely when using the Schedule data set gener-
ated by PROC CPM. An example violating these conditions is a Schedule data set
containing incorrect or invalid data. The following example illustrates two observa-
tions that are in violation of these conditions. The rst observation is invalid data
(E
START and L
FINISH times).
E_START E_FINISH L_START L_FINISH
03MAR04 01MAR04 . .
. 05MAR04 07MAR04 .
The following gure illustrates two typical precedence connections between an ac-
tivity and its successor.
ACTIVITY SUCCESSOR LAG
A C FS
B C FS
476
Chapter 4. The GANTT Procedure
Figure 4.9. Typical Precedence Connections
The connection from activity A to activity C is comprised of three segments PQ,
QR, and RT whereas the connection from activity B to activity C is made up of ve
segments UV, VW, WX, XS, and ST; the two additional segments correspond to the
optional segments mentioned in item d) above. Points Q, R, V, W, X, and S are
turning points.
Formatting the Axis
If neither MINDATE= nor MAXDATE= have been specied, the time axis of the
Gantt chart is extended by a small amount in the appropriate direction or directions in
an attempt to capture all of the relevant precedence connections on the chart. While
this will succeed for the majority of Gantt charts, it is by no means guaranteed. If
connection lines still tend to run off the chart, you can perform one or both of the
following tasks.
Use the MINDATE= or MAXDATE= options (or both) in the CHART state-
ment to increase the chart range as necessary.
Decrease the values of the MINOFFGV=, MININTGV=, MAXDISLV=, and
MINOFFLV= options to reduce the horizontal range spanned by the vertical
segments so that they will lie within the range of the time axis.
On the other hand, if the automatic extension supplied by PROC GANTT is exces-
sive, you can suppress it by specifying the NOEXTRANGE option in the CHART
statement.
The following section, Controlling the Layout, addresses the CHART statement
options MINOFFGV=, MININTGV=, MINOFFLV=, and MAXDISLV= which con-
trol placement of the vertical segments that make up a connection. For most Gantt
charts, default values of these options will sufce since their usage is typically re-
served for ne tuning chart appearance. This section can be skipped unless you
Specifying the Logic Options
477
want to control the layout of the connection. The description of the layout methodol-
ogy and concepts is also useful to help you understand the routing of the connections
in a complex network with several connections of different types.
Controlling the Layout
The concepts of global and local verticals are rst introduced in order to describe the
function of the segment placement controls.
Global Verticals
In the interest of minimizing clutter on the chart, each activity is assigned a maximum
of two vertical tracks for placement of the vertical segment described in item b)
above. One vertical track is maintained for SS and SF lag type connections and is
referred to as the start global vertical of the activity, while the other vertical track is
maintained for FS and FF lag type connections and is referred to as the nish global
vertical of the activity. The term global vertical refers to either start global vertical
or nish global vertical.
Note: The use of the term global is attributed to the fact that in any connection
from an activity to its successor, the global vertical of the activity corresponds to the
only segment that travels from activity to successor.
The following gure illustrates the two global verticals of activity A.
Figure 4.10. Global Verticals
Activity A has four successors: activities B, C, D, and E. The lag type of the relation-
ship between A and B is nonstandard, namely Start-to-Start, as is that between A
and D. The other two lag types are standard. The start and nish global verticals of
activity A are represented by the two dotted lines. The vertical segments of the SS lag
type connections from A to B and from A to D that are placed along the start global
vertical of A are labeled PQ and RS, respectively. The vertical segments of the FS lag
type connections from A to C and from A to E that are placed along the nish global
vertical of A are labeled TU and UV, respectively.
478
Chapter 4. The GANTT Procedure
For a given connection from activity to successor, the vertical segment that is placed
on the activity global vertical is connected to the appropriate end of the logic bar by
the horizontal segment described in item a) above. The minimum length of this hor-
izontal segment is specied with the MINOFFGV= option in the CHART statement.
Further, the length of this segment is affected by the MININTGV= option in the
CHART statement, which is the minimum interdistance of any two global verticals.
In Figure 4.10, the horizontal segments QW and RX connect the vertical segments
PQ and RS, respectively, to the logic bar and the horizontal segment YU connects
both vertical segments TU and UV to the logic bar.
Local Verticals
Each activity has seven horizontal tracks associated with it, strategically positioned
on either end of the logic bar, above the rst bar of the activity, and below the last bar
of the activity. These tracks are used for the placement of the horizontal segments
described in items c) and d), respectively.
Figure 4.11 illustrates the positions of the horizontal tracks for an activity in a Gantt
chart with four schedule bars. Three of the horizontal tracks, namely track 1,
track 4, and track 7, service the start of the logic bar and are connected to
one another by a vertical track referred to as the Start Local Vertical. Similarly, the
horizontal tracks track 2, track 3, track 5, and track 6 service the nish
of the bar and are interconnected by a vertical track referred to as the Finish Local
Vertical. The local verticals are used for placement of the vertical segment described
in item d) above.
Note: The use of the term local is attributed to the fact that the local vertical is used
to connect horizontal tracks associated with the same activity.
Notice that track 1 and track 7 terminate upon their intersection with the start
local vertical and that track 2 and track 6 terminate upon their intersection
with the nish local vertical.
The minimum distance of a local vertical from its respective bar end is specied with
the MINOFFLV= option in the CHART statement. The maximum displacement of
the local vertical from this point is specied using the MAXDISLV= option in the
CHART statement. The MAXDISLV= option is used to offset the local vertical in
order to prevent overlap with any global verticals.
Arrowheads are drawn by default on the horizontal tracks corresponding to the logic
bar, namely track 3, track 4, and track 5, upon entering the bar and on
continuing pages. The NOARROWHEAD option is used to suppress the display of
arrowheads.
Specifying the Logic Options
479
Figure 4.11. Local Verticals
Routing the Connection
The routing of the precedence connection from an activity to its successor is depen-
dent on two factors, namely
the horizontal displacement of the appropriate global vertical of the activity
relative to the appropriate local vertical of the successor
the vertical position on the task axis of the activity relative to the successor
The routing of a SS or FS type precedence connection from activity to successor
is described below. A similar discussion holds for the routing of a SF or FF type
precedence connection.
Suppose the activity lies above the successor. Let the start local vertical of the succes-
sor be denoted by slv, and let the appropriate global vertical of the activity be denoted
by gv.
CASE 1:
If gv lies to the left of slv, then the connection is routed vertically down along gv
onto track 4 of the successor, on which it is routed horizontally to enter the bar.
The resulting 3-segment connection is shown in Figure 4.12.
480
Chapter 4. The GANTT Procedure
Figure 4.12. 3-Segment Connection
An example of this type of routing is illustrated by the connection between activities
A and C in Figure 4.9.
CASE 2:
If gv lies to the right of slv, then the connection is routed vertically down along gv
onto track 1 of the successor, horizontally to the left to meet slv, vertically down
along slv onto track 4 of the successor and horizontally to the right to enter the
bar. The resulting 5-segment connection is shown in Figure 4.13.
Figure 4.13. 5-Segment Connection
This type of routing is illustrated by the connection between activities B and C in
Figure 4.9.
An identical description applies when the activity lies below the successor, with the
only difference being that track 7 is used in place of track 1 (see Figure 4.11).
Automatic Text Annotation
481
Automatic Text Annotation
The automatic text annotation feature is designed specically for labeling Gantt
charts independently of the SAS/GRAPH Annotate facility. This facility enables
you to display label strings with a minimum of effort and data entry while providing
the capability for more complex chart labeling situations. Some of the properties that
characterize this feature are
the ability to tag labels. This enables you to dene 1-1, 1-many, many-1, and
many-many relationships.
the ability to link label coordinates and label strings to variables in the Schedule
data set. This enables the Label data set to remain unchanged even if the
Schedule data set changes, such as when monitoring a project.
the ability to automatically format or convert numeric variable values that have
been specied for label text strings
the ability to automatically split strings embedded with blanks to make the
pieces as equal in length as possible, with the provision to override this behav-
ior by specifying a split character
the ability to mix data and percentage coordinates
the ability to clip labels running off the frame of the Gantt chart
All relevant information is contained in a SAS data set specied using the
LABDATA= data set option in the PROC GANTT statement. This data set is also
referred to as the Label data set in the context of this documentation. The Label data
set is required to contain certain variables in order to determine the label string and
the positional information related to the string. At the very least, it requires three
variables, one to determine the string to be displayed, one to determine the horizontal
position, and one to determine the vertical position. The procedure terminates if it
cannot nd the required variables.
Determining the ... requires the following variables
Label text string
LVAR and/or
LABEL
Horizontal placement position
XVAR and/or
X
Vertical placement position LABVAR= and/or
Y
The LABVAR variable refers to the variable specied with the LABVAR= option
in the CHART statement. It is the LABVAR variable that links the Schedule and
Label data sets together. As far as possible, the procedure attempts to use the
X,
Y,
and
LABEL variables in the Label data set. However, a link established using the
LABVAR variable makes the Schedule data set a secondary source of information for
determining positional and text string information for linked observations. The exact
meaning of the preceding variables is explained later in this chapter.
Note that, other than the preceding requirements, there are no further restrictions on
the Label data set. In fact, the Schedule data set can also be specied as the Label data
482
Chapter 4. The GANTT Procedure
set as long as the required variables are present. There are several optional variables
in the Label data set. These variables enable you to specify offsets in both horizontal
and vertical directions from the given coordinate position; adjust graphical attributes
such as baseline angles, character rotations, colors, fonts, and heights; control justi-
cation of strings; control placement behavior at pagebreaks; and specify coordinate
reference systems for the horizontal and vertical values.
Label Data Set
You specify the Label data set using the LABDATA= option in the PROC GANTT
statement. This initiates the labeling of the Gantt chart. The Label data set contains
the information that provides the means of determining the label strings and their
placement positions. As far as possible, the procedure attempts to use the
X,
Y,
and
LABEL variables in the Label data set to extract the horizontal position, the
vertical position, and the text string, respectively. The Schedule data set acts as a
secondary source of information for all Label data set observations that are linked to
it. The priority mechanism is described in the Determining the Vertical Position
section on page 482.
Determining the Vertical Position
You can specify the vertical position for a label string in one of two ways, either
directly by using the
Y variable in the Label data set or indirectly by associating the
label with an activity or activities. In the latter case, the vertical position is determined
by the relative position of the activity on the activity axis of the Gantt chart.
Directly using
Y
The procedure determines the vertical position using the
Y variable. You specify the
coordinate system for the value of
Y with the optional
YSYS variable. A value of
DATA or DATAVAL for the
YSYS variable indicates that the unit of measurement
is data values. This is also the default coordinate system for
Y. A value of PCT or
PCTVAL indicates that the unit of measurement is percentage of the procedure output
area. When the coordinate system for
Y is based on data values, the values that
Y
can take are restricted to positive real numbers with the exception of -1, which is a
special value indicating that the label be displayed for every activity. In effect, this is
a more concise way of linking a label to every activity.
Indirectly using LABVAR=
If the
Y variable does not exist or its value is missing, the procedure uses the
value of the LABVAR variable to determine the vertical position of the label. If
the LABVAR= option is specied and the value of the LABVAR variable is nonmiss-
ing, the observation is displayed for every activity that provides a matching value for
the LABVAR variable. It is quite possible that there are no activities that provide a
match, in which case the Label data set observation is ignored. Likewise, the Label
data set observation is ignored if the value of the LABVAR variable is missing,
When the vertical position is based on an integer value for
Y or linkage using the
LABVAR variable, the default position for the baseline of the string is the top of
the rst schedule bar corresponding to the activity (unless offsets
XOFFSET or
LABEL variable does not exist or its value is missing, the procedure ignores the
label data observation if the observation is not linked to an activity in the Schedule
data set. However, if the label is linked to an activity (either by the LABVAR vari-
able or a value of -1 for
Y, as described previously), the procedure extracts the text
string from the Schedule data set using the
LVAR variable. The
LVAR variable
values are names of variables in the Schedule data set. If the
LVAR value is not
missing, the text string is the value of the specied variable in the Schedule data set
corresponding to the activity. If no such variable exists in the Schedule data set or if
the value is missing, no label is displayed for this particular (activity, label) link.
Note that the
LABEL variable and the Schedule data set variables named by
LVAR
are not restricted to be of character type. These variables can be character or numeric,
formatted or unformatted. The strings are displayed using the following rules:
If the variable is of character type, the label is the character string correspond-
ing to the given activity.
If the variable is of numeric type and formatted, the label is the formatted string.
If the variable is of numeric type and unformatted, the label is the number
displayed as a string with an integer part of up to LABMAXINT= digits
and a maximum of MAXDEC= decimal positions. The LABMAXINT= and
MAXDEC= options are specied in the PROC GANTT statement and their
default values are 16 and 2, respectively.
Optional Information
In addition to specifying the horizontal and vertical coordinates as described previ-
ously, you can also specify a relative offset from these values using the
XOFFSET
and
YOFFSET variables. These are optional variables and their default values are
both 0. The unit of measurement for the
XOFFSET variable is in MININTERVAL
units, and the direction of increase is from left to right. The unit of measurement for
the
YOFFSET variable is in barheights, and the direction of increase is from top to
bottom. When labels are split, the offset variables pertain only to the rst piece of the
label. The positions of the remaining split pieces are determined from the positioning
of the rst piece. The adjusted coordinate after taking the offsets into account is what
is used for the placement of the string and is known as the referenced coordinate.
You can control the color and font of the label strings using the
CLABEL and
FLABEL variable does not exist or its value is missing, the value of the FONT=
option in the CHART statement is used.
Automatic Text Annotation
485
You can control the height of the label strings with the
HLABEL variable. The
units of measurement are in barheights. If the
HLABEL variable does not exist or
its value is missing, the default value of 1 is used.
You can specify the angle of the character baseline with respect to the horizontal in
degrees using the
ALABEL variable. If the
ALABEL variable does not exist or its
value is missing, the default value of 0 is used. You can specify the rotation angle of
each character in the string in degrees with the
RLABEL variable. If the
RLABEL
variable does not exist or its value is missing, the default value of 0 is used.
You can control the alignment of the string with the
JLABEL variable. Strings can
be displayed left-justied, right-justied, or centered at the specied coordinate. By
default, all strings are displayed left-justied. The valid values are L or LEFT for
left justication, R or RIGHT for right justication, and C or CENTER for centered
justication.
The
PAGEBRK variable gives you displaying control when the referenced coordi-
nate of a label coincides with a pagebreak tickmark and the horizontal coordinate is
measured in data values. You can specify on which of the two pages you would like
the label to be displayed. The default always displays the label on the rst page asso-
ciated with the common tickmark except when the tickmark is the very rst tickmark
on the Gantt chart. Valid values are 0 (default), 1 (use rst page), or 2 (use second
page).
Variables in the LABELDATA= data set
The following table lists all the variables associated with the Label data set and their
interpretations by the GANTT procedure. The table also lists for each variable its
type, the possible values it can assume, and its default value.
486
Chapter 4. The GANTT Procedure
Table 4.26. Label Data Set Variables
Name Type Description Allowed Values Defaults
Y N y position
X N x position
NO are assumed to denote a new activity. Further, the data are as-
sumed to be sorted by SEGMT
START and S
FINISH
times. Furthermore, PROC GANTT plots the baseline schedule correspond-
ing to the BS and BF variables based on the last such observation, namely the
observation with the largest value for the SEGMT
NO variable.
In addition to the schedules that are plotted, the Gantt chart also displays any variables
specied in the CHART statement. Holidays, weekends, and breaks within a day are
marked as appropriate. For details on how to specify holidays, weekends, and breaks
within a day, see the Multiple Calendars and Holidays section on page 457. You
can also represent zero duration activities with milestone symbols, draw a timenow
line to reect the current time of the project, draw horizontal connect lines, draw
vertical reference lines, and group the activities by zones on the Gantt chart. It is
important to note that all times are plotted at the start of the appropriate time period.
Thus, if the chart starts on June 1, 2004, in column 15 of the page and the value of
E
ERROR
MEMORY
ERROR
IO
ERROR
SEMANTIC
ERROR
SYNTAX
ERROR
GANTT
BUG
UNKNOWN
ERROR
The notation chartiinfo is a string of the form
SCALE= INCREMENT= SKIP= HPAGES= VPAGES= SEGNAME=
if there are no BY groups, and it is a string of the form
BY1 by1info: . . . BYm byminfo:
where byjinfo is a string of the form
SCALE= INCREMENT= SKIP= HPAGES= VPAGES= SEGNAME=
if there are m BY groups. In other words, the macro contains an informational sub-
string for every chart produced, using the symbol # as a CHART statement delim-
iter and the symbol : as a BY statement delimiter within CHART statements.
The chart specic information given in
ORGANTT is described below along with
the identifying keyword preceding it. It should be noted that these values refer to
those actually used in producing the chart and are not necessarily the same as those
specied in the invocation of the procedure.
SCALE= The value of scale
INCREMENT= The value of increment
SKIP= The value of skip
HPAGES= The number of horizontal pages
Computer Resource Requirements
491
VPAGES= The number of vertical pages
SEGNAME= The name of the rst chart segment in graphics mode
Note: Some of the information may be redundant or predictable in certain display
modes. For example, the value of SEGNAME= is empty in line-printer and full-
screen modes. The values of HPAGES= and VPAGES= are equal to 1 in full-screen
mode.
This information can be used when PROCGANTT is one step in a larger programthat
needs to determine whether the procedure terminated successfully or not. Because
ORGANTT is a standard SAS macro variable, it can be used in the ways that all
macro variables can be used.
Computer Resource Requirements
There is no inherent limit on the size of the project that can be accommodated by the
GANTT procedure. The number of activities in the Gantt chart is restricted only by
the amount of memory available. Other memory-dependent factors are the type of
Gantt chart required and the desired display mode.
Naturally, there needs to be a sufcient amount of core memory available in order to
invoke and initialize the SAS System as well as to meet the memory requirements of
the specic mode in which you invoke the procedure. For example, more memory
is required when using high-resolution graphics than when using line-printer mode
since the graphics sublibrary has to be loaded. As far as possible, the procedure
attempts to store all the data in core memory. However, if there is insufcient core
memory available for the entire project, the GANTT procedure resorts to the use of
Utility data sets and swaps between core memory and Utility data sets as necessary.
The data storage requirement for the GANTT procedure is proportional to the num-
ber of activities in the project, and it depends on the number of schedule variables,
the number of ID variables, and whether the Logic and Labeling options have been
specied or not.
492
Chapter 4. The GANTT Procedure
Examples
This section contains examples that illustrate several of the options and statements
available with PROC GANTT in the different display modes. Example 4.1 and
Example 4.2 illustrate the GANTT procedure in line-printer mode, and Example 4.3
through Example 4.27 illustrate the GANTT procedure in graphics mode.
Line-Printer Examples
Example 4.1 shows how to obtain a basic line-printer Gantt chart using the default
options. Example 4.2 demonstrates how to use various options to customize the Gantt
chart for the same project.
Example 4.1. Printing a Gantt Chart
This example shows how to use the GANTT procedure to obtain a basic line-printer
Gantt chart using the default options. The following data describe the precedence
relationships among the tasks involved in the construction of a typical oor in a mul-
tistory building. The rst step saves the precedence relationships in a SAS data set.
The variable ACTIVITY names each task, the variable DURspecies the time it takes
to complete the task in days, and the variables SUCCESS1 to SUCCESS4 specify
tasks that are immediate successors to the task identied by the ACTIVITY variable.
PROC CPM determines the shortest schedule for the project that nishes before
September 1, 2004. The solution schedule, saved in a SAS data set, is next sorted
by the early start time before invoking the GANTT procedure to plot the schedule.
Since the DATA= option is not specied, PROC GANTT uses the sorted data set to
produce the schedule since it is the most recently created data set. The Gantt chart
in Output 4.1.1 is plotted on two pages because there are too many observations (29)
to t on one page. Note that the observations are split into two groups containing 15
and 14 observations, respectively, so that the chart size on each page is approximately
equal. The time axis is labeled from June 21, 2004, to September 1, 2004, since these
are the minimum and maximum dates in the Schedule data set. A legend is displayed
at the bottom of the chart on each page.
title Gantt Example 1;
title2 Printing a Gantt Chart;
data;
format activity $20. success1 $20. success2 $20.
success3 $20. success4 $20.;
input activity dur success1-success4;
datalines;
form 4 pour . . .
pour 2 core . . .
core 14 strip spray_fireproof insulate_walls .
strip 2 plumbing curtain_wall risers doors
strip 2 electrical_walls balance_elevator . .
curtain_wall 5 glaze_sash . . .
glaze_sash 5 spray_fireproof insulate_walls . .
Example 4.1. Printing a Gantt Chart
493
spray_fireproof 5 ceil_ducts_fixture . . .
ceil_ducts_fixture 5 test . . .
plumbing 10 test . . .
test 3 insulate_mechanical . . .
insulate_mechanical 3 lath . . .
insulate_walls 5 lath . . .
risers 10 ceil_ducts_fixture . . .
doors 1 port_masonry . . .
port_masonry 2 lath finish_masonry . .
electrical_walls 16 lath . . .
balance_elevator 3 finish_masonry . . .
finish_masonry 3 plaster marble_work . .
lath 3 plaster marble_work . .
plaster 5 floor_finish tiling acoustic_tiles .
marble_work 3 acoustic_tiles . . .
acoustic_tiles 5 paint finish_mechanical . .
tiling 3 paint finish_mechanical . .
floor_finish 5 paint finish_mechanical . .
paint 5 finish_paint . . .
finish_mechanical 5 finish_paint . . .
finish_paint 2 caulking_cleanup . . .
caulking_cleanup 4 finished . . .
;
* invoke cpm to find the optimal schedule;
proc cpm finishbefore date=1sep04d;
activity activity;
duration dur;
successors success1-success4;
run;
* sort the schedule by the early start date;
proc sort;
by e_start;
run;
* invoke proc gantt to print the schedule;
proc gantt lineprinter;
run;
494
Chapter 4. The GANTT Procedure
Output 4.1.1. Printing a Gantt Chart
Gantt Example 1
Printing a Gantt Chart
JUN JUN JUL JUL JUL JUL JUL AUG AUG AUG AUG AUG SEP
Job 21 24 27 30 03 06 09 12 15 18 21 24 27 30 02 05 08 11 14 17 20 23 26 29 01
-+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+-
| |
1 |*===* |
| |
2 | *=* |
| |
3 | *=============* |
| |
4 | *=* |
| |
5 | *=* |
| |
6 | *====* |
| |
7 | <---------*.........> |
| |
8 | <----<---->....> |
| |
9 | <>.....................<> |
| |
10 | <---------<----->.........> |
| |
11 | <-->...................<..> |
| |
12 | <->....................<.> |
| |
13 | <-->...................<..> |
| |
14 | *====* |
| |
15 | *====* |
| |
-+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+-
LEGEND
Symbol Explanation
<----> Duration of a Normal Job
>....> Slack Time for a Normal Job
*====* Duration of a Critical Job
Example 4.1. Printing a Gantt Chart
495
Gantt Example 1
Printing a Gantt Chart
JUN JUN JUL JUL JUL JUL JUL AUG AUG AUG AUG AUG SEP
Job 21 24 27 30 03 06 09 12 15 18 21 24 27 30 02 05 08 11 14 17 20 23 26 29 01
-+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+-
| |
16 | <---->.....<....> |
| |
17 | *====* |
| |
18 | *==* |
| |
19 | *==* |
| |
20 | *==* |
| |
21 | *====* |
| |
22 | <-<>.> |
| |
23 | *====* |
| |
24 | <-<>.> |
| |
25 | *====* |
| |
26 | *====* |
| |
27 | *====* |
| |
28 | *=* |
| |
29 | *===*|
| |
-+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+-
LEGEND
Symbol Explanation
<----> Duration of a Normal Job
>....> Slack Time for a Normal Job
*====* Duration of a Critical Job
496
Chapter 4. The GANTT Procedure
Example 4.2. Customizing the Gantt Chart
This example shows how to control the format of the Gantt chart using CHART state-
ment options. The Schedule data set used by PROC GANTT is the same as that used
in Example 4.1. Output 4.2.1 is on three pages; the rst page contains a detailed
description of the various symbols used by the procedure to plot the schedule. This
description is produced by using the SUMMARY option. The next two pages con-
tain the Gantt chart. The LINEPRINTER option invokes the procedure in line-printer
mode. The FILL option causes the rst page to be lled as completely as possible be-
fore the second page is started. Thus, the rst page of the chart contains 20 activities
while the second page contains only 8 activities.
The SKIP=2 specication causes two lines to be skipped between observations. The
NOLEGEND option suppresses displaying of the legend, while the NOJOBNUM
option causes job numbers to be omitted. The CRITFLAG option is used to produce
the ag to the left of the main chart indicating if an activity is critical. Specifying
BETWEEN=2 sets the number of columns between consecutive ID columns equal to
2. The REF= option produces the reference lines shown on the chart on the specied
dates. The INCREMENT=5 specication indicates to the procedure that labels are
to be displayed in increments of 5 units of the MININTERVAL= value, which by
default is DAY. The ID statement is used to display the activity names to the left of
the chart. The ID statement also causes the activity strip to appear only once in the
chart. Thus, there are only 28 activities in this chart instead of 29, as in Example 4.1.
options ps=70;
title Gantt Example 2;
title2 Customizing the Gantt Chart;
proc gantt lineprinter;
chart / summary
fill
skip=2
nolegend
nojobnum critflag between=2
ref=10jun04d to 30aug04d by 15
increment=5;
id activity;
run;
Example 4.2. Customizing the Gantt Chart
497
Output 4.2.1. Customizing the Gantt Chart
Gantt Example 2
Customizing the Gantt Chart
Summary
Symbols used for different times on the schedule
Variable Symbol Variable Symbol
E_START < L_START <
E_FINISH > L_FINISH >
Miscellaneous Symbols
Symbol Explanation
| Reference Line
* Overprint character when start or
finish times coincide
Symbols used for joining start and/or finish times
Symbol Explanation
- Duration of non-critical job
. Slack time for non-critical job
= Duration of critical job
- Slack time(neg.) for supercritical job
* Duration of supercritical job
Some examples of typical strings
String Description
<--->...<...> Duration followed by slack time:
early finish before late start
<---<--->...> Duration followed by slack time:
early finish after late start
<---*...> Duration followed by slack time:
early finish equals late start
*===* Duration of job on critical path
<--->---<***> Duration preceded by negative slack
time for a supercritical job:
late finish before early start
<---<***>***> Duration preceded by negative slack
time for a supercritical job:
late finish after early start
<---****> Duration preceded by negative slack
time for a supercritical job:
late finish equals early start
498
Chapter 4. The GANTT Procedure
Gantt Example 2
Customizing the Gantt Chart
JUN JUN JUL JUL JUL JUL JUL JUL JUL AUG AUG AUG AUG AUG AUG SEP
activity Flag 21 26 01 06 11 16 21 26 31 05 10 15 20 25 30 04
-+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+-
| | | | | | |
| | | | | | |
form CR |*===* | | | | |
| | | | | | |
| | | | | | |
pour CR | *=* | | | | |
| | | | | | |
| | | | | | |
core CR | | *============|* | | | |
| | | | | | |
| | | | | | |
strip CR | | |*=* | | | |
| | | | | | |
| | | | | | |
curtain_wall CR | | | *====* | | | |
| | | | | | |
| | | | | | |
plumbing | | | <---------*.|.......> | | |
| | | | | | |
| | | | | | |
risers | | | <----<---->.|..> | | |
| | | | | | |
| | | | | | |
doors | | | <>..........|..........<> | | |
| | | | | | |
| | | | | | |
electrical_walls | | | <---------<-|--->.........>| | |
| | | | | | |
| | | | | | |
balance_elevator | | | <-->........|..........<..>| | |
| | | | | | |
| | | | | | |
port_masonry | | | <->........|...........<.>| | |
| | | | | | |
| | | | | | |
finish_masonry | | | <-->.....|.............<|.> | |
| | | | | | |
| | | | | | |
glaze_sash CR | | | *====* | | | |
| | | | | | |
| | | | | | |
spray_fireproof CR | | | *=|==* | | |
| | | | | | |
| | | | | | |
insulate_walls | | | <-|-->.....<....>| | |
| | | | | | |
| | | | | | |
ceil_ducts_fixture CR | | | | *====* | | |
| | | | | | |
| | | | | | |
test CR | | | | *==* | | |
| | | | | | |
| | | | | | |
insulate_mechanical CR | | | | *==*| | |
| | | | | | |
| | | | | | |
lath CR | | | | *|=* | |
| | | | | | |
| | | | | | |
plaster CR | | | | | *====* | |
| | | | | | |
| | | | | | |
-+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+-
Graphics Examples
499
Gantt Example 2
Customizing the Gantt Chart
JUN JUN JUL JUL JUL JUL JUL JUL JUL AUG AUG AUG AUG AUG AUG SEP
activity Flag 21 26 01 06 11 16 21 26 31 05 10 15 20 25 30 04
-+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+-
| | | | | | |
| | | | | | |
marble_work | | | | | <-<>.> | |
| | | | | | |
| | | | | | |
acoustic_tiles CR | | | | | *====* | |
| | | | | | |
| | | | | | |
tiling | | | | | <-<>.> | |
| | | | | | |
| | | | | | |
floor_finish CR | | | | | *====* | |
| | | | | | |
| | | | | | |
paint CR | | | | | *==|=* |
| | | | | | |
| | | | | | |
finish_mechanical CR | | | | | *==|=* |
| | | | | | |
| | | | | | |
finish_paint CR | | | | | | *=* |
| | | | | | |
| | | | | | |
caulking_cleanup CR | | | | | | *===* |
| | | | | | |
| | | | | | |
-+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+-
Graphics Examples
The following examples illustrate the use of graphics options and the use of
PATTERN and SYMBOL statements to produce high resolution graphics quality
Gantt charts. In Example 4.3, an extra input data set containing the holiday infor-
mation is used to mark the holidays used in computing the schedule by PROC CPM.
Example 4.4 illustrates the use of the CHART statement to specify milestones and
additional variables to be plotted on the chart. Example 4.5 illustrates the use of
the COMPRESS option to t an entire Gantt chart on one page. Example 4.6 il-
lustrates the use of the MININTERVAL= and SCALE= options to control the width
of the chart; this example also shows how the chart is divided and continued on the
succeeding page when the time axis extends beyond one page. In Example 4.7, the
MINDATE= and MAXDATE= options are used to permit viewing of only a portion of
the schedule in greater detail. Example 4.8 uses the HOLIDUR= option in conjunc-
tion with the INTERVAL= option to mark holidays of varying lengths on the Gantt
chart. Example 4.9 illustrates the use of the CALENDAR and WORKDAY data sets
to mark holiday information from different calendars on the chart.
In Example 4.10, the actual schedule for each activity is plotted on a separate line
in addition to the early and late schedules. Example 4.11 illustrates tracking a
project and comparing its progress against a baseline schedule. In Example 4.12,
the COMBINE option is used to concatenate the early, late, and actual schedules
of a project in progress to produce a single concise schedule that retains all of
the vital information of the former schedules. Example 4.13 shows the resource-
constrained schedule containing split segments of activities. The ability to bypass
the project scheduler, PROC CPM, and directly specify the schedule information to
500
Chapter 4. The GANTT Procedure
PROC GANTT is demonstrated in Example 4.14. Example 4.15 illustrates the use
of the BY statement to obtain Gantt charts for different projects in a multiproject
environment. In Example 4.16, the GANTT procedure is used after some data ma-
nipulation steps to produce Gantt charts for individuals, each working on different
subsets of activities in the project.
In Example 4.17, the HEIGHT= and HTOFF= options are used to modify the text
height in relation to the height of the activity bars. The next three examples show you
how to invoke the different logic options in order to draw a Logic Gantt chart that
displays the precedence relationships between activities. Example 4.18 illustrates
use of the ACTIVITY= and SUCCESSOR= options to specify the precedence infor-
mation in AON format and the LEVEL= option to specify the bar type for the connec-
tions. In Example 4.19, the routing control options MAXDISLV=, MAXOFFGV=,
MAXOFFLV=, and MININTGV= are used in connection with a project that is spec-
ied in AOA format using the TAIL= and HEAD= options in the CHART state-
ment. Example 4.20 demonstrates the specication of nonstandard lag types using
the LAG= option in the CHART statement. This example also illustrates use of
the PRECDATA= option in the PROC GANTT statement. In Example 4.21, the
ANNOTATE= option is used to add graphics and text on a Gantt chart. Example 4.22
illustrates the Automatic Text Annotation facility to label the Gantt chart indepen-
dently of the SAS/GRAPH Annotate facility. In Example 4.23 a PATTERN variable
and a Label data set are used to generate Gantt charts for multiprojects. A very use-
ful chart in project management and multiprocess environments is the multisegment
Gantt chart. Example 4.24 illustrates the use of the SEGMT
START, E
FINISH, L
START, and L
FINISH; hence,
the ES=, EF=, LS=, and LF= options are not needed in the CHART statement. Unless
otherwise specied, the pattern statements used in the examples are as follows:
pattern1 c=black v=x1; /* duration of a noncrit. activity */
pattern2 c=black v=l1; /* slack time for a noncrit. act. */
pattern3 c=black v=s; /* duration of a critical act. */
pattern4 c=black v=r1; /* slack time for a supercrit. act. */
pattern5 c=black v=x2; /* duration of a supercrit. act. */
pattern6 c=black v=x4; /* actual duration of an activity */
pattern7 c=black v=e; /* break due to a holiday */
pattern8 c=black v=x3; /* resource schedule of activity */
pattern9 c=black v=l2; /* baseline schedule of activity */
Example 4.3. Marking Holidays
501
Example 4.3. Marking Holidays
This example uses the widget manufacturing project introduced in Chapter 2, The
CPM Procedure. The data sets used in this example are the same as those used in
Example 2.8 to illustrate holiday processing in PROC CPM. The WIDGET data set
describes the project in AON format. The variable TASK identies the activity and
the variables SUCC1, SUCC2, and SUCC3 identify the successors to TASK. The
variable DAYS denes the duration of an activity. Another data set, HOLIDAYS,
denes the holidays that need to be taken into account when scheduling the project.
Although the HOLIDAYS data set contains three variables HOLIDAY, HOLIFIN, and
HOLIDUR, the HOLIDUR variable is not used in this example. Thus, the Christmas
holiday starts on December 24, 2003, and nishes on December 26, 2003. PROC
CPM schedules the project to start on December 1, 2003, and saves the schedule in a
data set named SAVEH. This data set is shown in Output 4.3.1.
Next, the GANTT procedure is invoked with the specication of HOLIDATA=
HOLIDAYS in the PROC GANTT statement and the HOLIDAY= and HOLIEND=
options in the CHART statement, causing the Christmas and New Year holidays to
be marked on the chart. The resulting Gantt chart is shown in Output 4.3.2. Note that
the procedure marks the duration of the holiday with the pattern corresponding to the
seventh PATTERN statement. (See the Graphics Examples section beginning on
page 499 for a list of the pattern statements used in the examples.) The HPAGES=
option is used to t the horizontal span of the chart on one page. The SIMPLEX font
is used for all text by specifying the FONT= option in the CHART statement.
options ps=60 ls=100;
title Gantt Example 3;
title2 Marking Holidays;
/* Activity-on-Node representation of the project */
data widget;
format task $12. succ1-succ3 $12. ;
input task & days succ1 & succ2 & succ3 & ;
datalines;
Approve Plan 5 Drawings Anal. Market Write Specs
Drawings 10 Prototype . .
Anal. Market 5 Mkt. Strat. . .
Write Specs 5 Prototype . .
Prototype 15 Materials Facility .
Mkt. Strat. 10 Test Market Marketing .
Materials 10 Init. Prod. . .
Facility 10 Init. Prod. . .
Init. Prod. 10 Test Market Marketing Evaluate
Evaluate 10 Changes . .
Test Market 15 Changes . .
Changes 5 Production . .
Production 0 . . .
Marketing 0 . . .
;
502
Chapter 4. The GANTT Procedure
data holidays;
format holiday holifin date7.;
input holiday & date7. holifin & date7. holidur;
datalines;
24dec03 26dec03 4
01jan04 . .
;
* schedule the project subject to holidays;
proc cpm data=widget holidata=holidays
out=saveh date=1dec03d ;
activity task;
succ succ1 succ2 succ3;
duration days;
holiday holiday / holifin=(holifin);
run;
* sort the schedule by the early start date ;
proc sort;
by e_start;
run;
* print the schedule;
proc print data=saveh;
var task days e_start e_finish l_start l_finish
t_float f_float;
run;
* plot the schedule;
proc gantt holidata=holidays data=saveh;
chart / holiday=(holiday) holiend=(holifin)
hpages=1 font=simplex;
id task;
run;
Example 4.3. Marking Holidays
503
Output 4.3.1. Schedule Data Set SAVEH
Gantt Example 3
Marking Holidays
Obs task days E_START E_FINISH L_START L_FINISH T_FLOAT F_FLOAT
1 Approve Plan 5 01DEC03 05DEC03 01DEC03 05DEC03 0 0
2 Drawings 10 06DEC03 15DEC03 06DEC03 15DEC03 0 0
3 Anal. Market 5 06DEC03 10DEC03 09JAN04 13JAN04 30 0
4 Write Specs 5 06DEC03 10DEC03 11DEC03 15DEC03 5 5
5 Mkt. Strat. 10 11DEC03 20DEC03 14JAN04 23JAN04 30 30
6 Prototype 15 16DEC03 03JAN04 16DEC03 03JAN04 0 0
7 Materials 10 04JAN04 13JAN04 04JAN04 13JAN04 0 0
8 Facility 10 04JAN04 13JAN04 04JAN04 13JAN04 0 0
9 Init. Prod. 10 14JAN04 23JAN04 14JAN04 23JAN04 0 0
10 Evaluate 10 24JAN04 02FEB04 29JAN04 07FEB04 5 5
11 Test Market 15 24JAN04 07FEB04 24JAN04 07FEB04 0 0
12 Marketing 0 24JAN04 24JAN04 13FEB04 13FEB04 20 20
13 Changes 5 08FEB04 12FEB04 08FEB04 12FEB04 0 0
14 Production 0 13FEB04 13FEB04 13FEB04 13FEB04 0 0
Output 4.3.2. Marking Holidays on the Gantt Chart
504
Chapter 4. The GANTT Procedure
Example 4.4. Marking Milestones and Special Dates
The widget manufacturing project described in Example 4.3 has two activities with
zero duration, namely Production and Marketing. By default, PROCGANTT pads
nish times by a padding unit, thus these two activities are represented on the Gantt
chart as having a duration equal to one day (see the Specifying the PADDING=
Option section on page 454 for further information on padding). In other words,
based on start and nish times alone, PROC GANTT cannot distinguish between ac-
tivities that are one day or zero days long; it needs knowledge of the activity duration
variable, which is specied using the DUR= option in the CHART statement, in order
to represent zero duration activities by a milestone symbol.
Now, suppose that the Engineering department would like to nish writing up the
specications before Christmas and have the prototype ready by mid-January. In
addition, the Marketing department would like to develop a marketing concept by
the years end. The data set, TARGET, contains the target dates for these activities.
This data set is merged with the WIDGET data set to produce the WIDGETT data
set. The WIDGETT data set is then input to the CPM procedure, which is invoked
with an ID statement to ensure that the variable TARGET is passed to the Schedule
data set. After sorting the Schedule data set by the early start time, PROC GANTT is
used to produce a Gantt chart of the resulting schedule. The Gantt chart is shown in
Output 4.4.1.
Before invoking PROC GANTT, you specify the required symbol using a SYMBOL
statement. Specifying the variable TARGET in the CHART statement causes target
dates to be marked on the chart with the symbol specied in the SYMBOL statement,
Example 4.4. Marking Milestones and Special Dates
505
a PLUS symbol in black. Specifying the DUR= option in the CHART statement
causes zero duration schedules to be represented on the chart by the default milestone
symbol, a lled diamond. To use a different milestone symbol, use the FMILE=
and VMILE= options in the CHART statement. The duration and slack time of the
activities are indicated by the use of the appropriate ll patterns as explained in the
legend.
Colors for the milestone, axis, frame ll, and text are specied using the options
CMILE=, CAXIS=, CFRAME=, and CTEXT=, respectively. The SIMPLEX font
is used for all text by specifying the FONT= option in the CHART statement. The
global options HPOS= and VPOS= are set to 120 and 40, respectively.
options ps=60 ls=100;
title f=swiss Gantt Example 4;
title2 f=simplex Marking Milestones and Special Dates;
proc cpm data=widgett date=1dec03d;
activity task;
successor succ1-succ3;
duration days;
id target;
run;
* sort the schedule by the early start date ;
proc sort;
by e_start;
run;
goptions hpos=120 vpos=40;
* set up required symbol statement;
symbol c=black v=plus;
* plot the schedule;
proc gantt;
chart target / dur=days cmile=cyan
font=simplex ctext=blue
caxis=cyan cframe=ligr;
id task;
run;
506
Chapter 4. The GANTT Procedure
Output 4.4.1. Marking Milestones and Special Dates in Graphics Mode
Example 4.5. Using the COMPRESS Option
507
Example 4.5. Using the COMPRESS Option
In the previous example, PROC GANTT produced two pages of output since the
chart would not t on a single page. One way to ensure that the entire chart ts on a
single page in graphics mode is to adjust the values of HPOS and VPOS accordingly.
An easier way that is independent of the values of HPOS and VPOS is to specify
the COMPRESS option in the CHART statement. Output 4.5.1 shows the result
of adding the COMPRESS option to the CHART statement in Example 4.4. The
PCOMPRESS option would have a similar effect but would maintain the aspect ratio
as well. Some other options that can be used to control the number of pages generated
are the HPAGES= and VPAGES= options.
title f=swiss Gantt Example 5;
title2 f=simplex Using the COMPRESS Option;
* plot the schedule on one page;
proc gantt;
chart target / dur=days cmile=cyan
font=simplex ctext=blue
caxis=cyan cframe=ligr
compress;
id task;
run;
Output 4.5.1. Using the COMPRESS Option
508
Chapter 4. The GANTT Procedure
Example 4.6. Using the MININTERVAL= and SCALE= Options
The data sets used for this example are the same as those used to illustrate PROC
CPM in Example 2.2. The data set WIDGAOA denes the project using the AOA
specication. The data set DETAILS species the abbreviated and detailed names
for each of the activities in addition to the name of the department that is responsible
for that activity. Notice that a dummy activity has been added to the project in order
to maintain the precedence relationships established by the WIDGET data set of the
previous two examples that dene the same project in AON format. The two data sets
WIDGAOA and DETAILS are merged to form the WIDGETA data set that is input
as the Activity data set to PROC CPM. The data set SAVE produced by PROC CPM
and sorted by E
CAL calendar
has ve 10-hour workdays (8 a.m. - 6 p.m.) on Monday through Friday, a
4-hour halfday (8 a.m. - 12 noon) on Saturday and a holiday on Sunday.
The PROD
CAL is made up of eleven 8-hour shifts per week; six day shifts and
ve night shifts.
The Eng
cal cal-
endar has the same work pattern as the default calendar with an extra holiday
period of seven days starting on December 8, 2003.
Example 4.9. Multiple Calendars
517
The HOLIDATA data set denes the appropriate holidays for the different calendars.
The project data set WIDGVAC includes a variable named CAL to identify the ap-
propriate calendar for each activity.
Output 4.9.1. Multiple Calendars: Data Sets
Multiple Calendars
Workdays Data Set
Obs fullday halfday ovtday s1 s2 s3
1 8:00 8:00 8:00 . 8:00 .
2 16:00 12:00 18:00 6:00 18:00 6:00
3 . . . 8:00 20:00 8:00
4 . . . 18:00 . 18:00
5 . . . 20:00 . .
6 . . . . . .
Calendar Data Set
Obs cal _sun_ _mon_ _tue_ _wed_ _thu_ _fri_ _sat_
1 DEFAULT holiday fullday fullday fullday fullday fullday holiday
2 OVT_CAL holiday ovtday ovtday ovtday ovtday ovtday halfday
3 PROD_CAL holiday s2 s1 s1 s1 s1 s3
4 Eng_cal
Holidays Data Set
Obs holiday holifin holidur cal
1 08DEC03 . 7 Eng_cal
2 24DEC03 26DEC03 .
3 01JAN04 01JAN04 .
Project Data Set
Obs task days succ1 succ2 succ3 cal
1 Approve Plan 5.5 Drawings Anal. Market Write Specs DEFAULT
2 Drawings 10.0 Prototype DEFAULT
3 Anal. Market 5.0 Mkt. Strat. DEFAULT
4 Write Specs 4.5 Prototype Eng_cal
5 Prototype 15.0 Materials Facility OVT_CAL
6 Mkt. Strat. 10.0 Test Market Marketing DEFAULT
7 Materials 10.0 Init. Prod. DEFAULT
8 Facility 10.0 Init. Prod. DEFAULT
9 Init. Prod. 10.0 Test Market Marketing Evaluate DEFAULT
10 Evaluate 10.0 Changes DEFAULT
11 Test Market 15.0 Changes DEFAULT
12 Changes 5.0 Production DEFAULT
13 Production 0.0 PROD_CAL
14 Marketing 0.0 DEFAULT
518
Chapter 4. The GANTT Procedure
The program used to invoke PROC CPM and PROC GANTT follows. The
CALENDAR= and WORKDAY= options are specied in the PROC GANTT state-
ment to identify the CALEDATA and WORKDATA data sets, respectively. The
CALID= option in the CHART statement names the variable identifying the calendar
that each observation refers to in the WIDGVAC and CALEDATA data sets. Since
the value of MININTERVAL= is DTDAY, setting the SCALE= value to 12 ensures
that a single column on the Gantt chart represents two hours. This is done in or-
der to be able to detect a two hour difference between schedules. Consequently, the
MINDATE= and MAXDATE= options are used to control the output produced by
PROC GANTT. The resulting Gantt chart is shown in Output 4.9.2. Notice the 5
column duration for Prototype on December 29, 2003 representing a 10-hour day
versus the 4 column duration for Mkt. Strat. for the same day representing 8 hours
of work. Although MAXDATE= is set to 8 a.m. on January 2, 2004, the last tick
mark is the beginning of January 3, 2004. This is because the specied value of the
MAXDATE= option does not correspond to a tick mark (based on the SCALE= and
MININTERVAL= options); the value used is the rst tick mark appearing after the
value of the MAXDATE= option.
proc cpm date=01dec03d interval=workday data=widgvac
out=schedvac holidata=holidata
workday=workdata calendar=caledata;
holiday holiday / holifin=holifin holidur=holidur;
activity task;
duration days;
successor succ1 succ2 succ3;
calid cal;
run;
title Gantt Example 9;
title2 Multiple Calendars;
proc gantt data=schedvac holidata=holidata
workday=workdata calendar=caledata ;
chart / holiday=(holiday) holiend=(holifin)
calid=cal
markbreak scale=12
mindate=27dec03:00:00dt
maxdate=02jan04:08:00dt
pcompress;
id task;
run;
Example 4.10. Plotting the Actual Schedule
519
Output 4.9.2. Multiple Calendars
Example 4.10. Plotting the Actual Schedule
Suppose that the project is complete and you want to compare the actual progress of
the activities with the predicted schedule computed by PROC CPM. The following
DATA step stores the actual start and nish times of each activity in a data set named
COMPLETE. A data set named WIDGELA is then created that contains both the
schedule obtained from PROC CPM (the data set SAVEH from Example 4.3 is used
because it does not contain the dummy activity) and the actual schedule. The resulting
data set is sorted by early start time.
The COMPRESS option is employed in order to draw the entire Gantt chart on one
page. Predicted schedules as well as actual schedules are plotted on separate bars for
each activity. The A
START= and A
START
and a missing value for A
START and A
START and B
START= and A
START and A
FINISH,
respectively.
The following example draws a Gantt chart of the early, late, and resource-
Example 4.14. Specifying the Schedule Data Directly
529
constrained schedules for the widget manufacturing project. The schedule informa-
tion is held in the WIDGDIR data set. The WIDGDIR data set contains the vari-
ables TASK, SEGMT
START, E
START and E
FINISH are
recognized as the default names of the early start and early nish variables, respec-
tively. The variables SDATE and FDATE dene the late start and late nish times,
respectively. Since these are not the default names for the late schedule variables,
they need to be identied as such by specifying the LS= and LF= options (or the
L
START= and L
START= and S
FINISH= options)
in the CHART statement. Further, the SEGMT
duration
YOFFSET=-.2 positions the baseline of the displayed text at 0.2 barheights above
the top of the rst 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 rst 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
nish of the Maintenance Period by displaying the indicated strings rotated 90
degrees at the start and nish 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 dened by the start and nish 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;
data shutdown;
input act succ id & $20. dur;
datalines;
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 Disassembly 0
1160 1170 Disassemble Calender 2
1170 1200 Finish Disassembly 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=01jun04d interval=day
out=sched;
act act;
succ succ;
dur dur;
id id;
run;
Example 4.22. Using the Automatic Text Annotation Feature
559
data labels;
input act _y _xvar $ _lvar $ _yoffset _xoffset _label & $25.
_alabel _hlabel _jlabel $ _flabel $ ;
datalines;
. -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
mininterval=day scale=5
height=1.5 font=swiss
skip=3 maxdate=14jul04d
labvar=act labsplit=/
ref=19jun04d 29jun04d lref=20
;
run;
Output 4.22.1. Using the LABDATA= Option
560
Chapter 4. The GANTT Procedure
Example 4.23. Multiproject Gantt Charts
The following example illustrates an application of the PATTERN variable to display
summary bars for subprojects. The LAN Selection Project (Bostwick 1986) consists
of eight subprojects, two of which represent the beginning and ending of the master
project. The data set LANACT denes the structure of the project. The ACT and
SUCC variables dene the precedence relationships, the PARENT variable denes
the parent task, and the DAYS variable contains the duration of the activity.
The project is scheduled using the CPM procedure with a PARENT statement to
identify the parent. The schedule data set, SCHED, is created by appending a
PATTERN variable to the output data set generated by CPM. The value of this
variable is set to 4, corresponding to subprojects, and set to missing otherwise. This
results in the subproject bars being lled using PATTERN4, namely a solid black
pattern. The ACTID variable is indented within the DATA step to reect the level of
each activity in the project hierarchy when used as the ID variable.
A Label data set, LABELS, is created in order to add markers to both ends of the
schedule bars that correspond to subprojects. The two observations in the LABELS
data set are linked to the SCHED data set with the
PATTERN variable.
The GANTT procedure is next invoked to produce the Gantt chart in Output 4.23.1.
The LABVAR=
CODE variable.
data lanweb;
set lanout;
length webvar $500;
length webvar2 $500;
/* WEBVAR is for the top-level summary chart */
webvar=alt=|| quote(
Activity: ||trim(left(act))||0Dx||
-----------------------||0Dx||
Early Start: ||put(e_start, datetime.)||0Dx||
Early Finish:||put(e_finish, datetime.)||0Dx||
Late Start: ||put(l_start, datetime.)||0Dx||
Late Finish: ||put(l_finish, datetime.) )||
HREF=#||trim(wbs_code) /* link to the anchors */
;
/* WEBVAR2 is for the detailed charts */
webvar2=alt=|| quote(
Activity: ||trim(left(act))||0Dx||
-----------------------||0Dx||
Early Start: ||put(e_start, datetime.)||0Dx||
Early Finish:||put(e_finish, datetime.)||0Dx||
Late Start: ||put(l_start, datetime.)||0Dx||
Late Finish: ||put(l_finish, datetime.) )
;
run;
proc sort data=lanweb;
by wbs_code;
run;
Before creating the charts, you need to specify that the GIF driver be used to create
graphics output. ODS HTML output always creates a body le, which is a single
HTML document containing the output from one or more procedures and is specied
using the FILE= option in the ODS HTML statement.
568
Chapter 4. The GANTT Procedure
goptions reset=all device=gif;
ods html file="Gantt_Sum.html";
For example, when you click on any of the schedule bars for an activity
with WBS
Sum.html.
You are now ready to create the summary Gantt chart. You identify the WEBVAR
variable to the GANTT procedure using the HTML= option in the CHART statement
and invoke the procedure using a WHERE clause to produce a Gantt chart of the
top-level activities.
/* Create the Summary Gantt Chart with Drill Down Action */
pattern1 c=green v=s; /* Non-critical duration */
pattern2 c=green v=e; /* Slack duration */
pattern3 c=red v=s; /* Critical duration */
title1 f=swiss Gantt Example 26;
title2 f=swiss Project Summary Gantt Chart;
proc gantt data=lanweb;
id act wbs_code;
where proj_lev=1;
label act=SUBPROJECT wbs_code=WBS CODE;
chart / pcompress nojobnum font=swiss
duration=days
mininterval=week scale=2.5
mindate=30oct03d maxdate=29feb04d
ref=30oct03:00:00dt to 01mar04:00:00dt by dtmonth
reflabel
cmile=black
html=webvar
act=act succ=succ wprec=3;
run;
The graph that is displayed when you click on one of the subprojects is determined
by the name of the anchor that has been dened for the subproject. Before creating
these graphs, you need to dene the anchor name in an ODS HTML statement using
the ANCHOR= option to add the anchor to the HTML body le. Since you have
to create a chart for each subproject, you can automate this process by using a SAS
macro.
Example 4.26. Web-Enabled Gantt Charts
569
/* Define the macro to generate the detail charts */
%macro gandet(wbs);
goptions device=gif;
ods html anchor=&wbs;
title1 f=swiss Gantt Example 26;
title2 f=swiss "Detail Gantt Chart for WBS="&wbs;
proc gantt data=lanweb;
id act wbs_code;
where index(wbs_code,&wbs)=1;
label act=SUBPROJECT wbs_code=WBS CODE;
chart / pcompress nojobnum font=swiss
duration=days
mininterval=week scale=2.5
mindate=30oct03d maxdate=29feb04d
ref=30oct03:00:00dt to 01mar04:00:00dt by dtmonth
reflabel html=webvar2
act=act succ=succ wprec=3;
run;
%mend;
/* Generate each of the detail Gantt Charts */
%gandet(0.1);
%gandet(0.2);
%gandet(0.3);
%gandet(0.4);
%gandet(0.5);
%gandet(0.6);
Finally, use the ODS HTML CLOSE statement to close the body le and stop gener-
ating HTML output.
ods html close;
After you have closed the body le, you can display it in a browser window, as shown
in Output 4.26.1, to view the output generated by this example.
570
Chapter 4. The GANTT Procedure
Output 4.26.1. Summary Gantt Chart
Notice the hand-shaped cursor on the SITE PREPARATION bar, which indicates that
this bar is a hot link. The alternate text box displays the early and late schedules
of the SITE PREPARATION activity. The status bar of the browser also shows that
clicking the SITE PREPARATION bar will take you to the location identied by
Gantt
FINISH= X
A
START= X
BETWEEN= X
CALID= X
CALENDAR= X
CAXIS= X X X
CFRAME= X X X
CHART var X X
CMILE= X X X X
COMBINE X
COMPRESS X X X X X
CREF= X
CRITFLAG X
CTEXT= X X X
CTNOW= X
DATA= X X X X X X X X X
DUR= X X X X X X X X X X
FILL X
FONT= X X X X X X X X X X
HCONNECT X
HEIGHT= X
HOLIDATA= X X X X X X X X
HOLIDAY= X X X X X X X X
HOLIDUR= X
HOLIFIN= X X X X X
HPAGES= X
ID X X X X X X X X X X X X X
INCREMENT= X
INTERVAL= X
LINEPRINTER X X
L
FINISH= X
LREF= X
L
START= X
MARKBREAK X X
MAXDATE= X X X
MINDATE= X X X
MININTERVAL= X X
NOJOBNUM X X
NOLEGEND X X
PCOMPRESS X X X X X
REF= X X X
578
Chapter 4. The GANTT Procedure
Table 4.30. (continued)
Option 1 2 3 4 5 6 7 8 9 10 11 12 13 14
REFLABEL X
SCALE= X X
S
FINISH= X
SKIP= X
S
START= X
SUMMARY X
TIMENOW= X X
WORKDATA= X
Table 4.31. Options Specied in Examples 4.154.27
Option 15 16 17 18 19 20 21 22 23 24 25 26 27
A
FINISH= X
A
START= X
ACTIVITY= X X X X
ANNOTATE= X
BY X X
CAXIS= X X X
CFRAME= X
CHARTWIDTH= X
CMILE= X X X X X
COMPRESS X X X X X X X
CPREC= X X X X
CREF= X X
CTEXT= X
DATA= X X X X X X X X X X X
DUR= X X X X X X X X X X
FONT= X X X X X X X X X X X
FILL X
HEAD= X
HEIGHT= X X
HOLIDATA= X X X X X
HOLIDAY= X X X X X
HOLIFIN= X X
HTML= X
HTOFF= X
ID X X X X X X X X X X X X
INCREMENT= X X X
INTERVAL= X
LABDATA= X X X
LABSPLIT= X X
LABVAR= X X
LAG= X
LEVEL= X
LREF= X X X
MAXDATE= X X X X X X X
References
579
Table 4.31. (continued)
Option 15 16 17 18 19 20 21 22 23 24 25 26 27
MAXDEC= X
MAXDISLV= X
MINDATE= X X X X X X
MININTERVAL= X X
MININTGV= X X
MINOFFGV= X X
MINOFFLV= X X X
NOJOBNUM X X X X X
NOLEGEND X X
ONEZONEVAL X
PCOMPRESS X X X X X X
PRECDATA= X
REF= X X X X X X
REFLABEL X X X
SCALE= X X X X X X
S
FINISH= X
SKIP= X X
SPLIT= X
S
START= X
SUCCESSOR= X X X X
TAIL= X
WPREC= X X X
ZONE= X
References
Bostwick, S. (1986), Software Helps Solve LAN Selection Puzzle, Mini-Micro
Systems, February 14, 2022.
Moder, J. J., Phillips, C. R., and Davis, E. W. (1983), Project Management with
CPM, PERT and Precedence Diagramming, New York: Van Nostrand Reinhold
Company.
580
Chapter 4. The GANTT Procedure
Chapter 5
The NETDRAW Procedure
Chapter Contents
OVERVIEW . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 583
GETTING STARTED . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 585
SYNTAX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 590
Functional Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 590
PROC NETDRAW Statement . . . . . . . . . . . . . . . . . . . . . . . . . 594
ACTNET Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 595
DETAILS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 609
Network Input Data Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . 609
Variables in the Network Data Set . . . . . . . . . . . . . . . . . . . . . . . 610
Missing Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 611
Layout of the Network . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 611
Format of the Display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 613
Page Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 615
Layout Data Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 616
Controlling the Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 617
Time-Scaled Network Diagrams . . . . . . . . . . . . . . . . . . . . . . . 618
Zoned Network Diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . 620
Organizational Charts or Tree Diagrams . . . . . . . . . . . . . . . . . . . 621
Full-Screen Version . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 622
Graphics Version . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 625
Using the Annotate Facility . . . . . . . . . . . . . . . . . . . . . . . . . . 626
Web-Enabled Network Diagrams . . . . . . . . . . . . . . . . . . . . . . . 626
Macro Variable
ORNETDR . . . . . . . . . . . . . . . . . . . . . . . . . 627
Computer Resource Requirements . . . . . . . . . . . . . . . . . . . . . . 628
EXAMPLES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 628
Example 5.1. Line-Printer Network Diagram . . . . . . . . . . . . . . . . . 628
Example 5.2. Graphics Version of PROC NETDRAW . . . . . . . . . . . . 633
Example 5.3. Spanning Multiple Pages . . . . . . . . . . . . . . . . . . . . 634
Example 5.4. The COMPRESS and PCOMPRESS Options . . . . . . . . . 636
Example 5.5. Controlling the Display Format . . . . . . . . . . . . . . . . . 640
Example 5.6. Nonstandard Precedence Relationships . . . . . . . . . . . . . 645
Example 5.7. Controlling the Arc-Routing Algorithm . . . . . . . . . . . . 647
Example 5.8. PATTERN and SHOWSTATUS Options . . . . . . . . . . . . 649
582
Chapter 5. The NETDRAW Procedure
Example 5.9. Time-Scaled Network Diagram . . . . . . . . . . . . . . . . . 652
Example 5.10. Further Time-Scale Options . . . . . . . . . . . . . . . . . . 655
Example 5.11. Zoned Network Diagram . . . . . . . . . . . . . . . . . . . 659
Example 5.12. Schematic Diagrams . . . . . . . . . . . . . . . . . . . . . . 663
Example 5.13. Modifying Network Layout . . . . . . . . . . . . . . . . . . 668
Example 5.14. Specifying Node Positions . . . . . . . . . . . . . . . . . . 672
Example 5.15. Organizational Charts with PROC NETDRAW . . . . . . . . 674
Example 5.16. Annotate Facility with PROC NETDRAW . . . . . . . . . . 677
Example 5.17. AOA Network Using the Annotate Facility . . . . . . . . . . 681
Example 5.18. Branch and Bound Trees . . . . . . . . . . . . . . . . . . . 686
Statement and Option Cross-Reference Tables . . . . . . . . . . . . . . . . 689
REFERENCES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 692
Chapter 5
The NETDRAW Procedure
Overview
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 ow
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 activ-
ity networks that represent a project in Activity-On-Node (AON) format. All net-
work 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 anno-
tated 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 (x, y) coordinates; for each arc between each pair of
nodes, the procedure saves the (x, y) 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.
584
Chapter 5. The NETDRAW Procedure
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 species 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 x 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 proce-
dure 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 pro-
cedure needs only to determine the arc routing. See Example 5.12 on page 663
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 classication.
The TREE option instructs PROCNETDRAWto 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 Graphics Options
section on page 602 for more information on 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 state-
ment. 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
Getting Started
585
the FULLSCREEN (FS) option in the PROC NETDRAW statement. See the
Full-Screen Options section on page 601 for more information on 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 pro-
duce a top-down tree diagram.
Getting Started
The rst step in dening a project is to make a list of the activities in the project and
determine the precedence constraints that need to be satised 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 rela-
tionships 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
586
Chapter 5. The NETDRAW Procedure
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;
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
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.
Getting Started
587
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;
Figure 5.4. Software Project: Controlled Layout
588
Chapter 5. The NETDRAW Procedure
Software Project
Project Schedule
descrpt activity succesr1 succesr2 duration E_START
Initial Testing TESTING RECODE 20 01MAR04
Prel. Documentation PRELDOC DOCEDREV QATEST 15 01MAR04
Meet Marketing MEETMKT RECODE 1 01MAR04
Recoding RECODE DOCEDREV QATEST 5 21MAR04
QA Test Approve QATEST PROD 10 26MAR04
Doc. Edit and Revise DOCEDREV PROD 10 26MAR04
Production PROD 1 05APR04
descrpt E_FINISH L_START L_FINISH T_FLOAT F_FLOAT
Initial Testing 20MAR04 01MAR04 20MAR04 0 0
Prel. Documentation 15MAR04 11MAR04 25MAR04 10 10
Meet Marketing 01MAR04 20MAR04 20MAR04 19 19
Recoding 25MAR04 21MAR04 25MAR04 0 0
QA Test Approve 04APR04 26MAR04 04APR04 0 0
Doc. Edit and Revise 04APR04 26MAR04 04APR04 0 0
Production 05APR04 05APR04 05APR04 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 dia-
gram 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;
Getting Started
589
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 divi-
sions, 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.
590
Chapter 5. The NETDRAW Procedure
Syntax
The following statements are used in PROC NETDRAW:
PROC NETDRAW options ;
ACTNET / options ;
Functional Summary
The following tables outline the options available for the NETDRAW procedure clas-
sied by function.
Table 5.1. Color Options
Description Statement Option
color of arcs ACTNET CARCS=
color of time axis ACTNET CAXIS=
ll color for critical nodes ACTNET CCNODEFILL=
color of critical arcs ACTNET CCRITARCS=
color of outline of critical nodes ACTNET CCRITOUT=
ll color for nodes ACTNET CNODEFILL=
color of outline of nodes ACTNET COUTLINE=
color of reference lines ACTNET CREF=
color of reference break lines ACTNET CREFBRK=
color of text ACTNET CTEXT=
Table 5.2. Data Set Specications
Description Statement Option
Annotate data set ACTNET ANNOTATE=
Annotate data set NETDRAW ANNOTATE=
Activity data set NETDRAW DATA=
Network output data set NETDRAW OUT=
Table 5.3. Format Control Options
Description Statement Option
height of node in character cells ACTNET BOXHT=
width of node in character cells ACTNET BOXWIDTH=
duration variable ACTNET DURATION=
ID variables ACTNET ID=
suppress default ID variables ACTNET NODEFID
suppress ID variable labels ACTNET NOLABEL
upper limit on number of pages ACTNET PAGES=
indicate completed or in-progress activities ACTNET SHOWSTATUS
horizontal distance between nodes ACTNET XBETWEEN=
vertical distance between nodes ACTNET YBETWEEN=
Functional Summary
591
Table 5.4. Full-Screen Options
Description Statement Option
reference break line character ACTNET BRKCHAR=
characters for node outlines and connections ACTNET FORMCHAR=
reference character ACTNET REFCHAR=
Table 5.5. Graphics Catalog Options
Description Statement Option
description for catalog entry ACTNET DESCRIPTION=
name for catalog entry ACTNET NAME=
name of graphics catalog NETDRAW GOUT=
Table 5.6. Graphics Display Options
Description Statement Option
length of arrowhead in character cells ACTNET ARROWHEAD=
center each ID variable within node ACTNET CENTERID
compress the diagram to a single page ACTNET COMPRESS
text font ACTNET FONT=
text height ACTNET HEIGHT=
horizontal margin in character cells ACTNET HMARGIN=
number of horizontal pages ACTNET HPAGES=
reference line style ACTNET LREF=
reference break line style ACTNET LREFBRK=
width of lines used for critical arcs ACTNET LWCRIT=
width of lines ACTNET LWIDTH=
width of outline for nodes ACTNET LWOUTLINE=
suppress lling of arrowheads ACTNET NOARROWFILL
suppress page number ACTNET NOPAGENUMBER
suppress vertical centering ACTNET NOVCENTER
number of nodes in horizontal direction ACTNET NXNODES=
number of nodes in vertical direction ACTNET NYNODES=
display page number at upper right corner ACTNET PAGENUMBER
pattern variable ACTNET PATTERN=
proportionally compress the diagram ACTNET PCOMPRESS
draw arcs with rectangular corners ACTNET RECTILINEAR
reverse the order of the y pages ACTNET REVERSEY
rotate the network diagram ACTNET ROTATE
rotate text within node by 90 degrees ACTNET ROTATETEXT
separate arcs along distinct tracks ACTNET SEPARATEARCS
vertical margin in character cells ACTNET VMARGIN=
number of vertical pages ACTNET VPAGES=
592
Chapter 5. The NETDRAW Procedure
Table 5.7. Layout Options
Description Statement Option
break cycles in cyclic networks ACTNET BREAKCYCLE
use dynamic programming algorithm to route arcs ACTNET DP
number of horizontal tracks between nodes ACTNET HTRACKS=
route arc along potential node positions ACTNET NODETRACK
do not use dynamic programming algorithm to
route arcs
ACTNET NONDP
block track along potential node positions ACTNET NONODETRACK
restrict scope of arc layout algorithm ACTNET RESTRICTSEARCH
use spanning tree layout ACTNET SPANNINGTREE
draw network as a tree, if possible ACTNET TREE
number of vertical tracks between nodes ACTNET VTRACKS=
Table 5.8. Line-Printer Options
Description Statement Option
reference break line character ACTNET BRKCHAR=
characters for node outlines and connections ACTNET FORMCHAR=
reference character ACTNET REFCHAR=
Table 5.9. Mode Options
Description Statement Option
invoke full-screen version NETDRAW FULLSCREEN
invoke graphics version NETDRAW GRAPHICS
invoke line-printer version NETDRAW LINEPRINTER
suppress display of diagram NETDRAW NODISPLAY
Table 5.10. Network Specications
Description Statement Option
activity variable ACTNET ACTIVITY=
lag variables ACTNET LAG=
successor variables ACTNET SUCCESSOR=
Functional Summary
593
Table 5.11. Time-Scale Options
Description Statement Option
align variable ACTNET ALIGN=
draw reference lines at every level ACTNET AUTOREF
frame network diagram and axis ACTNET FRAME
draw all vertical levels ACTNET LINEAR
maximum number of empty columns between
tick marks
ACTNET MAXNULLCOLUMN=
smallest interval per level ACTNET MININTERVAL=
number of levels per tick mark ACTNET NLEVELSPERCOLUMN=
suppress time axis on continuation pages ACTNET NOREPEATAXIS
omit the time axis ACTNET NOTIMEAXIS
stop procedure if align value is missing ACTNET QUITMISSINGALIGN
draw zigzag reference line at breaks ACTNET REFBREAK
show all breaks in time axis ACTNET SHOWBREAK
draw time-scaled diagram ACTNET TIMESCALE
use format of variable and not default ACTNET USEFORMAT
Table 5.12. Tree Options
Description Statement Option
center each node with respect to subtree ACTNET CENTERSUBTREE
order of the children of each node ACTNET CHILDORDER=
separate sons of a node for symmetry ACTNET SEPARATESONS
use spanning tree layout ACTNET SPANNINGTREE
draw network as a tree, if possible ACTNET TREE
Table 5.13. Web Options
Description Statement Option
image map output data set NETDRAW IMAGEMAP=
web reference variable ACTNET WEB=
Table 5.14. Zone Options
Description Statement Option
divide network into connected components ACTNET AUTOZONE
suppress zone labels ACTNET NOZONELABEL
zone variable ACTNET ZONE=
label zones ACTNET ZONELABEL
set missing pattern values using zone ACTNET ZONEPAT
leave extra space between zones ACTNET ZONESPACE
594
Chapter 5. The NETDRAW Procedure
PROC NETDRAW Statement
PROC NETDRAW options ;
The following options can appear in the PROC NETDRAW statement.
ANNOTATE=SAS-data-set
species the input data set that contains the appropriate annotate variables for the
purpose of adding text and graphics to the network diagram. The data set specied
must be an Annotate data set. See the Using the Annotate Facility section on page
626 for further details about this option.
DATA=SAS-data-set
names the SAS data set to be used by PROC NETDRAW for producing a network
diagram. If DATA= is omitted, the most recently created SAS data set is used. This
data set, also referred to as the Network data set, contains the network information
(ACTIVITY and SUCCESSOR variables) and any ID variables that are to be dis-
played within the nodes. For details about this data set, see the Network Input Data
Set section on page 609.
FULLSCREEN
FS
indicates that the network be drawn in full-screen mode. This enables you to view
the network diagram produced by NETDRAW in different scales; you can also move
nodes around the diagram to modify the layout.
GOUT=graphics-catalog
species the name of the graphics catalog used to save the output produced by PROC
NETDRAW for later replay. This option is valid only if the GRAPHICS option is
specied.
GRAPHICS
indicates that the network diagram produced be of high-resolution quality. If you
specify the GRAPHICS option, but you do not have SAS/GRAPH software licensed
at your site, the procedure stops and issues an error message. GRAPHICS is the
default mode.
IMAGEMAP=SAS-data-set
names the SAS data set that receives a description of the areas of a graph and a link
for each area. This information is for the construction of HTML image maps. You use
a SAS DATA step to process the output le and generate your own HTML les. The
graph areas correspond to the link information that comes from the WEB variable
in the Network data set. This gives you complete control over the appearance and
structure of your HTML pages.
LINEPRINTER
LP
produces a network diagram of line-printer quality.
ACTNET Statement
595
NODISPLAY
requests the procedure not to display any output. The procedure still produces the
Layout data set containing the details about the network layout. This option is useful
to determine node placement and arc routing for a network that can be used at a later
time to display the diagram.
OUT=SAS-data-set
species a name for the output data set produced by PROC NETDRAW. This data
set, also referred to as the Layout data set, contains the node and arc placement infor-
mation determined by PROC NETDRAW to draw the network. This data set contains
all the information that was specied in the Network data set to dene the project;
in addition, it contains variables that specify the coordinates for the nodes and arcs
of the network diagram. For details about the Layout data set, see the Layout Data
Set section on page 616.
If the OUT= option is omitted, the procedure creates a data set and names it according
to the DATAn convention.
ACTNET Statement
ACTNET/ options ;
The ACTNET statement draws the network diagram. You can specify several options
in this statement to control the appearance of the network. All these options are
described in the current section under appropriate headings: rst, all options that are
valid for all modes of the procedure are listed, followed by the options classied
according to the mode (full-screen, graphics, or line-printer) of invocation of the
procedure.
General Options
ACTIVITY=variable
species the variable in the Network data set that names the nodes in the network. If
the data set contains a variable called
FROM
START, E
FINISH, L
START,
L
FINISH, S
START, S
FINISH, A
START, A
FINISH, T
FLOAT, and
F
duration
calendar specication
used by the CPM procedure, although PROC NETDRAW uses only the keyword in-
formation and ignores the lag duration and the lag calendar. If no LAG variables
exist or if an unrecognized value is specied for a LAG variable, PROC NETDRAW
interprets the lag as a Finish-to-Start type.
This option enables the procedure to identify the different types of nonstandard prece-
dence constraints (Start-to-Start, Start-to-Finish, and Finish-to-Finish) on graphics
quality network diagrams by drawing the arcs from and to the appropriate edges of
the nodes.
LINEAR
plots one column for every mininterval between the minimum and maximum values
of the ALIGN= variable. By default, only those columns that contain at least one
activity are displayed. This option is valid only for time-scaled network diagrams.
MAXNULLCOLUMN=maxncol
MAXEMPTY=maxncol
MAXZCOL=maxncol
MAXNCOL=maxncol
species the maximum number of empty columns between two consecutive
nonempty columns. The default value for this option is 0. Note that specifying the
598
Chapter 5. The NETDRAW Procedure
LINEAR option is equivalent to specifying the MAXNULLCOLUMN= option to be
innity. This option is valid only for time-scaled network diagrams.
MININTERVAL=mininterval
species the smallest interval to be used per column of the network diagram. Thus, if
MININTERVAL=DAY, each column is used to represent a day, and all activities that
start on the same day are placed in the same column. The valid values for mininterval
are SECOND, MINUTE, HOUR, DAY, WEEK, MONTH, QTR, and YEAR. The
default value of mininterval is determined by the format of the ALIGN= variable.
The tick labels are formatted on the basis of mininterval ; for example, if mininterval
is DAY, the dates are marked using the DATE7. format, and if mininterval is HOUR,
the labels are formatted as TIME5. and so on. This option is valid only for time-
scaled network diagrams.
NLEVELSPERCOLUMN=npercol
NPERCOL=npercol
contracts the time axis by specifying that activities that differ in ALIGN= value by
less than npercol units of MININTERVAL can be plotted in the same column. The
default value of npercol is 1. This option is valid only for time-scaled network dia-
grams.
NODEFID
indicates that the procedure need not check for any of the default ID variables in the
Network data set; if this option is in effect, only the variables specied in the ID=
option are displayed within each node.
NODETRACK
species that the arcs can be routed along potential node positions if there is a clear
horizontal track to the left of the successor (or
TO
FINISH
and A
START values to determine the status of the activity. If the network is drawn
in line-printer or full-screen mode, activities in progress are outlined with the letter
P and completed activities are outlined with the letter F; in high-resolution graphics
mode, in-progress activities are marked with a diagonal line across the node from the
bottom left to the top right corner, while completed activities are marked with two
diagonal lines.
SPANNINGTREE
uses a spanning tree to place the nodes in the network. This method typically re-
sults in a wider layout than the default. However, for networks that have totally dis-
joint pieces, this option separates the network into connected components (or disjoint
trees). This option is not valid for time-scaled or zoned network diagrams, because
the node placement dictated by the spanning tree may not be consistent with the zone
or the tickmark corresponding to the node.
SUCCESSOR=(variables)
species the variables in the Network data set that name all the immediate successors
of the node specied by the ACTIVITY variable. This specication is ignored if the
data set contains a variable named
TO
.
TIMESCALE
indicates that the network is to be drawn using a time axis for placing the nodes.
This option can be used to align the network according to default variables. If the
TIMESCALE option is specied without the ALIGN= option, the procedure looks
for default variables in the following order: E
START, L
START, S
START, and
A
START. The rst of these variables that is found is used as the ALIGN= variable.
TREE
TREELAYOUT
requests the procedure to draw the network as a tree if the network is indeed a tree
(that is, all the nodes have at most one immediate predecessor). The option is ignored
if the network does not have a tree structure.
USEFORMAT
indicates that the explicit format of the ALIGN= variable is to be used instead of
the default format based on the MININTERVAL= option. Thus, for example, if the
ALIGN variable contains SAS date values, by default, the procedure uses the DATE7.
format for the time axis labels irrespective of the format of the ALIGN= variable.
The USEFORMAT option species that the variables format should be used for the
labels instead of the default format. This option is valid only for time-scaled network
diagrams.
ACTNET Statement
601
VTRACKS=integer
controls the number of arcs that are drawn vertically through the space between two
adjacent nodes. A default value is based on the maximum number of successors of
any node.
XBETWEEN=integer
HBETWEEN=integer
species the horizontal distance (in character cell positions) between two adjacent
nodes. The value for this option must be at least 3; the default value is 5.
YBETWEEN=integer
VBETWEEN=integer
species the vertical distance (in character cell positions) between two adjacent
nodes. The value for this option must be at least 3; the default value is 5.
ZONE=variable
names the variable in the Network data set used to separate the network diagram into
zones.
ZONELABEL
ZONEDESCR
labels the different zones and draws dividing lines between two consecutive zones.
This is the default behavior; to omit the labels and the dividing lines, use the
NOZONELABEL option.
ZONESPACE
ZONELEVADD
draws the network with an extra row between two consecutive zones.
Full-Screen Options
BRKCHAR=brkchar
species the character used for drawing the zigzag break lines down the chart at break
points of the time axis. The default value is >. This option is valid only for time-
scaled network diagrams.
CARCS=color
species the color of the connecting lines (or arcs) between the nodes. The default
value of this option is CYAN.
CAXIS=color
species the color of the time axis. The default value is WHITE. This option is valid
only for time-scaled network diagrams.
CCRITARCS=color
species the color of arcs connecting critical activities. The procedure uses the values
of the E
FINISH and L
PATTERN, this specication is ignored. All the colors available for the full-screen
device are used in order corresponding to the number specied in the PATTERN vari-
able; if the value of the PATTERN variable is more than the number of colors avail-
able for the device, the colors are repeated starting once again with the rst color. If a
PATTERN variable is not specied, the procedure uses the rst color for noncritical
activities, the second color for critical activities, and the third color for supercritical
activities.
REFCHAR=refchar
species the reference character used for drawing reference lines. The default value
is |. This option is valid only for time-scaled network diagrams.
ZONEPAT
indicates that if a PATTERN variable is not specied or is missing and if a ZONE=
variable is present, then the node colors are based on the value of the ZONE= variable.
Graphics Options
ANNOTATE=SAS-data-set
species the input data set that contains the appropriate annotate variables for the
purpose of adding text and graphics to the network diagram. The data set specied
must be an Annotate data set. See the Using the Annotate Facility section on page
626 for further details about this option.
ARROWHEAD=integer
species the length of the arrowhead in character cell positions. You can specify
ARROWHEAD = 0 to suppress arrowheads altogether. The default value is 1.
CARCS=color
species the color to use for drawing the connecting lines between the nodes. If
CARCS= is not specied, the procedure uses the fourth color in the COLORS= list
of the GOPTIONS statement.
CAXIS=color
species the color of the time axis. If CAXIS= is not specied, the procedure uses
the text color. This option is valid only for time-scaled network diagrams.
ACTNET Statement
603
CCNODEFILL=color
species the ll color for all critical nodes of the network diagram. If you specify this
option, the procedure uses a solid ll pattern (with the color specied in this option)
for all critical nodes, ignoring any ll pattern specied in the PATTERN statements;
the PATTERN statements are used only to obtain the color of the outline for these
nodes unless you specify the CCRITOUT= option. The default value for this option
is the value of the CNODEFILL= option, if it is specied; otherwise, the procedure
uses the PATTERN statements to determine the ll pattern and color.
CCRITARCS=color
species the color of arcs connecting critical activities. The procedure uses the values
of the E
FINISH and L
PATTERN, this specication is ignored. The patterns are assumed to have been
specied using PATTERN statements. If a PATTERN variable is not specied, the
procedure uses the rst PATTERN statement for noncritical activities, the second
PATTERN statement for critical activities, and the third PATTERN statement for su-
percritical activities.
PCOMPRESS
draws the network diagram on one physical page. As with the COMPRESS option,
the procedure determines the horizontal and vertical transformation needed so that the
network is compressed to t on one screen. However, in this case, the transformations
are such that the network diagram is proportionally compressed. See Example 5.4 on
page 636 for an illustration of this option.
If the HPAGES= and VPAGES= options are used to control the number of pages, each
page of the network diagram is drawn while maintaining the original aspect ratio.
RECTILINEAR
draws arcs with rectangular corners. By default, the procedure uses rounded turning
points and rounded arc merges in graphics mode.
REVERSEY
reverses the order in which the y pages are drawn. By default, the pages are ordered
from bottom to top in the graphics mode. This option orders them from top to bottom.
ACTNET Statement
607
ROTATE
rotates the network diagram to change the orientation of the network to be from top
to bottom instead of from left to right. For example, you can use this option to draw
a Bill of Materials diagram that is traditionally drawn from top to bottom with the
Final Product drawn at the top of the tree. In addition to rotating the orientation of
the network, use the ROTATETEXT option to rotate the text within each node. See
Example 5.18 on page 686 for an illustration of this option.
This option is similar to the global graphics option, ROTATE (GOPTIONS ROTATE).
Note that if the global graphics option is used, titles and footnotes also need to be
drawn with an angle specication: A=90. However, some device drivers ignore the
global graphics option, ROTATE (for example, the SASGDDMX driver). Use the
ROTATE option on the ACTNET statement for such device drivers.
ROTATETEXT
RTEXT
rotates the text within the nodes by 90 degrees. This option is useful when used
in conjunction with the ROTATE option in the ACTNET statement (or the global
graphics option ROTATE) to change the orientation of the network to be from top to
bottom instead of from left to right. For example, you can use this option to draw
an organizational chart that is traditionally drawn from top to bottom with the head
of the organization at the top of the chart. If the ROTATETEXT option is specied,
then the denitions of the BOXHT= and BOXWIDTH= options are reversed. See
Example 5.18 on page 686 for an illustration of this option.
SEPARATEARCS
separates the arcs to follow distinct tracks. By default, the procedure draws all seg-
ments of the arcs along a central track between the nodes, which may cause several
arcs to be drawn on top of one another. If the SEPARATEARCS option is speci-
ed, the procedure may increase the values of the XBETWEEN= and YBETWEEN=
options to accommodate the required number of lines between the nodes.
VMARGIN=integer
species the width of a vertical margin (in number of character cell positions) for the
network. The default width is 1.
VPAGES=v
NYPAGES=v
species that the network diagram is to be produced using v vertical pages. This,
however, may not be possible due to intrinsic constraints on the output. For example,
PROC NETDRAW requires that every vertical page should contain at least one y
level. Thus, the number of vertical pages can never exceed the number of horizontal
levels in the network. The exact number of vertical pages used by the procedure is
provided in the
ORNETDR macro variable. See the Macro Variable
ORNETDR
section on page 627 for further details.
The appearance of the diagram with respect to the VPAGES= option is also inu-
enced by the presence of other related procedure options. The VPAGES= option per-
forms the task of determining the number of horizontal pages in the absence of the
HPAGES= option (or the NXNODES= option). If the COMPRESS or PCOMPRESS
608
Chapter 5. The NETDRAW Procedure
option is specied (without the HPAGES= or NXNODES= options), the chart uses
one horizontal page. If neither the COMPRESS nor PCOMPRESS option is speci-
ed, the number of horizontal pages is computed in order to display as much of the
chart as possible in a proportional manner.
WEB=variable
HTML=variable
species the character variable in the Network data set that identies an HTML page
for each activity. The procedure generates an HTML image map using this informa-
tion for each node in the network diagram.
ZONEPAT
indicates that if a PATTERN= variable is not specied or is missing and if a ZONE=
variable is present, then the node patterns are based on the value of the ZONE=
variable.
Line-Printer Options
BRKCHAR=brkchar
species the character used for drawing the zigzag break lines down the chart at break
points of the time axis. The default value is >. This option is valid only for time-
scaled network diagrams.
FORMCHAR [index list ]=string
species the characters used for node outlines and arcs. The value is a string 20
characters long. The rst 11 characters dene the 2 bar characters, vertical and hor-
izontal, and the 9 corner characters: upper-left, upper-middle, upper-right, middle-
left, middle-middle (cross), middle-right, lower-left, lower-middle, and lower-right.
These characters are used to outline each node and connect the arcs. The nineteenth
character denotes a right arrow. The default value of the FORMCHAR= option is
|----|+|---+=|-/\<>*. Any character or hexadecimal string can be substi-
tuted to customize the appearance of the diagram. Use an index list to specify which
default form character each supplied character replaces, or replace the entire default
string by specifying the full character replacement string without an index list. For
example, change the four corners of each node and all turning points of the arcs to
asterisks by specifying
FORMCHAR(3 5 7 9 11)= *****
Specifying
formchar= (11 blanks)
produces a network diagram with no outlines for the nodes (as well as no arcs).
For further details about the FORMCHAR= option see Chapter 3, The DTREE
Procedure, and Chapter 4, The GANTT Procedure.
Network Input Data Set
609
REFCHAR=refchar
species the reference character used for drawing reference lines. The default value
is |. This option is valid only for time-scaled network diagrams.
Details
Network Input Data Set
The Network input data set contains the precedence information, namely the activity-
successor information for all the nodes in the network. The minimum amount of
information that is required by PROC NETDRAW is the activity-successor informa-
tion for the network. Additional information in the input data set can be used by
the procedure to add detail to the nodes in the diagram or control the layout of the
network diagram.
Three types of data sets are typically used as the Network data set input to PROC
NETDRAW. Which type of data set you use depends on the stage of the project:
The Activity data set that is input to PROC CPM is the rst type. In the initial
stages of project denition, it may be useful to get a graphical representation
of the project showing all the activity precedence constraints.
The Schedule data set produced by PROC CPM (as the OUT= data set) is the
second type. When a project is in progress, you may want to obtain a network
diagram showing all the relevant start and nish dates for the activities in the
project, in addition to the precedence constraints. You may also want to draw
a time-scaled network diagram, with the activities arranged according to the
start or nish times corresponding to any of the different schedules produced
by PROC CPM.
The Layout data set produced by PROC NETDRAW (as the OUT= data set) is
the third type. Often, you may want to draw network diagrams of the project
every week showing updated information (as the project progresses); if the net-
work logic has not changed, it is not necessary to determine the placement of
the nodes and the routing of the arcs every time. You can use the Layout data
set produced by PROC NETDRAW that contains the node and arc positions,
update the start and nish times of the activities or merge in additional infor-
mation about each activity, and use the modied data set as the Network data
set input to PROC NETDRAW. The new network diagram will have the same
layout as the earlier diagram but will contain updated information about the
schedule. Such a data set may also be useful if you want to modify the lay-
out of the network by changing the positions of some of the nodes. See the
Controlling the Layout section on page 617 for details on how the layout
information is used by PROC NETDRAW. If the Layout data set is used, it
contains the variables
FROM
and
TO
START, E
FINISH,
L
START, L
FINISH, S
START, S
FINISH, A
START, A
FINISH, T
FLOAT,
and F
FLOAT. The format used for determining the location of these variables within
each node is described in the Format of the Display section on page 613. See the
Variables in the Network Data Set section on page 610 for a table of all the variables
in the Network data set and their interpretations by PROC NETDRAW.
If the Network data set contains the variables
X
and
Y
and
Y
FROM
SEQ
TO
,
Y
, and
SEQ
variables.
Missing values for the SUCCESSOR and ID variables are ignored. Missing values
are not allowed for the ALIGN= variable if the QUITMISSINGALIGN option is
specied; otherwise, the procedure determines suitable values for the ALIGN= vari-
able using the topological ordering of the network nodes.
Layout of the Network
The network layout is determined in two stages. First, the precedence relationships
are used to determine the positions of the nodes, which are then used to determine a
routing of the arcs. The positions of the nodes and arcs are identied by specifying
their x and y coordinates in a grid. Figure 5.7 shows a sample grid and explains
some of the conventions followed by PROC NETDRAW in determining the node
and arc layout. This notation will be useful in later sections that describe the Layout
data set and how you can control the layout of the diagram. The asterisks in the
gure represent possible positions for the nodes of the network. The arcs are routed
612
Chapter 5. The NETDRAW Procedure
between the possible node positions. For example, node A has coordinates (1, 3) and
node B has coordinates (2, 1). The arc connecting them has two turning points and
is completely determined by the two pairs of coordinates (1.5, 3) and (1.5, 1); here,
x = 1.5 implies that the position is midway between the x coordinates 1 and 2.
Figure 5.7. Sample Grid and Coordinates for Node and Arc Layout
PROC NETDRAW sets x = 1 for all nodes with no predecessors; the x coordinates
for the other nodes are determined so that each node is placed to the immediate right
of all its predecessors; in other words, no node will appear to the left of any of its
predecessors or to the right of any of its successors in the network diagram. The
nodes are placed in topological order: a node is placed only after all its predecessors
have been placed. Thus, the node-placement algorithm requires that there should
be no cycles in the network. The y coordinates of the nodes are determined by the
procedure using several heuristics designed to produce a reasonable compact diagram
of the network. To draw a network that has cycles, use the BREAKCYCLE option,
or you can specify the node coordinates or an ALIGN= variable to circumvent the
requirement of a topological ordering of the nodes (see the second part of Example
5.12 on page 663).
Note that the x and y coordinates x only a relative positioning of the nodes and arcs.
The actual distance between two nodes, the width and height of each node, and so on
can be controlled by specifying desired values for the options that control the format
of the display, namely, BOXHT=, BOXWIDTH=, and so on. See the Format of the
Display section on page 613 for details on these options.
Format of the Display
613
By default, the procedure routes the arcs using a simple heuristic that uses, at most,
four turning points: the arc leaves the predecessor node fromits right edge, turns up or
down according to whether the successor is above or below the current node position,
then tracks horizontally across to the vertical corridor just before the successor node,
and then tracks in a vertical direction to meet the successor node. For example, see
the tracking of the arc connecting nodes C and D in Figure 5.7.
For networks that include some nonstandard precedence constraints, the arcs may be
drawn from and to the appropriate edges of the nodes, depending on the type of the
constraint.
The default routing of the arcs may lead to an unbalanced diagram with too many
arcs in one section and too few in another. The DP option in the ACTNET statement
causes the procedure to use a dynamic programming algorithm to route the arcs. This
algorithm tries to route the arcs between the nodes so that not too many arcs pass
through any interval between two nodes. The procedure sets the maximum number
of arcs that are allowed to be routed along any corridor to be equal to the maximum
number of successors for any node. The HTRACKS= and VTRACKS=options en-
able you to set these maximum values: HTRACKS species the maximum number of
arcs that are allowed to pass horizontally through any point while VTRACKS speci-
es the same for arcs in the vertical direction. See Example 5.7 on page 647 for an
illustration of the HTRACKS= option.
The layout of the network for time-scaled and zoned network diagrams is discussed in
the Time-Scaled Network Diagrams section on page 618 and the Zoned Network
Diagrams section on page 620, respectively. The Organizational Charts or Tree
Diagrams section on page 621 describes the layout of the diagram when the TREE
option is specied.
Format of the Display
As explained in the previous section, the layout of the network is determined by
the procedure in terms of x and y coordinates on a grid as shown in Figure 5.7.
The distance between nodes and the width and height of each node is determined by
the values of the format control options: XBETWEEN=, YBETWEEN=, BOXHT=,
and BOXWIDTH= . Note that if the ROTATETEXT option is specied (in graphics
mode), then the denitions of the BOXHT= and BOXWIDTH= options are reversed.
The amount of information that is displayed within each node is determined by the
variables specied by the ID= option, the number of default variables found in the
Network data set, and whether the NOLABEL and NODEFID options are specied.
The values of the variables specied by the ID= option are placed within each node on
separate lines. If the NOLABEL option is in effect, only the values of the variables are
written; otherwise, each value is preceded by the name of the ID variable truncated
to three characters. Recall from the Syntax section on page 590 that, in addition to
the variables specied using the ID= option, the procedure also displays additional
variables. These variables are displayed below the variables explicitly specied by
the ID= option, in pre-determined relative positions within each node (see Figure
5.8.)
614
Chapter 5. The NETDRAW Procedure
ID1
.
.
.
IDn
Activity variable Duration variable
E
START E
FINISH
L
START L
FINISH
S
START S
FINISH
A
START A
FINISH
T
FLOAT F
FLOAT
Figure 5.8. Display Format for the Variables within Each Node
Note: If a node is identied as a successor (through a SUCCESSOR variable) and is
never identied with the ACTIVITY variable, the ID values for this node are never
dened in any observation; hence, this node will have missing values for all the ID
variables.
If the SHOWSTATUS option is specied and the Network data set contains progress
information (in either the STATUS variable or the A
START and A
FINISH vari-
ables), the procedure appropriately marks each node referring to activities that are
completed or in progress. See Example 5.8 on page 649 for an illustration of the
SHOWSTATUS option.
The features just described pertain to all three modes of the procedure. In addition,
there are options to control the format of the display that are specic to the mode of
invocation of the procedure. For graphics quality network diagrams, you can choose
the color and pattern used for each node separately by specifying a different pattern
number for the PATTERN variable, identied in the ACTNET statement (for details,
see the Graphics Version section on page 625). For line-printer or full-screen net-
work diagrams, the FORMCHAR= option enables you to specify special boxing
characters that enhance the display; for full-screen network diagrams, you can also
choose the color of the nodes using the PATTERN= option.
By default, all arcs are drawn along the center track between two consecutive nodes.
The SEPARATEARCS option, which is available in the graphics version, separates
arcs in the same corridor by drawing them along separate tracks, thus preventing them
from being drawn on top of each other.
If the network ts on one page, it is centered on the page; in the graphics mode, you
can use the NOVCENTER option to prevent centering in the vertical direction so that
the network is drawn immediately below the title. If the network cannot t on one
page, it is split onto different pages appropriately. See the Page Format section on
page 615 for a description of how the pages are split.
Page Format
615
Page Format
1 2 3
4 5 6
7 8 9
Figure 5.9. Page Layout
As explained in the Format of the Display section on page 613, if the network ts
on one page, it is centered on the page (unless the NOVCENTER option is speci-
ed); otherwise, it is split onto different pages appropriately, and each page is drawn
starting at the bottom left corner. If the network is drawn on multiple pages, the pro-
cedure numbers each page of the diagram on the top right corner of the page. The
pages are numbered starting with the bottom left corner of the entire picture. Thus, if
the network diagram is broken into three horizontal and three vertical levels and you
want to paste all the pieces together to form one picture, they should be arranged as
shown in Figure 5.9.
The number of pages of graphical output produced by the NETDRAW procedure
depends on several options such as the NXNODES=, NYNODES=, HPAGES=,
VPAGES=, COMPRESS, PCOMPRESS, HEIGHT=, and the ID= options. The value
of the HTEXT= option and the number of variables specied in the ID= options deter-
mines the size of each node in the network diagram, which in turn affects the number
of horizontal and vertical pages needed to draw the entire network. The number of
pages is also affected by the global specication of the HPOS=, VPOS=, HSIZE=,
and VSIZE= graphics options.
The COMPRESS and PCOMPRESS options force the entire network diagram to be
drawn on a single page. You can explicitly control the number of horizontal and
vertical pages using the HPAGES= and VPAGES= options. The NXNODES= and
NYNODES= options enable you to specify the number of nodes in the horizontal
and vertical directions, respectively, on each page of the network diagram.
For examples of these options and how they affect the network diagram output, see
Example 5.5 on page 640.
616
Chapter 5. The NETDRAW Procedure
Layout Data Set
The Layout data set produced by PROC NETDRAW contains all the information
needed to redraw the network diagram for the given network data. In other words,
the Layout data set contains the precedence information, the IDvariables that are used
in the current invocation of the procedure, and variables that contain the coordinate
information for all the nodes and arcs in the network.
The precedence information used by the procedure is dened by two new variables
named
FROM
and
TO
TO
variable even if the Network data set has multiple SUCCESSOR variables; if a given
observation in the Network data set denes multiple successors for a given activity,
the Layout data set denes a new observation for each of the successors. In fact, for
each (node, successor) pair, a sequence of observations, dening the turning points
of the arc, is saved in the Layout data set; the number of observations corresponding
to each pair is equal to one plus the number of turns in the arc connecting the node to
its successor. Suppose that a node C has two successors, D and E, and the arcs
connecting C and D and C and E are routed as shown in Figure 5.7 on page
612. Then, Figure 5.10 illustrates the format of the observations corresponding to the
two (
FROM
,
TO
FROM
TO
X
Y
SEQ
PATTERN ID variables
C D 3 1 0 1
C D 3.5 1 1 .
C D 3.5 2.5 2 .
C D 5.5 2.5 3 .
C D 5.5 3 4 .
C E 3 1 0 1
. .
. .
. .
Figure 5.10. Sample Observations in the Layout Data Set
For every (node, successor) pair, the rst observation (
SEQ
> 0.
Controlling the Layout
617
Controlling the Layout
As explained in the Layout of the Network section on page 611, the procedure uses
the precedence constraints between the activities to draw a reasonable diagram of the
network. A very desirable feature in any procedure of this nature is the ability to
change the default layout. PROC NETDRAW provides two ways of modifying the
network diagram:
using the full-screen interface
using the Network data set
The full-screen method is useful for manipulating the layout of small networks, es-
pecially networks that t on a handful of screens. You can use the full-screen mode
to examine the default layout of the network and move the nodes to desired locations
using the MOVE command from the command line or by using the appropriate func-
tion key. When a node is moved, the procedure reroutes all the arcs that connect to
or from the node; other arcs are unchanged. For details about the MOVE command,
see the Full-Screen Version section on page 622.
You can use the Network data set to modify or specify completely the layout of the
network. This method is useful if you want to draw the network using information
about the network layout that has been saved from an earlier invocation of the proce-
dure. Sometimes you may want to specify only the positions of the node and let the
procedure determine the routing of the arcs. The procedure looks for three default
variables in the data set:
X
,
Y
, and
SEQ
. The
X
and
Y
variables
are assumed to denote the x and y coordinates of the nodes and all the turning points
of the arcs connecting the nodes. The variable
SEQ
,
Y
, and
SEQ
SEQ
contain-
ing numbers sequentially starting with 1 and continuing onward. The procedure then
draws the arcs exactly as specied, without checking for consistency or interpolating
or extrapolating turning points that may be missing.
The ALIGN= variable provides another means of controlling the node layout (see the
Time-Scaled Network Diagrams section on page 618). This variable can be used to
specify the x coordinates for the different nodes of the network; the procedure then
determines the y coordinates. Note that time-scaled network diagrams (without an
ALIGN= specication) are equivalent to network diagrams drawn with the ALIGN=
variable being set to the E
START variable.
You can also control the placement of the nodes using the ZONE=option (see the
Zoned Network Diagrams section on page 620). The procedure uses the values of
the ZONE variable to divide the network into horizontal zones. Thus, you can control
618
Chapter 5. The NETDRAW Procedure
the horizontal placement of the nodes using the ALIGN= option and the vertical
placement of the nodes using the ZONE= option.
For networks that have a tree structure, the TREE option draws the network as a
tree, thus providing another layout option (see the Organizational Charts or Tree
Diagrams section on page 621). The procedure draws the tree from left to right,
with the root at the left edge of the diagram. Thus, the children of each node are
drawn to the right of the node. In the graphics mode of invocation, you can use
the ROTATETEXT option in conjunction with the ROTATE option in the ACTNET
statement (or the global graphics option ROTATE) to obtain a top-down tree diagram.
Time-Scaled Network Diagrams
By default, PROC NETDRAW uses the topological ordering of the activity network
to determine the x coordinates of the nodes. As a project progresses, you may want
to display the activities arranged according to their time of occurrence. Using the
TIMESCALE option, you can draw the network with a time axis at the top and
the nodes aligned according to their early start times, by default. You can use the
ALIGN= option to specify any of the other start or nish times in the Network data
set. In fact, PROC NETDRAW enables you to align the nodes according to any nu-
meric variable in the data set.
If the TIMESCALE option is specied without any ALIGN= specication, the pro-
cedure chooses one of the following variables as the ALIGN= variable: E
START,
L
START, S
START, or A
PATTERN variable, if it exists in the Network data set) override the node
patterns dictated by the ZONEPAT option.
Organizational Charts or Tree Diagrams
621
Organizational Charts or Tree Diagrams
The NETDRAW procedure automatically draws any acyclic network; it does not
have to be a representation of a project. You can also use the procedure to draw
a general directed graph that has cycles, if node location is specied or if the
BREAKCYCLE option is specied. The procedure attempts to draw the network
in a compact fashion, which may not always produce the expected result. Trees form
one such class of directed graphs that have an inherent natural layout that may not
be produced by the default layout of PROC NETDRAW. The TREE option in the
ACTNET statement exploits the tree structure of the network by laying the nodes out
in the form of a tree.
A directed graph is said to be a tree if it has a root and there is a unique directed path
from the root to every node in the tree. An equivalent characterization of a tree is
that the root node has no predecessors and every other node has exactly one prede-
cessor (Even 1979). Typical examples of trees that arise in project management are
organizational charts or work breakdown structures. If the TREE option is specied,
the NETDRAW procedure checks if the network has a tree structure and draws the
network with the root at the left edge of the diagram and the children of each node
appearing to the right of the node. In other words, the tree is drawn from left to right.
The NETDRAW procedure enables you to specify multiple trees in the same Network
data set; each tree is drawn separately in the same diagramwith all the roots appearing
at the left edge of the diagram. Thus, you can use the TREE option as long as every
node in the network has at most one predecessor. It you specify the TREE option and
some node has multiple predecessors, the TREE option is ignored and the procedure
uses the default node-layout algorithm.
There are several features that control the appearance of the tree:
The children of each node are placed in the order of occurrence in the Network
data set. The (x, y) coordinates of each node are required to be integers. The
procedure attempts to place each node at the center of all its children, subject
to the requirement that the coordinates must be integers. This requirement may
cause some of the nodes to be positioned slightly off-center. See Example 5.15
on page 674.
The SEPARATESONS option separates the children of a node, if necessary, to
enable the parent node to be exactly centered with respect to its children. See
the second part of Example 5.15 on page 674.
The CENTERSUBTREE option can be used to center each node with respect to
the entire subtree originating from the node instead of centering it with respect
to its children.
In graphics mode, you can change the orientation of the network to be from top
to bottom instead of from left to right. To do so, use the ROTATETEXT option
in the ACTNET statement to rotate the text within the nodes and the ROTATE
option in the ACTNET statement (or the ROTATE global graphics option) to
rotate the entire diagram by 90 degrees. See Example 5.18 on page 686 for an
illustration of this feature.
622
Chapter 5. The NETDRAW Procedure
Full-Screen Version
You can invoke PROC NETDRAW in full-screen mode by specifying FS (or
FULLSCREEN) in the PROC NETDRAW statement. The statement specications
are the same as for the line-printer mode. The full-screen mode offers you a con-
venient way to browse the network diagram of the project and change the layout of
the network by moving the nodes of the network to desired locations. However, you
cannot move a node to any position that violates the precedence constraints that must
be satised by the node. In other words, you cannot move a node to the left of any
of its predecessors or to the right of any of its successors. For time-scaled network
diagrams, you cannot move a node out of the column corresponding to the value of
the ALIGN= variable. For zoned network diagrams you cannot move a node out of
its zone.
The format control options are treated in the same way as for the line-printer version,
with some minor changes. It is assumed that the main purpose of invoking the proce-
dure is to gain a general picture of the layout of the entire network and to modify it
to some extent. In an effort to display as much of the network as possible, the initial
display on the screen is drawn with only one row and three columns for each node.
In other words, the BOXHT=, BOXWIDTH=, XBETWEEN=, and YBETWEEN=
options are ignored by the procedure in drawing the initial display. However, the full-
screen commands supported by PROC NETDRAW enable you to change the scale of
the diagram. You can display as much or as little information within each node by in-
voking the SCALE ROW or the SCALE COL command or both. The SCALE MAX
command causes the procedure to display the diagram using the values specied in
the ACTNET statement or the dimensions that would be required to display all the ID
information, whichever is larger. The SCALE RESET command returns the scaling
to the initial values used for display.
The nodes of the network are color coded on the basis of the PATTERN variable. If
there is no PATTERN variable, then the nodes are color coded depending on whether
the activities are normal, critical, or supercritical. The nodes are drawn in reverse
video. By default, the nodes are drawn without an outline; however, there is an
OUTLINE command that lets you toggle back and forth between an outlined or non-
outlined node. Using an outline for the node is useful if you want to obtain a printout
of the screen display using SPRINT; it helps mark the boundary of each node clearly.
Commands
Table 5.17 lists the commands that can be invoked from the command line in the
full-screen version of PROC NETDRAW. These commands are explained in greater
detail in this section.
Full-Screen Version
623
Table 5.17. Full-Screen Commands and Their Purposes
Controlling Changing Network
Scrolling Display Layout Exiting
BACKWARD OUTLINE CLEAR GEND
FORWARD SCALE MOVE END
LEFT CANCEL
RIGHT
TOP
BOTTOM
VSCROLL
HSCROLL
BACKWARD
scrolls toward the top of the network by the VSCROLL amount. BACKWARD MAX
scrolls to the top of the network. You can specify the vertical scroll amount for the
current command as BACKWARD PAGE | HALF | n.
BOTTOM
scrolls to the bottom of the network.
CANCEL
ends the current invocation of the procedure.
CLEAR
clears any outstanding move commands.
GEND
ends the current invocation of the procedure after drawing the network in graphics
mode with the compress option.
END
ends the current invocation of the procedure.
FORWARD
scrolls toward the bottom of the network by the VSCROLL amount. FORWARD
MAX scrolls to the bottom of the network. You can also specify the vertical scroll
amount for the current command as FORWARD PAGE | HALF | n.
HELP
displays a help screen listing all the full-screen commands specic to PROC
NETDRAW.
HOME
moves the cursor to the command line.
HSCROLL
sets the amount that information scrolls horizontally when you execute the LEFT or
RIGHT command. The format is HSCROLL PAGE | HALF | n. The specication
is assumed to be in number of horizontal levels. HSCROLL PAGE sets the scroll
amount to be the number of horizontal levels that t on one screen; HSCROLL HALF
is half that amount; HSCROLL n sets the horizontal scroll amount to n levels.
624
Chapter 5. The NETDRAW Procedure
KEYS
displays current function key settings for the NETDRAW procedure.
LEFT
scrolls toward the left boundary of the network by the HSCROLL amount. LEFT
MAX scrolls to the left boundary. You can specify the horizontal scroll amount for
the current command as LEFT PAGE | HALF | n.
MOVE
species a node to be moved or a place to move a node to. You can specify these in
any order. Thus, you can rst position the cursor on the node that you want to move,
issue the MOVE command, and then position the cursor at a target position and issue
the MOVE command again. If the target position is valid, the node is moved. You can
also rst specify the target position and then indicate the node that is to be moved.
Note: For a standard network, a node cannot be moved to any position that violates
the topological ordering of the nodes in the network. For time-scaled network dia-
grams, you cannot move a node to a level corresponding to a different tick mark. For
zoned network diagrams, you cannot move a node out of its zone.
OUTLINE
causes an outline to be drawn around each node in the network. This is useful if you
want to print a copy of the screen by using the SPRINT command. The OUTLINE
command works like an on/off switch: you can turn it off by entering the command
again.
RIGHT
scrolls toward the right boundary of the network by the HSCROLL amount. RIGHT
MAX scrolls to the right boundary. You can also specify the horizontal scroll amount
for the current command as RIGHT PAGE | HALF | n.
SCALE
controls the scaling of the nodes and the space between nodes. The format of this
command is SCALE MAX | MIN | RESET | ROW MAX | COL MAX | ROW MIN |
COL MIN | ROW n | COL n | +n | -n. The number n denotes the number of character
positions. SCALE MIN displays as many nodes on the screen as can t. SCALE
MAX enables as many rows and columns per node as is required to display all the
information that pertains to it. SCALE ROW MAX displays the maximum number
of rows per node. SCALE COL MAX displays the maximum number of columns
per node. SCALE ROW n sets the number of rows per node to n. SCALE ROW
+n increases the number of rows per node by n. SCALE COL n sets the number of
columns per node to n. SCALE COL +n increases the number of columns per node
by n. SCALE RESET sets the values to be the same as for the initial display. Note
that none of these values can be greater than the dimensions of the screen.
TOP
scrolls to the top of the network.
VSCROLL
sets the amount by which information scrolls vertically when you execute the
BACKWARD or FORWARD command. The format is VSCROLL PAGE | HALF | n.
Graphics Version
625
The specication is assumed to be in number of vertical levels. VSCROLL PAGE sets
the scroll amount to be the number of vertical levels that t on one screen; VSCROLL
HALF is half that amount; VSCROLL n sets the vertical scroll amount to n levels.
Full-Screen Global Commands
Most of the global commands used in SAS/FSP software are also valid with PROC
NETDRAW. Some of the commands used for printing screens are described in the
Global Commands section of Chapter 4, The GANTT Procedure.
Graphics Version
Several options are available in the ACTNET statement to enhance the appearance
of the network diagram in graphics mode. These are described in the Graphics
Options section on page 602. The format control options BOXWIDTH=, BOXHT=,
XBETWEEN=, and YBETWEEN= are also valid in this mode and can be used to
control the width and height of each node and the distance between the nodes. These
parameters are specied in terms of number of character cell positions. The number
of positions available on one page depends on the graphics device that is used; thus,
if a plotter is used with large paper, more of the network will be drawn on a single
page. Further, you can control the number of character cell positions on a page by
changing the values of the global graphics options (HPOS= and VPOS=). Note that
the NETDRAW procedure is not supported with the ActiveX or Java series of devices
on the GOPTIONS statement.
You can also control the number of nodes on a given page by specifying the
NXNODES= and NYNODES= options. The HPAGES= and VPAGES= options con-
trol the number of pages in the horizontal and vertical directions. Thus, you have a
wide degree of control over the amount of information displayed on each page of the
network diagram.
Another option that is available in graphics mode to control the appearance of your
network diagrams is the specication of a PATTERN variable in the ACTNET state-
ment. If the variable is named
PATTERN, you do not need to use the PATTERN=
option; the procedure looks for such a variable by default. You can use this variable
to specify the PATTERN denition that is to be used for lling each node of the net-
work. Note that if the value of the
PATTERN variable is j for a particular node,
PROC NETDRAW uses the specications in the jth generated PATTERN denition,
not the specications in the PATTERNj statement.
The patterns that can be used with PROC NETDRAW are any of the patterns that can
be used for drawing bars (not ones that are used for drawing maps). However, for the
text to be visible, you may want to restrict the patterns used to be empty and change
only the color of the pattern. You can also use solid lls with a light color and specify
the COUTLINE= and CCRITOUT= options to mark noncritical and critical nodes
with different colors for the outline.
See SAS/GRAPH Software: Reference for details about creating, canceling, review-
ing, and altering PATTERN denitions. For a brief description of the PATTERN
statement and for a list of available patterns, see Chapter 4, The GANTT
Procedure.
626
Chapter 5. The NETDRAW Procedure
If a PATTERN variable is not specied, the procedure uses the values of the
E
FINISH and L
and
Y
and
Y
EXIT
and REASON= (if PROC NETDRAW terminated unsuccessfully) can be one of the
following:
CYCLE
BADDATA
ERROR
MEMORY
ERROR
IO
ERROR
SEMANTIC
ERROR
SYNTAX
ERROR
NETDRAW
BUG
UNKNOWN
ERROR
This information can be used when PROC NETDRAW is one step in a larger pro-
gram that needs to determine whether the procedure terminated successfully or not.
Because
ORNETDR is a standard SAS macro variable, it can be used in the ways
that all macro variables can be used.
In addition to the STATUS= REASON= string indicating the status of the pro-
cedure, the macro variable
ORNETDR also provides some information about the
network diagram produced by the current invocation of PROC NETDRAW.
The information given in
ORNETDR is described in the following list along with
the keyword identifying it. It should be noted that these values refer to those actually
used in producing the network diagram and are not necessarily the same as those
specied in the invocation of the procedure.
HPAGES= The number of horizontal pages
VPAGES= The number of vertical pages
SEGNAME= The name of the rst network diagram segment in graphics mode
Note: Some of the information may be redundant or predictable in certain display
modes. For example, the value of the SEGNAME= option is empty in line-printer
and full-screen modes. The values of the HPAGES= and VPAGES= options are equal
to 1 in full-screen mode.
628
Chapter 5. The NETDRAW Procedure
Computer Resource Requirements
There is no inherent limit on the size of the network that can be drawn with the
NETDRAW procedure. Naturally, a sufcient amount of core memory must be avail-
able in order to invoke and initialize the SAS system. Furthermore, the amount of
memory required depends on the mode of invocation of the procedure. As far as pos-
sible, the procedure attempts to store all the data in core memory. However, if the
problem is too large to t in core memory, the procedure resorts to the use of utility
data sets and swaps between core memory and utility data sets as necessary.
The storage requirement for the data area required by the procedure is proportional
to the number of nodes and arcs in the network. The memory required is further in-
creased by the use of the DP option in the ACTNET statement. Recall that this option
requests the use of a dynamic programming algorithm to route the arcs between the
nodes, and such algorithms tend to grow exponentially with the size of the problem
being solved.
Examples
This section contains 18 examples that illustrate several features of the NETDRAW
procedure. Most of the examples use the data from the Widget Manufacturing Project
described in Chapter 2, The CPM Procedure. Two tables, Table 5.18 and Table
5.19, at the end of this section list all the examples in this chapter and the options and
statements in the NETDRAW procedure that are illustrated by each example.
Example 5.1. Line-Printer Network Diagram
This example uses the data set WIDGET that was used in Example 2.2 in Chapter
2, The CPM Procedure, to illustrate the Activity-on-Node representation of the
project. The following program invokes PROC NETDRAW twice. First, the Activity
data set WIDGET is used as input to the procedure. The activity and successor
information is identied using the ACTIVITY= and SUCCESSOR= options in the
ACTNET statement. The LINEPRINTER option is specied, producing the line-
printer network diagram shown in Output 5.1.1.
/* Activity-on-Node representation of the project */
data widget;
format task $12. succ1-succ3 $12.;
input task & days succ1 & succ2 & succ3 & ;
datalines;
Approve Plan 5 Drawings Anal. Market Write Specs
Drawings 10 Prototype . .
Anal. Market 5 Mkt. Strat. . .
Write Specs 5 Prototype . .
Prototype 15 Materials Facility .
Mkt. Strat. 10 Test Market Marketing .
Materials 10 Init. Prod. . .
Facility 10 Init. Prod. . .
Init. Prod. 10 Test Market Marketing Evaluate
Evaluate 10 Changes . .
Example 5.1. Line-Printer Network Diagram
629
Test Market 15 Changes . .
Changes 5 Production . .
Production 0 . . .
Marketing 0 . . .
;
title Widget Manufacture;
options ps=32 ls=78;
proc netdraw data=widget lineprinter;
actnet / activity=task successor=(succ1 succ2 succ3);
run;
Output 5.1.1. Line-Printer Network Diagram
Widget Manufacture
-------------- --------------
-- |Drawings |--- -- |Materials |---
| -------------- | | -------------- |
| | | |
| | | |
| | |------------------+--
| | | |
| | | |
-------------- | -------------- | -------------- | -------------- |
|Approve Plan|--+- |Write Specs |---- |Prototype |--+- |Facility |----
-------------- | -------------- -------------- | --------------
| |
| |
| |
| |
| |
| -------------- -------------- |
-- |Anal. Market|---- |Mkt. Strat. |------------------------
-------------- --------------
630
Chapter 5. The NETDRAW Procedure
Widget Manufacture
--------------
-- |Test Market |---
| -------------- |
| |
| |
----------------| |
| |
| |
-------------- | -------------- | -------------- --------------
|Init. Prod. |--+- |Evaluate |---- |Changes |---- |Production |
-------------- | -------------- -------------- --------------
|
|
|
|
|
| --------------
------------------ |Marketing |
--------------
Next, PROC CPM is invoked to schedule the project, and the resulting Schedule data
set is used as input to the NETDRAW procedure. In addition to the ACTIVITY=
and SUCCESSOR= options, the DURATION= option is used in the ACTNET state-
ment. The DURATION= option adds the values of the DURATION variable within
each node of the network. The procedure also displays the values of the E
START,
E
FINISH, L
START, L
FINISH, T
FLOAT, and F
FINISH and L
START times.
The FRAME option produces a border around the network diagram.
The AUTOREF option draws reference lines at every tick mark.
The LREF= and CREF= options specify the line style and color for the refer-
ence lines.
The SHOWBREAK option requests that breaks in the time axis be indicated
by breaks before the corresponding tick marks.
footnote j=l f=swiss h=1.5 Task Name / Late Finish Within Node
j=r f=swiss Time Scaled: Align = Late Start ;
proc netdraw data=widgupd graphics;
actnet / act=task
succ=(succ1 succ2 succ3)
ybetween = 10
separatearcs
pcompress
novcenter
font=swiss
id=(task l_finish)
nodefid
nolabel
boxwidth=5
showstatus
carcs=cyan
ccritarcs=red
vmargin=10
align=l_start
frame
autoref
lref=33
cref=cyan
showbreak
htext=2;
run;
Example 5.10. Further Time-Scale Options
655
Output 5.9.2. Timescale Option: ALIGN= L
START
Example 5.10. Further Time-Scale Options
In this example, the construction project described in Example 5.7 is used to illustrate
some more time-scale options. First, the REFBREAK option indicates breaks in the
time axis by drawing a zigzag line down the diagram before each tick mark corre-
sponding to a break. The CREFBRK= and LREFBRK= options control the color and
line style for these lines. The network diagram is shown in Output 5.10.1.
title f=swiss j=l h=1.5 Site: Old Well Road;
title2 f=swiss j=l h=1.5 Date: January 1, 2004;
footnote f=swiss j=r Time Scale Options: Reference Breaks ;
proc netdraw data=sched graphics;
actnet / act = task font=swiss
dur = duration
succ = (succesr1-succesr3)
dp compress separatearcs
htext=2
timescale refbreak lrefbrk = 33
carcs = cyan crefbrk = blue;
run;
656
Chapter 5. The NETDRAW Procedure
Output 5.10.1. Time-Scaled Network: Reference Breaks
Example 5.10. Further Time-Scale Options
657
Next, PROC NETDRAW is invoked with the LINEAR option so that there is no break
in the time axis. The BOXWIDTH= option limits the size of each node. The diagram
is drawn in Output 5.10.2.
footnote f=swiss j=r Time Scale Options: Linear Diagram ;
proc netdraw data=sched graphics;
actnet / act = task font=swiss
dur = duration
succ = (succesr1-succesr3)
dp
pcompress
novcenter
vmargin = 10
separatearcs
htext=2
carcs=cyan
id=(task)
nodefid
nolabel
boxwidth=7
timescale
linear
frame;
run;
658
Chapter 5. The NETDRAW Procedure
Output 5.10.2. Time-Scaled Network: LINEAR Option
Example 5.11. Zoned Network Diagram
659
Example 5.11. Zoned Network Diagram
This example illustrates zoned network diagrams. The Widget Manufacturing project
is used to illustrate some aspects of this feature. The data set DETAILS contains a
variable phase, which identies the phase of each activity in the project. This data
set is merged with the Activity data set from Example 5.1, WIDGET, to produce the
data set NETWORK that is input to PROC NETDRAW. The ZONE= option divides
the network diagraminto horizontal zones based on the project phase. The ZONEPAT
option causes the activities in each zone to be drawn using a different pattern. The
resulting network diagram is shown in Output 5.11.1.
data details;
format task $12. phase $13. descrpt $30. ;
input task & phase $ descrpt & ;
datalines;
Approve Plan Planning Develop Concept
Drawings Engineering Prepare Drawings
Anal. Market Marketing Analyze Potential Markets
Write Specs Engineering Write Specifications
Prototype Engineering Build Prototype
Mkt. Strat. Marketing Develop Marketing Concept
Materials Manufacturing Procure Raw Materials
Facility Manufacturing Prepare Manufacturing Facility
Init. Prod. Manufacturing Initial Production Run
Evaluate Testing Evaluate Product In-House
Test Market Testing Test Product in Sample Market
Changes Engineering Engineering Changes
Production Manufacturing Begin Full Scale Production
Marketing Marketing Begin Full Scale Marketing
;
data network;
merge widget details;
run;
pattern1 v=e c=green;
pattern2 v=e c=red;
pattern3 v=e c=magenta;
pattern4 v=e c=blue;
pattern5 v=e c=cyan;
title j=l f=swiss h=1.5 Project: Widget Manufacture;
title2 j=l f=swiss h=1.5 Date: December 1, 2003;
footnote j=r f=swiss Zoned Network Diagram ;
proc netdraw data=network graphics;
actnet / act=task
succ=(succ1 succ2 succ3)
font = swiss
separatearcs
zone=phase zonepat
pcompress htext=2;
label phase = Department;
run;
660
Chapter 5. The NETDRAW Procedure
Output 5.11.1. Zoned Network Diagram
Example 5.11. Zoned Network Diagram
661
Next, the project is scheduled with PROC CPM, and PROC NETDRAW is invoked
with the ZONE= and TIMESCALE options. The nodes are placed in different zones
as dictated by the ZONE variable, phase, and are aligned along the time axis as
dictated by the default ALIGN variable, E
= 0) and by drop-
ping the
SEQ
variable) for the two activities Select Households and Train Personnel are
interchanged. The new data set, displayed in Output 5.13.3, is then input to PROC
NETDRAW.
670
Chapter 5. The NETDRAW Procedure
Output 5.13.2. Layout Data Set
Project: Market Survey
NETWORK Output Data Set
Obs _FROM_ _TO_ _X_ _Y_ _SEQ_ _PATTERN id
1 plan sur hire per 1.0 2 0 1 Plan Survey
2 plan sur hire per 1.5 2 1 . Plan Survey
3 plan sur hire per 1.5 3 2 . Plan Survey
4 plan sur design q 1.0 2 0 1 Plan Survey
5 hire per trn per 2.0 3 0 1 Hire Personnel
6 hire per trn per 2.5 3 1 . Hire Personnel
7 hire per trn per 2.5 1 2 . Hire Personnel
8 design q trn per 2.0 2 0 1 Design Questionnaire
9 design q trn per 2.5 2 1 . Design Questionnaire
10 design q trn per 2.5 1 2 . Design Questionnaire
11 design q select h 2.0 2 0 1 Design Questionnaire
12 design q select h 2.5 2 1 . Design Questionnaire
13 design q select h 2.5 3 2 . Design Questionnaire
14 design q print q 2.0 2 0 1 Design Questionnaire
15 trn per cond sur 3.0 1 0 1 Train Personnel
16 trn per cond sur 3.5 1 1 . Train Personnel
17 trn per cond sur 3.5 2 2 . Train Personnel
18 select h cond sur 3.0 3 0 1 Select Households
19 select h cond sur 3.5 3 1 . Select Households
20 select h cond sur 3.5 2 2 . Select Households
21 print q cond sur 3.0 2 0 1 Print Questionnaire
22 cond sur analyze 4.0 2 0 1 Conduct Survey
23 analyze 5.0 2 0 1 Analyze Results
data nodepos;
set network;
if _seq_ = 0;
drop _seq_;
if _from_ = select h then _y_=1;
if _from_ = trn per then _y_=3;
run;
title2 Modified Node Positions;
proc print data=nodepos;
run;
Output 5.13.3. Modied Layout Data Set
Project: Market Survey
Modified Node Positions
Obs _FROM_ _TO_ _X_ _Y_ _PATTERN id
1 plan sur hire per 1 2 1 Plan Survey
2 plan sur design q 1 2 1 Plan Survey
3 hire per trn per 2 3 1 Hire Personnel
4 design q trn per 2 2 1 Design Questionnaire
5 design q select h 2 2 1 Design Questionnaire
6 design q print q 2 2 1 Design Questionnaire
7 trn per cond sur 3 3 1 Train Personnel
8 select h cond sur 3 1 1 Select Households
9 print q cond sur 3 2 1 Print Questionnaire
10 cond sur analyze 4 2 1 Conduct Survey
11 analyze 5 2 1 Analyze Results
Note that the data set NODEPOS contains variables named
FROM
and
TO
,
which specify the (activity, successor) information; hence, the call to PROC
NETDRAW does not contain the ACTIVITY= and SUCCESSOR= specications.
Example 5.13. Modifying Network Layout
671
The presence of the variables
X
and
Y
in this data set, PROC NETDRAW assumes that only the node
coordinates are given and uses these node positions to determine how the arcs are to
be routed. The resulting network diagram is shown in Output 5.13.4.
title2 f=swiss j=l h=1.5 Changing Node Positions;
footnote f=swiss j=r Modified Network Layout ;
proc netdraw data=nodepos graphics;
actnet / id=(id)
nodefid
nolabel
carcs = blue
ctext = white
coutline = red
font = swiss
centerid
boxht = 3
htext=2
pcompress
separatearcs
ybetween=8;
run;
Output 5.13.4. Modied Network Layout of SURVEY Project
672
Chapter 5. The NETDRAW Procedure
Example 5.14. Specifying Node Positions
This example uses a typical problem in network ow optimization to illustrate how
you can use PROC NETDRAW to draw a network by specifying completely all the
node positions. Consider a simple two-period production inventory problem with
one manufacturing plant (PLANT), two warehouses (DEPOT1 and DEPOT2), and
one customer (CUST). In each period, the customer can receive goods directly from
the plant or from the two warehouses. The goods produced at the plant can be used
to satisfy directly some or all of the customers demands or can be shipped to a ware-
house. Some of the goods can also be carried over to the next period as inventory
at the plant. The problem is to determine the minimum cost of satisfying the cus-
tomers demands; in particular, how much of the customers demands in each period
is to be satised from the inventory at the two warehouses or from the plant, and
also how much of the production is to be carried over as inventory at the plant? This
problem can be solved using PROC NETFLOW; the details are not discussed here.
Let PLANT
i rep-
resent the inventory at DEPOT1 in period i, DEPOT2
,
Y
START
and B
START, A
FINISH, PCT
type=LOGIC))
mininterval=duration unit specied by the Per Interval option
scale=integer value specied by the Columns option
name=g graphics catalog entry name
maxids draw maximum number of identiers
interval=duration unit duration unit used for scheduling
dur=duration cmile=color if Show Milestones is selected
activity=actid succ=succid
lag=lag cprec=color if Show Precedence is selected
noarrowhead if Suppress Arrowheads is selected
nojobnum unless Show Job Numbers is selected
nolegend unless Show Chart Legend is selected
compress if Compress To One Page is selected
hconnect chcon=color if Draw Task Lines is selected
critag if Flag Critical Tasks is selected
combine if Combine Schedules is selected
labvar=actid if Mark Parent Tasks is selected
&ganopts markwknd if Mark Weekends is selected
markbreak if Mark Work Breaks is selected
idpages if Print Id On Each Page is selected
ll if Fill Pages Completely is selected
noframe if Suppress Chart Frame is selected
pcompress if Proportional Compress is selected
hpages=integer value specied by the Horizontal Pages option
vpages=integer value specied by the Vertical Pages option
height=numeric value specied by the Text Height option
caxis=color specied by the Time Axis option
ctext=color specied by the Text option
cframe=color specied by the Chart Frame option
holiday=(hstart) holidur=(holidur) if holidays were used in scheduling
holin=(hnish)
calid=calid if calendars were used in scheduling
timenow=timenow date if Draw Timenow Line is selected
notnlabel unless Label Timenow Line is selected
Macro Variables
787
Note that the CALEDATA=, HOLIDATA= AND WORKDATA= specications are
not added to the &gantdata macro variable unless the active projects duration unit is
larger than DAY.
Network Diagram Reports
Name Contents Explanation
&gout gout=work.ngseg graphics catalog specication
&res Lineprinter, Fullscreen or Graphics specied by the Resolution option
name=n graphics catalog entry name
zone=variable name specied by the Zone Variable option
nozonelabel if Suppress Zone Labels is selected
zonespace if Space Between Zones is selected
nodefaultid unless Show Default Vars is selected
nolabel unless Label Variables is selected
duration=duration if Show Duration is selected
separatearcs if Draw Separate Arcs is selected
showstatus if Show Progress is selected
compress if Compress To One Page is selected
centerid if Center Id Values is selected
spanningtree if Spanning Tree Layout is selected
lag=(lag) if Show Precedence Type is selected
rectilinear if Draw Rectangular Arcs is selected
pcompress if Proportional Compress is selected
&netopts arrowhead=0 if Suppress Arrowheads is selected
noarrowll if Draw Open Arrowheads is selected
nonumber if Suppress Page Numbers is selected
hpages=integer value specied by the Horizontal Pages option
vpages=integer value specied by the Vertical Pages option
height=numeric value specied by the Text Height option
carcs=color specied by the Arcs option
ccritarcs=color specied by the Critical Arcs option
ctext=color specied by the Node Text option
frame caxis=color if Draw Border is selected
autozone if Automatic Zone Layout is selected
linear if Draw Linear Time Axis is selected
autoref cref=color if Draw Reference Lines is selected
refbreak if Show Ref. Line Breaks is selected
showbreak if Show Time Axis Breaks is selected
notimeaxis if Suppress Time Axis is selected
align=schedule variable name specied by the Schedule option
Note that the following specications are not added to the &netopts macro variable
unless the Schedule option is specied: FRAME, CAXIS=, LINEAR, AUTOREF,
CREF=, REFBREAK, SHOWBREAK, AND NOTIMEAXIS.
788
Chapter 7. The Projman Application
Resource Reports
Name Contents Explanation
&gout gout=work.rgseg graphics catalog specication
&plotopts name=r graphics catalog entry name
&chrtopts name=r graphics catalog entry name
&resdict work.resdict resource dictionary data set
&schedout data set name report schedule data set
&varlist
ALL
,
MON
,
TUE
,
WED
,
THU
,
FRI
and
SAT
.
For a description of standard import options, see the Standard Import Options sec-
tion on page 806.
Import Holiday Data Set Window
813
Calendar Name
The Calendar Name variable should contain values that represent the names of the
individual calendars. This variable can be either character or numeric, and it is re-
quired.
Description
The Description variable normally contains values that provide more detailed infor-
mation (that is, longer name) about the calendar. This variable can be either character
or numeric.
Import Holiday Data Set Window
This window enables you to import a SAS data set that contains holiday information.
Projman assumes that the selected data set is in the format appropriate for input to the
CPM or PM procedure. For more information, see the HOLIDATA Data Set section.
When you select the data set that you want to import, you must identify certain vari-
ables within that data set. Projman attempts to recognize the variables by searching
for some standard names; however, it is likely that you will need to select the required
variables. When all the necessary selections have been made and the holiday data set
is imported, the appropriate holidays are created.
For a description of standard import options, see the Standard Import Options sec-
tion on page 806.
814
Chapter 7. The Projman Application
Name
The Name variable should contain values that represent a short name for each holiday.
This variable can be either character or numeric.
Description
The Description variable normally contains values that provide more detailed infor-
mation (that is, longer name) about the holiday. This variable can be either character
or numeric.
Calendar
The Calendar variable should contain values that represent the name of the calendar
to which the holiday belongs. Projman assumes that the calendars already exist. If
they do not, after the import, you can create the calendars or import a calendar data
set. This variable can be either character or numeric.
Start
The Start variable should contain values that indicate the start date of each holiday.
This variable must be numeric, and it is required.
Finish
The Finish variable should contain values that indicate the nish date of each holiday.
This variable must be numeric. This variable is optional; however, if the Duration
variable is not specied, Projman assumes that each holiday is to last one duration
unit.
Import Resourcein Data Set Window
815
Duration
The Duration variable should contain values that indicate the length of each holi-
day. This variable must be numeric. This variable is optional; however, if the Finish
variable is not specied, Projman assumes that each holiday is to last one duration
unit.
Import Resourcein Data Set Window
This window enables you to import a SAS data set that contains resource information.
Projman assumes that the selected data set is in the format appropriate for input to the
CPM or PM procedure. For more information, see the RESOURCEIN= Input Data
Set section.
When you select the data set that you want to import, you must identify certain vari-
ables within that data set. Projman attempts to recognize the variables by searching
for some standard names; however, it is likely that you will need to select the required
variables. When all the necessary selections have been made and the resourcein data
set is imported, the appropriate resources are created.
For a description of standard import options, see the Standard Import Options sec-
tion on page 806.
Obstype
The Obstype variable should contain values that represent the type identier for the
particular observation. The Obstype values are required to follow the same nam-
ing convention as that used by the CPM procedure. For more information, see the
OBSTYPE=variable section. This variable must be character, and it is required.
Period
The Period variable should contain values that indicate the specic date for each
observation containing resource availability information. This variable must be nu-
meric.
816
Chapter 7. The Projman Application
Resname
The Resname variable should contain values that represent the names of resources
that have alternate (substitutable) resource specications. This variable must be char-
acter.
Import Workshift Data Set Window
This window enables you to import a SAS data set that contains workshift informa-
tion. Projman assumes that the selected data set is in the format appropriate for input
to the CPM or PM procedure. For more information, see the WORKDATA Data Set
section.
Valid workshift data sets contain numeric variables only. If the selected data set does
not contain any numeric variables, an attention window is raised.
When you have made the necessary selections, the workshift data set is imported and
the appropriate workshifts are created.
For a description of standard import options, see the Standard Import Options sec-
tion on page 806.
Library
This list contains all currently dened SAS library names. Use this list to select
the library that contains the data set that you want to import. Selection of a library
automatically populates the Datasets list.
Datasets
This list contains the names of all SAS data sets that currently reside in the selected
library. Select the data set that you want to import.
Edit Date Window
817
Edit Date Window
This window can be used to specify and/or modify date values. If no initial date is
specied, the current date is used. To modify the date value, use the horizontal sliders
to select the desired Day, Month, Year, and Time. Use the OK button to conrm the
changes or the Cancel button to cancel the changes. The Clear button can be used to
remove the date specication.
818
Appendix . The Projman Application
Appendix A
Glossary of Project Management
Terms
Appendix Contents
REFERENCES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 833
820
Appendix A. Glossary of Project Management Terms
Appendix A
Glossary of Project Management
Terms
A
Activity
An element of work performed during the course of a project. An activity normally
has an expected duration, an expected cost, and expected resource requirements.
Activities are often subdivided into tasks.
Activity delay
The maximumamount of time that an activity can be delayed due to lack of resources.
Activity-on-arrow (AOA)
See arrow diagramming method.
Activity-on-node (AON)
See precedence diagramming method.
Activity priority
A priority value assigned to activities to provide an ordering for activities that are
waiting for resources (during resource-constrained scheduling).
Activity splitting
Allowing activities to be split into segments during resource allocation. In some
instances, preemption of activities may free a resource to be used by a more critical
activity.
Actual Cost of Work Performed (ACWP)
Total costs incurred (direct and indirect) in accomplishing work during a given time
period. See also earned value.
Actual Finish date (AF)
The calendar date work actually ended on an activity. It must be prior to the timenow
date.
822
Appendix A. Glossary of Project Management Terms
Actual Start date (AS)
The calendar date work actually began on an activity. It must be prior to the timenow
date.
Aggregation
Using activity resource requirements to calculate total resource needs rather than to
constrain the project schedule. Normally, resource requirements are used to perform
resource-constrained scheduling.
Alignment type
The alignment type is used to identify the type of constraint associated with a target
date. The following types are available:
Finish On
Finish On or After
Finish On or Before
Start On
Start On or After
Start On or Before
Mandatory Start
Mandatory Finish
Arrow
The graphic representation of an activity. See also arrow diagramming method.
Arrow diagramming method
A network diagramming technique in which activities are represented by arrows. The
tail of the arrow represents the start and the head represents the nish of the activity
(the length of the arrow does not represent the expected duration of the activity).
Activities are connected at points called nodes (usually drawn as small circles) to
illustrate the sequence in which the activities are expected to be performed. See also
precedence diagramming method.
As-of date
See timenow date.
B
Backward pass
The calculation of late nish dates and late start dates for the uncompleted portions
of all network activities. Determined by working backwards through the network
logic from the projects end date. The end date can be specied, although it is usually
calculated in a forward pass.
Appendix A. Glossary of Project Management Terms
823
Baseline schedule
A project schedule consisting of baseline start and nish dates, which represent an
estimated or expected schedule, or both. This schedule is often derived from an
initial set of early, late, or scheduled nish dates. Typically, once a baseline schedule
is established, it does not change over the course of a project.
Baseline Finish date (BF)
The calendar date when work is scheduled to end on an activity. This date is usually
estimated, or it can be derived from the early, late or scheduled nish dates. Typically,
once a baseline schedule is established, it does not change over the course of the
project.
Baseline Start date (BS)
The calendar date when work was scheduled to begin on an activity. This date is
usually estimated, or it can be derived from the early, late, or scheduled start dates.
Typically, once a baseline schedule is established, it does not change over the course
of the project.
Budget at Completion (BAC)
The estimated total cost of the project when done.
Budgeted Cost of Work Performed (BCWP)
The sum of the approved cost estimates (including any overhead allocation) for ac-
tivities (or portions of activities) completed during a given period (usually project-to-
date). See also earned value.
Budgeted Cost of Work Scheduled (BCWS)
The sum of the approved cost estimates (including any overhead allocation) for ac-
tivities (or portions of activities) scheduled to be performed during a given period
(usually project-to-date). See also earned value.
C
Calendar
A calendar identies project work days, and it can be altered so that weekends, holi-
days, vacation, weather days, and so forth are not included.
Cost Performance Index (CPI)
The ratio of budgeted costs to actual costs (BCWP/ACWP). The CPI is often used to
predict the magnitude of a possible cost overrun using the following formula: original
cost estimate/CPI = projected cost at completion. See also earned value.
824
Appendix A. Glossary of Project Management Terms
Cost variance (CV)
(1) Any difference between the estimated cost of an activity and the actual cost of an
activity.
(2) In earned value, BCWP less ACWP.
Critical activity
Any activity on the critical path.
Critical path
The series of activities of a project that determines the earliest completion of the
project. The critical path generally changes from time to time as activities are com-
pleted ahead of or behind schedule. The critical path is usually dened as those
activities with total oat less than or equal to zero. See also critical path method.
Critical path method (CPM)
A network analysis technique used to predict project duration by analyzing which
sequence of activities (which path) has the least amount of scheduling exibility
(the least amount of total oat). Early dates are calculated by means of a forward
pass using a specied start date. Late dates are calculated by means of a backward
pass starting from a specied completion date (usually the forward passs calculated
project early nish date).
Cycle
See loop.
D
Data date
See timenow date.
Dependency
See logical relationship.
Duration
The number of work periods (not including holidays or other nonworking periods)
required to complete an activity or set of activities. All activity durations are specied
with the same duration unit.
Appendix A. Glossary of Project Management Terms
825
Duration unit
The duration unit species the unit of time for the duration of each activity in the
project. The following choices are available:
Second
Minute
Hour
Day
Weekday
Week
Month
Qtr
Year
E
Early Finish date (EF)
In the critical path method, the earliest possible point in time at which the uncom-
pleted portions of an activity (or the project) can nish, based on the network logic
and any schedule constraints. Early nish dates can change as the project progresses
and changes are made to the project plan.
Early Start date (ES)
In the critical path method, the earliest possible point in time at which the uncom-
pleted portions of an activity (or the project) can start, based on the network logic
and any schedule constraints. Early start dates can change as the project progresses
and changes are made to the project plan.
Earned value (EV)
(1) A method for measuring project performance. It compares the amount of work
that was planned with what was actually accomplished to determine if cost and sched-
ule performance is as planned. See also actual cost of work performed, budgeted cost
of work performed, budgeted cost of work scheduled, cost variance, cost performance
index, schedule variance, and schedule performance index.
(2) The budgeted cost of work performed, for an activity or group of activities.
Earned value analysis
See denition (1) under earned value.
826
Appendix A. Glossary of Project Management Terms
Effort
The number of labor units required to complete an activity or other project element.
Usually expressed as staffhours, staffdays, or staffweeks. Should not be confused
with duration.
Estimate at Completion (EAC)
The expected total cost of an activity, group of activities, or the project when the
dened scope of work has been completed. Most techniques for forecasting EAC
include some adjustment of the original cost estimate based on project performance
to date. Also called estimated at completion. Often shown as EAC = Actuals-to-
date + ETC. See also earned value and estimate to complete.
Estimate to Complete (ETC)
The expected additional cost needed to complete an activity, a group of activities,
or the project. Most techniques for forecasting ETC include some adjustment to the
original cost estimate based on project performance to date. Also called estimated
to complete. See also earned value and estimate at completion.
F
Float
See total oat.
Forward pass
The calculation of the early start and early nish dates for the uncompleted portions
of all network activities. See also backward pass.
Free oat (FF)
The amount of time an activity can be delayed without delaying the early start of any
immediate successor activities. See also total oat.
G
Gantt chart
A graphic representation of work activities shown by a time-scaled bar chart.
Graphical Evaluation and Review Technique (GERT)
A network analysis technique that allows for conditional and probabilistic treatment
of logical relationships (that is, some activities may not be performed).
Appendix A. Glossary of Project Management Terms
827
H
Holiday
A period of time within the project timeframe when work cannot be scheduled.
Holidays can be assigned to one or more calendars.
L
Lag
A modication of a logical relationship that directs a delay of the successor task. For
example, in a nish-to-start dependency with a 10-day lag, the successor activity can
start 10 days after the predecessor has nished. See also lead.
Late Finish date (LF)
In the critical path method, the latest possible point in time that an activity can be
completed without delaying a specied milestone (usually the project nish date).
Late Start date (LS)
In the critical path method, the latest possible point in time that an activity can begin
without delaying a specied milestone (usually the project nish date).
Lead
A modication of a logical relationship that allows an acceleration of the successor
task. For example, in a nish-to-start dependency with a 10-day lead, the successor
activity can start 10 days before the predecessor has nished. See also lag.
Logic
The collection of activity dependencies that make up a project network diagram.
Logic diagram
See network diagram.
Logical relationship
A dependency between two project activities. The four possible types of logical
relationships are
Finish-to-start the from activity must nish before the to activity can
start.
Finish-to-nish the from activity must nish before the to activity can
nish.
Start-to-start the from activity must start before the to activity can start.
Start-to-nish the from activity must start before the to activity can nish.
Finish-to-start is dened as the standard (or default) logical relationship.
828
Appendix A. Glossary of Project Management Terms
Loop
A network path that passes the same node twice. Loops cannot be analyzed using
traditional network analysis techniques such as CPM and PERT. Loops are allowed
in GERT.
M
Maximum number of segments
This value species the maximum number of segments that an activity can be split
into when activity splitting is allowed.
Milestone
A signicant event in the project, usually completion of a major deliverable.
Minimum segment duration
This value species the minimum duration of a segment of an activity when activity
splitting is allowed.
N
Near-critical activity
An activity that has low total oat.
Network
See network diagram.
Network analysis
The process of identifying early and late start and nish dates for the uncompleted
portions of project activities. See also critical path method, Program Evaluation and
Review Technique, and Graphical Evaluation and Review Technique.
Network diagram
A schematic display of the logical relationships of project activities. Always drawn
from left to right to reect project chronology. Often incorrectly referred to as a
"PERT chart."
Network logic
See logic.
Network path
Any continuous series of connected activities that make up a project network diagram.
Appendix A. Glossary of Project Management Terms
829
Node
One of the dening points of a network; a junction point joined to some or all of
the other dependency lines. Also, the graphic representation of an activity. See also
arrow diagramming method and precedence diagramming method.
Non-standard logical relationship
A dependency between two project activities that is not the standard nish-to-start
relationship. See logical relationship for the four possible types of relationships.
O
Organizational breakdown structure (OBS)
A depiction of the project organization arranged so as to relate work packages to
organizational units.
Overlap
See lead.
P
Parent task
See supertask.
Path
A set of sequentially connected activities in a project network diagram.
Path oat
See total oat.
Percent complete
An estimate, expressed as a percent, of the amount of work that has been completed
on an activity or group of activities.
PERT chart
A specic type of project network diagram. See Program Evaluation and Review
Technique.
Precedence diagramming method (PDM)
A network diagramming technique in which activities are represented by boxes (or
nodes). Activities are linked together by precedence relationships to show the se-
quence in which the activities are to be performed.
830
Appendix A. Glossary of Project Management Terms
Precedence relationship
The term used in the precedence diagramming method for a logical relationship.
In current usage, however, precedence relationship, logical relationship, and depen-
dency are widely used interchangeably regardless of the diagramming method in use.
Predecessor activity
Any activity that exists on a common path with the activity in question and occurs
before the activity in question.
Preemption
See activity splitting.
Program Evaluation and Review Technique (PERT)
An event-oriented network analysis technique used to estimate project duration when
there is a high degree of uncertainty with the individual activity duration estimates.
PERT applies the critical path method to a weighted average duration estimate.
Project
A temporary endeavor undertaken to create a unique product or service. A project
consists of one or more activities.
Project management
The application of knowledge, skills, tools, and techniques to project activities in
order to meet or exceed stakeholder needs and expectations from a project.
Project Management Body of Knowledge (PMBOK)
An inclusive term that describes the sum of knowledge within the profession of
project management. As with other professions such as law, medicine, and account-
ing, the body of knowledge rests with the practitioners and academics who apply
and advance it. The PMBOK includes proven, traditional practices that are widely
applied as well as innovative and advanced ones that have seen more limited use.
Project network diagram
See network diagram.
Project schedule
The planned dates for performing activities and the planned dates for meeting mile-
stones.
R
Remaining duration
The amount of time needed to complete an activity.
Appendix A. Glossary of Project Management Terms
831
Resource-constrained scheduling
The scheduling of activities in a project with the knowledge of certain resource con-
straints and requirements. This process adjusts activity scheduled start and nish
dates to conform to resource availability and use.
Resource leveling
Any form of network analysis in which scheduling decisions (start and nish dates)
are driven by resource management concerns (for example, limited resource avail-
ability or difcult-to-manage changes in resource levels).
S
Schedule
See project schedule.
Schedule analysis
See network analysis.
Schedule performance index (SPI)
The ratio of work performed to work scheduled (BCWP/BCWS). See earned value.
Schedule variance
(1) Any difference between the scheduled completion of an activity and the actual
completion of that activity.
(2) In earned value, BCWP less BCWS.
Scheduled Finish date (SF)
The date when the activity is scheduled to be completed using the resource-
constrained scheduling process.
Scheduled Start date (SS)
The date when the activity is scheduled to begin using the resource-constrained
scheduling process. This date is equal to or greater than the early start date.
Slack
Term used in PERT for oat (see also total oat).
Subtask
An activity that is contained within a supertask.
832
Appendix A. Glossary of Project Management Terms
Successor activity
Any activity that exists on a common path with the activity in question and occurs
after the activity in question.
Supertask
An aggregate or summary activity that contains one or more activities (or subtasks)
such that no subtask can begin until the supertask has begun and the supertask cannot
end until all of the subtasks have ended.
T
Target date
A date used to constrain the start or nish of an activity. The type of constraint is
identied by an alignment type.
Task
See activity.
Timenow date
The calendar date that separates actual (historical) data from future (scheduled) data.
Total Float (TF)
The amount of time that an activity can be delayed from its early start without delay-
ing the project nish date. Total oat is a mathematical calculation and can change as
the project progresses and changes are made to the project plan. Also called oat,
slack, and path oat. See also free oat.
W
Work breakdown structure (WBS)
A deliverable-oriented grouping of project elements that organizes and denes the
total scope of the project. Each descending level represents an increasingly detailed
denition of a project component. Project components can be products or services.
Work packages
A deliverable at the lowest level of the work breakdown structure. A work package
can be divided into activities.
Workshift
One or more pairs of on/off working times that dene the valid working periods
within a single day.
References
833
References
Project Management Institute (1996), A Guide to the Project Management Body of
Knowledge, Upper Darby, PA.
834
Appendix A. Glossary of Project Management Terms
Subject Index
A
ACT variables,
See also ACTION variables
Payoff data set (DTREE), 342
ACTDELAY variable
Activity data set (CPM), 93, 233
ACTID variable
Schedule data set (PM), 720
ACTION variables
Payoff data set (DTREE), 342
actions, decision stage, 305
activities
limiting the number per page (GANTT), 446
activity align types, 85
activity axis
GANTT procedure, 410, 464
activity calendar, 88, 188
Activity data set
as input to NETDRAW procedure, 609
CPM procedure, 65, 68, 77, 412
missing values, 152
resource requirement specication (CPM), 130
variables, 150
activity delay
analysis, 95, 113, 213
and supplementary resources, 134
example (CPM), 225, 229, 230, 233
specication, 93, 95
wait until, 94
activity duration,
See duration
activity information,
See also Activity data set
additional variables, 90
activity numbers
PM procedure, 718
PM Window, 718
Activity-on-Arc
network diagram, 67
specication, CPM procedure, 89, 104
specication, Logic Gantt charts, 473
Activity-on-Edge,
See Activity-on-Arc
Activity-on-Node
network diagram, 67
specication, CPM procedure, 82, 103
specication, Logic Gantt charts, 474
Activity-on-Vertex,
See Activity-on-Node
activity splitting
at TIMENOW (CPM), 85, 124, 137
CPM procedure, 97, 98, 102, 135, 136
example (CPM), 236
example (GANTT), 526
GANTT procedure, 452, 488
maximum number of segments, 97
minimum duration of segment, 98
option to allow default, 102
activity status
ags indicating, 426, 489
indicating within node, 600, 649
setting in CPM procedure, 114
activity text
color, 439
font baseline, 463
ACTIVITY variable
Activity data set (CPM), 82
Network data set (NETDRAW), 595, 610
Precedence data set (GANTT), 411, 423, 436,
443, 449, 474
ACTIVITYPRTY variable
Activity data set (CPM), 93
actual bar
height, 436
offset, 436
actual schedule
CPM procedure, 82, 122124
example (CPM), 201
example (GANTT), 519
ll pattern for (GANTT), 465
nish times (CPM), 83
GANTT procedure, 452, 487
start times (CPM), 83
ACWP, 50
add activities
PM procedure, 712
PM Window, 712
add activity records
CPM procedure, 77
add subtasks
PM Window, 714
add tasks
Table View (PM), 703
A
DUR variable
Schedule data set (CPM), 113, 123, 124, 203
A
FINISH variable
836
Subject Index
Activity data set (CPM), 83, 108, 122
Network data set (NETDRAW), 597, 611, 614
Schedule data set (CPM), 113, 123, 124, 203
Schedule data set (GANTT), 425, 434, 451, 453,
521
AFINMILE variable
Schedule data set (CPM), 112
ALABEL variable
Label data set (GANTT), 485, 486
ALIGN variable
Network data set (NETDRAW), 595, 599, 610,
617
ALIGNDATE variable
Activity data set (CPM), 85, 108, 110, 111
alignment constraints
CPM procedure, 85, 110, 111
Gantt View, 709
PM Window, 715
pop-up menu, 705
ALIGNTYPE variable
Activity data set (CPM), 85, 110, 111
alternate resources
CPM procedure, 94, 98, 100, 137, 138
example (CPM), 240
alternatives, decision stage, 305
Annotate data set
DTREE procedure, 327
GANTT procedure, 411, 421, 437, 464
NETDRAW procedure, 583, 626
processing (DTREE), 328
suppress processing (DTREE), 328
Annotate facility
coordinate systems (GANTT), 464
coordinate systems (NETDRAW), 626
drawing legend of decision tree diagram, 382
DTREE procedure, 381
example (GANTT), 552
example (NETDRAW), 677, 681
GANTT procedure, 464
NETDRAW procedure, 626
AOA,
See Activity-on-Arc
AOE,
See Activity-on-Arc
AON,
See Activity-on-Node
AOV,
See Activity-on-Node
arc routing, 611, 613
arrow diagramming method,
See Activity-on-Arc
arrowheads
length of, 602
no ll, 605
suppress display (GANTT), 446, 478
suppress display (NETDRAW), 602, 674
A
START variable
Activity data set (CPM), 83, 108, 122
Network data set (NETDRAW), 597, 611, 614
Schedule data set (CPM), 113, 114, 123, 124,
203
Schedule data set (GANTT), 425, 434, 451, 453,
521
attitudes toward risk, 312
Automatic Text Annotation, 453, 481485,
See also labeled Gantt charts
auxiliary resources
CPM procedure, 141
example (CPM), 292, 295
axis
activity (GANTT), 410, 464
time (GANTT), 410, 429432, 438, 456, 457,
464
B
baseline bar
height, 437
offset, 437
baseline schedule
comparing, 86, 87, 121, 233
ll pattern for (GANTT), 465
GANTT procedure, 452, 487
measuring project progress, example (GANTT),
521
PM Window, 712, 715
setting, 86, 87, 201
specifying, 86, 87, 121
treatment of SEGMT
NO variable (GANTT),
488
updating, 87
BCWP, 50
BCWS, 50
B
FINISH variable
Activity data set (CPM), 86
Schedule data set (CPM), 87, 201
Schedule data set (GANTT), 426, 434, 451, 453,
522
break and shift information
dening, 422, 424, 427
discussion, CPM procedure, 115121
displaying, 427, 429, 458
B
START variable
Activity data set (CPM), 86
Schedule data set (CPM), 87, 201
Schedule data set (GANTT), 426, 434, 451, 453,
522
BY processing
example (GANTT), 531, 535
GANTT procedure, 455
BY variables
Schedule data set (GANTT), 424, 453, 531
C
C/SCSC, 55
CAL
variable,
See also CALID variable
Activity data set (CPM), 88
Calendar data set (CPM), 88
Subject Index
837
Holiday data set (CPM), 88
Resource Schedule data set (CPM), 93
Schedule data set (GANTT), 426
Calendar data set
calendars example (CPM), 118
CPM procedure, 65, 77, 115, 117, 180, 185
GANTT procedure, 411, 422, 457, 458
missing values, 152
treatment of CALID variable, 426, 457
variables, 150
calendar information,
See also Calendar data set
lag dialog box, 711
PM Window, 715
pop-up menu, 705
Table View, 705
calendars,
See also Calendar data set
See also Holiday data set
See also holidays
See also multiple calendars and holidays
See also Workday data set
associated with activity, 70
default, CPM procedure, 116
discussion, 115121
in Usage data set, 142
length of workday (CPM), 78, 107, 116, 117
multiple calendars, 115121
start of workday (CPM), 78, 107, 116
work shifts, 116
work unit specication (CPM), 79
CALID variable
Activity data set (CPM), 88, 115, 116
Calendar data set (CPM), 88, 115118
Calendar data set (GANTT), 426, 457
example (CPM), 188, 192
Holiday data set (CPM), 88, 115, 116, 118, 119
Holiday data set (GANTT), 426, 457
Schedule data set (GANTT), 426, 457
center
ID variables (NETDRAW), 603
turning off vertical (NETDRAW), 606, 614, 636
certain equivalent
calculation, 351
DTREE procedure, 323, 349
exponential utility function, 349
chance nodes
character, 332
color, 327, 332
font, 332
height, 332
symbol, 333
chance stage
decision tree model, 305
outcomes, 305
probabilities, 305
character specication,
See also symbol specication
chance nodes (DTREE), 332
decision nodes (DTREE), 333
end nodes (DTREE), 333
chart format
controlling, 455
chart outlines and dividers, 433
CHART variables, 424
example (GANTT), 504
project management symbols, 473
Schedule data set (GANTT), 424, 435, 453, 488
SYMBOL statements and, 468
chart width, 438
CIRCLE, special symbol table
DTREE procedure, 333
CLABEL variable
Label data set (GANTT), 484, 486
clip labels
Labeling facility (GANTT), 443
collapse supertasks
Table View, 705
color specication
activity text (GANTT), 439
arcs (NETDRAW), 601, 602
axis (NETDRAW), 601, 602
break lines along time axis (NETDRAW), 602,
604
chance nodes (DTREE), 327, 332
connect line (GANTT), 438
critical arcs (NETDRAW), 601, 603
decision nodes (DTREE), 328, 333
end nodes (DTREE), 328, 333
frame ll (GANTT), 438
links of optimal decisions (DTREE), 327, 330
links on decision tree (DTREE), 327, 330
milestone (GANTT), 438
nodes (NETDRAW), 622, 625
outline for all nodes (NETDRAW), 603
outline for critical nodes (NETDRAW), 603
precedence connections (GANTT), 439
reference lines (GANTT), 439
reference lines (NETDRAW), 602, 604
symbol (DTREE), 327, 328, 332, 333
text (DTREE), 328
text (GANTT), 439
text (NETDRAW), 604
time axis (GANTT), 438
timenow line (GANTT), 440
zone line (GANTT), 440
column headings
splitting, 424
column, change order
Table View, 704
column, change width
Table View, 704
common working calendar, 100
comparison of schedules, 87
compress in graphics mode
decision tree diagram, 327, 378
Gantt chart, 439, 448, 507
network diagram, 585, 603, 606, 636
838
Subject Index
computer resource requirements
CPM procedure, 79, 154
DTREE procedure, 358
GANTT procedure, 491
NETDRAW procedure, 628
concatenate early, late, and actual schedule bars, 426,
488
example (GANTT), 524
conditional probability, 305
connect line, 428
character for drawing, 433
color, 438
line style, 444
consumable resource, 127
contract bidding decision problem, 376
convert Microsoft Project data to SAS, 62, 722
coordinate system
annotate processing (GANTT), 464
annotate processing (NETDRAW), 626
copy activities
PM Window, 714
corners, rectangular
decision tree diagram, 332
network diagram, 606
corners, rounded
decision tree diagram, 332
network diagram, 606
corporate risk tolerance, 350
assessing, 351
estimating, 350
COST variables,
See REWARD variables
CPM,
See critical path method
CPM examples
activity splitting, 236
Activity-on-Arc format, 159
Activity-on-Node format, 156
alternate resources, 240
analyzing resource delay, 211
auxiliary resources, 292, 295
basic project schedule, 154
changing length of workday, 171
changing start of workday, 171
course scheduling, 250
nish milestone, 283
incorporating actual schedule, 201
infeasibility diagnostics, 223
meeting project deadlines, 162
multiproject scheduling, 255
negative resource requirements, 290, 292, 295
nonstandard precedence constraints, 194
PERT analysis, 247
resource calendars, 263, 295
resource-driven durations, 263, 295
resource-constrained scheduling, 211
saving a target schedule, 201
scheduling around holidays, 174
scheduling courses, 250
scheduling only on weekdays, 167
scheduling over nonstandard day and week, 179,
184
setting activity delay, 229
setting project nish date, 162
setting project start date, 157
substitutable resources, 240
summarizing resources used by project, 207
supplementary resources, 218
time-constrained scheduling, 199
TIMENOW option, 201
use of PROC CALENDAR to print schedule,
164
CPM procedure
Activity data set, 77, 412
Activity-on-Arc, 67
Activity-on-Node, 67
actual schedule, 82
add activity records, 77
alternate resources, 137
auxiliary resources, 141
baseline schedules, 121
Calendar data set, 77, 115, 117
computer resource requirements, 79, 154
default calendar, 116
denitions of Schedule data set variables, 113
115
details, 105
duration specication, 107
nish milestone, 111, 112
oat times, 106
formatting details, 153
functional summary, 72
Holiday data set, 78, 115, 118120
input data sets, 150
macro variable
ORCPM
, 149
missing values, treatment of, 152
multiple alternates, 138
multiple calendars, 115121
multiproject scheduling, 146149
negative resource requirements, 131
options classied by function, 72
ORCPM
macro variable, 18
output data sets, 113, 142, 145
overview, 18, 65
precedence relationships, 108, 109
progress updating, 122124
progress variables, 82, 122124
random activity durations, 250
resource allocation, 126139, 142145
Resource data set, 80, 126
resource-driven durations, 140
Resource Schedule data set, 81
resource usage, 143
SAS date, time, and datetime values, 78, 107,
108, 119, 153
Schedule data set, 80, 113115
scheduling subject to precedence constraints,
106, 107
Subject Index
839
serial-parallel scheduling method, 131, 133
specifying resource requirements, 130, 131
syntax skeleton, 72
table of syntax elements, 72
target schedules, 121
time-constrained scheduling, 110, 111
Usage data set, 80
variables, 113, 150
Workday data set, 81, 115, 116
CPU requirement,
See computer resource requirements
critical activities
CPM procedure, 68, 70, 106, 111, 114
ll pattern for duration of (GANTT), 465
GANTT procedure, 426, 433
node pattern (NETDRAW), 625
status ags to indicate, 496
critical path, 106, 114
critical path method (CPM), 66, 68
cumulative resource usage, 95
cumulative reward, 346
on decision tree diagram, 323, 324, 338
optimal decision summary, 325
current time,
See TIMENOW
cycles
denition, CPM procedure, 107
in network diagrams, 584, 619, 666
D
data ow
between procedures, 17, 23
CPM procedure, 18
DTREE procedure, 25
GANTT procedure, 20
NETDRAW procedure, 21
PM procedure, 22
data sets,
See SAS data sets
data storage requirements,
See computer resource requirements
day
length of, 78, 107, 116, 117, 172, 427, 458
start of, 78, 107, 116, 117, 172, 427, 458
deadlines,
See also milestones
nish-before date, 78
decision analysis
example, 57
introduction, 24
decision criterion, 323
specifying, 312
decision model,
See decision tree model
decision nodes
character, 333
color, 328, 333
font, 333
height, 333
symbol, 333
decision stage
decision tree model, 305
outcomes, 305
decision support systems, 24
decision tree diagram
cumulative reward, 323, 338
displaying, 306, 311, 338, 348, 352
drawing on one page, 327, 378
evaluating value, 323, 338
graphics version, 354
information displayed, 323, 338
labels, 324, 338
line-printer version, 354
number of pages, 353
outcome name, 323, 338
page format, 352
probability, 323, 338
reward, 323, 338
stage name, 323, 338
decision tree model, 305
difference between rewards and payoffs, 344
evaluating, 306, 311
modifying, 306
outcomes, 305
recalling, 306, 337
representing, 325
saving, 306, 337, 348
scenario, 338
stages, 305
default calendar
CPM procedure, 88, 116, 188
GANTT procedure, 457
delay diagnostics,
See activity delay, analysis
DELAY
R variable
Schedule data set (CPM), 95, 113, 213
delete activities
PM Window, 714
delete duplicate observations, 77
delete precedence constraints
PM Window, 715
delete tasks
Table View (PM), 703
diagnose resource infeasibilities,
See infeasibility diagnostics
dialog box
edit lag, 701, 711
edit lag calendar, 711
task information, 702
discount rate
example (DTREE), 394
display
information in decision tree diagram, 323, 338
information in network diagram, 613
schedule bar, Gantt View, 708
task information, Gantt View, 708
displayed output
DTREE procedure, 352
840
Subject Index
GANTT procedure, 487
NETDRAW procedure, 613
dividers and outlines
Gantt chart, 433
D
LENGTH variable
Calendar data set (CPM), 117
DOT, special symbol table
DTREE procedure, 334
draw and display networks,
See NETDRAW procedure, network layout
drill-down Gantt charts
graphics example (GANTT), 566
DTREE examples, 358
contract bidding decision problem, 376
loan grant decision problem, 384
oil wildcatters decision problem, 359, 364
petroleum distributors decision problem, 394
research and development decision problem, 380
DTREE procedure
computer resource requirements, 358
displayed output, 352
displaying decision tree, 352
error handling, 357
evaluating decision tree, 348
functional summary, 320
general options, 323326
graphics options, 326334
Imagemap data set, 330, 356
input data sets, 343
interactivity, 347
line-printer options, 334
missing values, 347
ODS table names, 357
options classied by function, 320
output data sets, 306
Output Delivery System (ODS), 306
overview, 25, 305
syntax skeleton, 319
table of syntax elements, 320
terminating, 306, 337, 347
variables, 340343
duplicate ID values, 427, 451
duplicate observations
deleting (CPM), 77
DUR
variable,
See also DURATION variable
Resource Schedule data set (CPM), 146
Schedule data set (GANTT), 427
duration
calculated, 89
estimates of, 248
multiplier, CPM procedure, 79
resource-driven, 103, 113, 125
specication, CPM procedure, 88, 107
units, CPM procedure, 70, 79, 107, 167
DURATION variable
Activity data set (CPM), 88, 125
Network data set (NETDRAW), 596
Schedule data set (GANTT), 427, 428, 455
DUR
TYPE variable
Resource Schedule data set (CPM), 145
dynamic programming algorithm, 596, 613, 648
E
early bar
height, 440
offset, 440
early schedule
GANTT procedure, 452, 487
early start schedule computation,
See schedule computation
Earned Value Analysis, 55
edit
alignment constraints, Table View, 704
calendars, Table View, 705
durations, Gantt View, 710
durations, PM Window, 714
durations, Table View, 704
lag, Gantt View, 711
project, PM procedure, 711
E
FINISH variable
Network data set (NETDRAW), 597, 611, 614
Schedule data set (CPM), 70, 96, 106, 113, 114
Schedule data set (GANTT), 428, 434, 451, 453,
454, 529
EFINMILE variable
Schedule data set (CPM), 112
end nodes
character, 333
color, 328, 333
font, 333
height, 333
symbol, 334
end stage
decision tree model, 305
equity
estimating corporate risk tolerance, 351
errors
CPM procedure, 149, 152
DTREE procedure, 324, 345348, 357
GANTT procedure, 453, 490
NETDRAW procedure, 627
ES
ASC variable
Schedule data set (CPM), 91
ES
DESC variable
Schedule data set (CPM), 91
E
START variable
Network data set (NETDRAW), 597, 611, 614
Schedule data set (CPM), 70, 96, 106, 111, 113,
114
Schedule data set (GANTT), 428, 434, 451, 453,
529
evaluating value
decision tree diagram, 324
DTREE procedure, 342, 343, 349
on decision tree diagram, 323, 338
on optimal decision summary, 325
optimal, 336
Subject Index
841
represented with Payoff data set (DTREE), 325
selecting the best alternative, 351
EVEN variables,
See also EVENT variables
Probability data set (DTREE), 341
EVENT variables
Probability data set (DTREE), 341
events, 305
examples,
See also CPM examples
See also DTREE examples
See also GANTT examples
See also introductory examples
See also NETDRAW examples
See also PM examples
statement and option cross-reference tables
(CPM), 298300
statement and option cross-reference tables
(DTREE), 404
statement and option cross-reference tables
(GANTT), 577579
statement and option cross-reference tables
(NETDRAW), 689
expand supertasks
Table View, 705
expected utility, DTREE procedure, 349
expected value, DTREE procedure, 349
exponential utility function
DTREE procedure, 312, 323, 349351
example (DTREE), 363
F
F
FLOAT variable
Network data set (NETDRAW), 597, 611, 614
Schedule data set (CPM), 70, 96, 113, 114
ll patterns
limiting PATTERN variable to specic sched-
ules, 447
suppress using PATTERN variable (GANTT),
446
using PATTERN variable (GANTT), 448, 464,
465
lling page area, 428, 455, 496
lters, 716
nancial decisions,
See loan grant decision problem
nish-before date
CPM procedure, 78
nish milestone
CPM procedure, 111, 112
example (CPM), 283
nish times
computation of, CPM procedure, 106
format of, 453
interpretation of, CPM procedure, 107
padding, 453
treatment of, 452
FINISH variable
Activity data set (CPM), 89
FLABEL variable
Label data set (GANTT), 484, 486
ags
activity status, 426, 489
oat
free, 70, 106, 114
total, 70, 106, 114
font baseline of activity text, 442, 463
font specication,
See also symbol specication
baseline of activity text (GANTT), 442
chance nodes (DTREE), 332
decision nodes (DTREE), 333
end nodes (DTREE), 333
milestones (GANTT), 441
symbol (DTREE), 332334
text (DTREE), 329
text (GANTT), 440
text (NETDRAW), 604
font, hardware
for text on decision tree, 329
fonts for Gantt charts
ORFONT (lled), 471
ORFONTE (empty), 471, 472
fonts for project management and decision analysis,
471
forced nish,
See time constraints, Mandatory Finish
forced start,
See time constraints, Mandatory Start
format control options
DTREE procedure, 324, 325, 353
GANTT procedure, 455
NETDRAW procedure, 596601, 613, 615
formatting
details, CPM procedure, 153
numerical values on decision tree diagram, 324
outcome names on decision tree diagram, 325
time axis (GANTT), 432
frame ll
color, 438
framing chart
suppress, 446
free oat,
See oat, free
FRI
variable
Calendar data set (CPM), 117
FROM
variable
Layout data set (NETDRAW), 616
Network data set (NETDRAW), 595
full-screen version
changing the scale (NETDRAW), 622
differences with line-printer version (GANTT),
458
GANTT procedure, 422, 458
global commands (GANTT), 461
global commands (NETDRAW), 625
local commands (GANTT), 459
local commands (NETDRAW), 622, 623
842
Subject Index
modifying the network layout, 617
NETDRAW procedure, 622, 623, 625
options specic to (GANTT), 432
options specic to (NETDRAW), 594, 601, 602
output format, 459
routing images to a le, 461
routing images to a printer, 462
use of the PATTERNvariable (NETDRAW), 622
functional summary
CPM procedure, 72
DTREE procedure, 320
GANTT procedure, 417
NETDRAW procedure, 590
future certain equivalent value,
See evaluating value
future funds
example (DTREE), 394
F
VAR variable
Schedule data set (CPM), 87, 203, 233
G
Gantt charts, 410
GANTT examples, 492
activity ltering, 535
actual schedule, 519
annotate facility (graphics), 552
BY processing, 531
compressing chart to t on one page (graphics),
507
concatenating early, late, and actual schedules,
524
customizing the Gantt chart, 496
direct specication of schedule data, 528
drawing Gantt charts by resource usage, 535
drawing Gantt charts by task code, 531
drill-down Gantt charts (graphics), 566
tting the chart on one page (graphics), 507
graphics mode, 499
height and placement of text (graphics), 539
holidays in scheduling, 501
introductory, 412
labeled Gantt charts (graphics), 557
layout controls for Logic Gantt charts (graphics),
542
line-printer mode, 492
Logic Gantt chart, AOA representation (graph-
ics), 542
Logic Gantt chart, AON representation (graph-
ics), 540
Logic Gantt charts, layout control (graphics),
542
milestones and special dates, 504
monitoring project progress against a baseline
schedule, 521
multiple calendars, 516
multiproject Gantt charts (graphics), 560
multisegment Gantt charts (graphics), 563
nonstandard precedence relationships, 549
printing a Gantt chart, 492
resource-constrained schedule, 526
smallest identiable time unit, 508
statement and option cross-reference tables,
577579
time axis, altering range (graphics), 511
variable length holidays, 512
Web-enabled Gantt charts (graphics), 566
zoned Gantt charts (graphics), 565
GANTT procedure
activity axis, 410, 464
Annotate data set, 411, 421, 437, 464
annotate processing, 464
automatic text annotation, 411
Calendar data set, 411, 422, 426, 457, 458
computer resource requirements, 491
coordinate systems in annotate processing, 464
data storage requirements, 491
description of, 409
direct input of schedule data, 528
displayed output, 487
functional summary, 417
graphics examples, 499
Holiday data set, 411, 422, 457, 458
holidays in scheduling, 422, 428, 429, 457, 501,
519
HTML Imagemap data set, 423
Imagemap data set, 412, 423, 486
input data sets, 411
justication, 438, 444, 449
Label data set, 411, 423
labeling, 411
line-printer examples, 492
macro variable
ORGANTT, 442, 450, 490
memory requirements, 491
missing value handling, 453
nonstandard precedence relationships, 411, 412,
473, 474, 477479
options classied by function, 417
ORFONT font, 471
ORFONTE font, 471, 472
GIVE variables,
See also GIVEN variables
Probability data set (DTREE), 342
GIVEN variables
Probability data set (DTREE), 342
global commands
full-screen version (GANTT), 461
full-screen version (NETDRAW), 625
global graphics options
color of symbol, 327, 328
color of text, 328
controlling the appearance of decision tree, 354,
380
font of text, 329
height, 329
number of columns, 354
number of rows, 354
unit of measure, 326
global options
DTREE procedure, 347
global verticals, 445, 477,
See also Logic Gantt charts
graphics catalog
DTREE procedure, 329
GANTT procedure, 422
NETDRAW procedure, 594
segment description (GANTT), 440
segment description (NETDRAW), 604
segment name (GANTT), 446
segment name (NETDRAW), 605
graphics version
activity text placement (GANTT), 441, 442
effects of HPOS and VPOS, 463
example (DTREE), 376
examples (GANTT), 499
tting Gantt chart on a single page, 439, 448, 463
formatting the chart, 463
GANTT procedure, 422, 463
introductory example (GANTT), 415
NETDRAW procedure, 625, 626
options specic to (DTREE), 326334
options specic to (GANTT), 435
options specic to (NETDRAW), 594, 602608
text font baseline (GANTT), 442
use of the PATTERNvariable (NETDRAW), 625
H
hardware font
for text on decision tree, 329
HEAD variable
Activity data set (CPM), 89
Schedule data set (GANTT), 441, 473
height specication
actual bar (GANTT), 436
baseline bar (GANTT), 437
chance nodes (DTREE), 332
decision nodes (DTREE), 333
early bar (GANTT), 440
end nodes (DTREE), 333
holiday bar (GANTT), 441
late bar (GANTT), 440
milestones (GANTT), 442
nodes on decision tree (DTREE), 329
resource-constrained schedule bar (GANTT),
448
schedule bar (GANTT), 437
symbol (DTREE), 329, 332, 333
text (DTREE), 329
text (GANTT), 441, 442
hide
schedule bar, Gantt View, 708
tasks, Table View, 706
hierarchical charts,
See organizational charts
HLABEL variable
Label data set (GANTT), 484, 486
holiday bar
height, 441
offset, 441
Holiday data set
CPM procedure, 65, 78, 89, 115, 118120, 174,
185
GANTT procedure, 411, 422, 457, 458
holidays example (CPM), 119
missing values, 152
treatment of CALID variable, 457
treatment of holiday related variables, 89, 428,
429, 457
variables, 150
holiday information,
See Holiday data set
HOLIDAY variable
Holiday data set (CPM), 89, 90, 118, 119
Holiday data set (GANTT), 428, 457
holidays,
See also Holiday data set
character to represent (GANTT), 433
dening, 89, 422, 457
displaying, 457
duration units, 429, 457
durations, 89, 90, 429
examples (GANTT), 501
ll pattern for (GANTT), 465
nish times, 89, 90, 429
GANTT procedure, 428
844
Subject Index
graphics example (GANTT), 519
scheduling around, 70, 457
start times, 89, 428
variable length, example (GANTT), 512
HOLIDUR variable
Holiday data set (CPM), 89, 90, 118, 119
Holiday data set (GANTT), 429, 457
HOLIFIN variable
Holiday data set (CPM), 89, 90, 118, 119
Holiday data set (GANTT), 429, 457
horizontal banding,
See zoned network diagrams
horizontal space
around margin (NETDRAW), 604, 652
between ID columns (GANTT), 426
between nodes (NETDRAW), 601, 613, 647
I
ID variables
Activity data set (CPM), 90
column headings, 489
displaying as many as possible, 430
displaying on multiple pages, 429, 489
duplicate values, 427, 451, 488
format of (GANTT), 453
labels for headings, 489
labels, suppress displaying, 489
NETDRAW procedure, 613, 614
Network data set (NETDRAW), 597, 611, 614
omission of, 489
Schedule data set (GANTT), 424, 426, 427, 451,
453, 487489
space between columns, 426
split character for labels, 424
splitting column headings, 424
stripping leading blanks, 432
Imagemap data set
DTREE procedure, 306
GANTT procedure, 412
independent resource scheduling, 96, 135
infeasibility diagnostics
CPM procedure, 97, 134, 223
input data sets,
See also Activity data set
See also Annotate data set
See also Calendar data set
See also Holiday data set
See also Label data set
See also Layout data set
See also Network data set
See also Payoff data set
See also Precedence data set
See also Probability data set
See also Resource data set
See also Schedule data set
See also Stage data set
See also Workday data set
CPM procedure, 18, 65, 150
DTREE procedure, 25, 305, 306, 340, 343
GANTT procedure, 20, 411
NETDRAW procedure, 21, 583
PM procedure, 22
interactivity
DTREE procedure, 347
introductory examples
decision analysis, 57
multiple projects, 38
project cost control, 49
project denition, 26
project reports, 30
resource-constrained schedule, 34
scheduling a project, 30
sequential scheduling of projects, 47
summarizing project information, 32
work breakdown structure, 29
J
JLABEL variable
Label data set (GANTT), 485, 486, 558
job axis,
See activity axis
job number
displaying on multiple pages, 489
suppress displaying, 430, 489
justication
Gantt charts, 438, 444, 449
L
label clipping rules
Labeling facility (GANTT), 443
Label data set
GANTT procedure, 411, 423, 442, 453, 481
label splitting
Labeling facility (GANTT), 443
LABEL variable
Label data set (GANTT), 443, 481, 484, 486
labeled Gantt charts, 411, 442, 464, 481
clipping rules, 443
control on common tickmarks, 485
determining the label string, 484
formatting the label, 484
graphics example (GANTT), 557
justifying the strings, 485
positional information, 442
specifying character baseline angle, 485
specifying character rotation angle, 485
specifying colors, 484
specifying fonts, 484
specifying heights, 484
specifying placement offsets, 484
specifying the coordinate system, 483
specifying the horizontal placement position,
483
specifying the labels, 482
specifying the vertical placement position, 482
splitting labels, 443
text string information, 442
variables in the Label data set, 485
Subject Index
845
labels on decision tree diagram, 324, 338
displaying, 324
suppress displaying, 324, 338
LABVAR variable
Label data set (GANTT), 442, 481, 482, 486,
557, 560
Schedule data set (GANTT), 442, 560
lag calendar, 711
lag dialog box, 701, 711
lag types, 103, 109, 443, 444, 473, 477, 711
LAG variables,
See also nonstandard precedence relationships
Activity data set (CPM), 103
example (CPM), 194
Network data set (NETDRAW), 597
Precedence data set (GANTT), 411, 412, 443,
444, 474
late bar
height, 440
offset, 440
late schedule
GANTT procedure, 452, 487
late start schedule computation,
See schedule computation
layout controls, 477,
See also Logic Gantt charts, layout controls
See also NETDRAW procedure, network layout
Layout data set
as input to NETDRAW procedure, 609
NETDRAW procedure, 583, 595, 609, 616
legend
customized with Annotate data set (DTREE),
327, 382
GANTT procedure, 487
on decision tree diagram, 330
suppress displaying (DTREE), 330
suppress displaying (GANTT), 430
L
FINISH variable
Network data set (NETDRAW), 597, 611, 614
Schedule data set (CPM), 70, 97, 106, 113, 114
Schedule data set (GANTT), 429, 434, 451, 453
LFINMILE variable
Schedule data set (CPM), 112
limiting number of activities per page
GANTT procedure, 446
limiting number of horizontal pages
GANTT procedure, 442
limiting number of vertical pages
GANTT procedure, 450
line-printer version
examples (GANTT), 492
GANTT procedure, 423
introductory example (GANTT), 414
options specic to (DTREE), 334
options specic to (GANTT), 432
line style specication
break lines along time axis (NETDRAW), 605
connect lines (GANTT), 444
links across pages (DTREE), 330, 331
links of optimal decisions (DTREE), 330, 331
links on decision tree (DTREE), 330, 331
precedence connections (GANTT), 444
reference lines (GANTT), 444
reference lines (NETDRAW), 605
timenow line (GANTT), 444
zone line (GANTT), 444
line width specication
arcs and nodes (NETDRAW), 605
critical arcs and nodes (NETDRAW), 605
GANTT procedure, 444
links of optimal decisions (DTREE), 330, 332
links on decision tree (DTREE), 330, 331
node outlines (NETDRAW), 605
precedence connections (GANTT), 450
timenow line (GANTT), 450
zone line (GANTT), 450
line-printer version
options specic to (NETDRAW), 594, 608, 609
linear utility function, 349
links across pages
color, 330
style, 331
thickness, 330
type, 330, 331
links of optimal decisions
color, 327, 330
style, 331
thickness, 330, 332
type, 330, 331
links on decision tree
color, 327, 330
style, 331
thickness, 330, 331
type, 330, 331
litigation decisions,
See petroleum distributors decision problem
loan grant decision problem, 384
local commands
full-screen version (GANTT), 459
full-screen version (NETDRAW), 622
local options
DTREE procedure, 347
local verticals, 445, 478,
See also Logic Gantt charts
logic bar, 474, 477
graphics example (GANTT), 540, 542
Logic Gantt charts, 473
3-segment connection, 474, 476, 479
5-segment connection, 474, 480
AOA representation, graphics example
(GANTT), 542
AOA specication, 441, 449, 473
AON representation, graphics example
(GANTT), 540
AON specication, 436, 449, 474
arrowheads, 446, 478
arrowheads, suppress display, 478
controlling the layout, 477
846
Subject Index
drawing the precedence connections, 474
error handling, 449
nish global vertical, 477
nish local vertical, 478
framing chart, suppress, 446
global verticals, 445, 477
global verticals, illustration of, 477
global verticals, minimum interdistance of, 445,
478
global verticals, minimum offset from logic bar,
445, 478
horizontal tracks for segment placement, 478
introductory example, 416
lag types, 443, 444, 474, 477
layout controls, 445, 474, 476, 477
linking Precedence data set and Schedule data
set, 474
local verticals, 445, 478
local verticals, illustration of, 478
local verticals, maximum displacement from
minimum offset location, 445, 478
local verticals, minimum offset from logic bar,
446, 478
logic bar, 444, 474, 475, 477, 478
nonstandard precedence relationships, 411, 412,
473, 474, 477479
placement of horizontal segments, 478
placement of vertical segments, 477, 478
precedence connections, illustration, 475
Precedence data set, 436, 449, 474
Precedence data set, linking to Schedule data set,
474
precedence information, 436, 441, 443, 444,
449, 473
precedence information using PROC CPM, 473
precedence relationships, 411, 412, 473475,
477480
routing sequence, 474
routing the connection, 479
Schedule data set, 474
Schedule data set, linking to Precedence data set,
474
start global vertical, 477
start local vertical, 478
time axis, extension of, 476
time axis, suppress extension of, 446, 476
turning points, 474, 476
vertical tracks for segment placement, 477, 478
Logic options, 453, 473
loop,
see cycles
LOSS variables,
See VALUE variables
LS
ASC variable
Schedule data set (CPM), 91
LS
DESC variable
Schedule data set (CPM), 91
L
START variable
Network data set (NETDRAW), 597, 611, 614
Schedule data set (CPM), 70, 97, 106, 111, 113,
114
Schedule data set (GANTT), 429, 434, 451, 453
LVAR variable
Label data set (GANTT), 443, 481, 484, 486
M
machine epsilon, 325
macro variable
ORCPM
, 149
ORNETDR, 627
TIMENOW, 721
mandatory time constraints,
See time constraints
maximum allowable text height (GANTT), 441
maximum number of observations (CPM), 98
MAXNSEGMT variable
Activity data set (CPM), 97
MDB format
Microsoft Project, 62, 722
MDBTOPM Macro
PM procedure, 722
memory requirements,
See computer resource requirements
menu systems for project management, 60
Microsoft Project
converting to PM, 62, 722
MDB format, 62, 722
milestones, 427, 455
character to represent, 434
color, 438
examples (GANTT), 504
font, 441
height, 442
PM Window, 714
project management symbols, 473
set nish (CPM), 81
symbol value, 449
MINSEGMTDUR variable
Activity data set (CPM), 98
missing values
CPM procedure, 152
DTREE procedure, 347
GANTT procedure, 453
NETDRAW procedure, 611
mode specic differences, 486
graphics options, 487
line-printer and full-screen options, 487
MON
variable
Calendar data set (CPM), 117
most likely value, DTREE procedure, 349
move tasks
Table View, 706
MP2KTOPM Macro
PM procedure, 722
multiple alternates
CPM procedure, 98, 138, 139
multiple calendars and holidays
Subject Index
847
common working calendar, 100
CPM procedure, 115121
example (CPM), 184
example (GANTT), 516
GANTT procedure, 457
scheduling during common working times, 100
syntax differences between PROC CPM and
PROC GANTT, 457
multiple pages
displaying decision tree diagram, 352
GANTT procedure, 455
NETDRAW procedure, 614, 615
multiproject Gantt charts
graphics example (GANTT), 560
multiproject scheduling, 146149
example (CPM), 255
introductory example, 38
sequential scheduling example, 47
multisegment Gantt charts
graphics example (GANTT), 563
N
negative oat, 434
negative requirements
specifying, CPM procedure, 131
negative resource requirements
example (CPM), 290, 292, 295
negative slack duration, 434
net income
estimating corporate risk tolerance, 351
net present value, 398
net sales
estimating corporate risk tolerance, 351
NETDRAW examples
branch and bound trees, 686
compressing graphics version to t on a page,
636
controlling information within nodes, 640
controlling the number of pages, 640
controlling the routing of the arcs, 647
displaying status of the activities, 649
drawing an AOA network using the Annotate fa-
cility, 681
drawing organizational charts, 674
drawing schematic diagrams, 663
graphics version, 633
illustrating data ow, 663
illustrating several time-scale options, 655
illustrating the Annotate facility, 677
line-printer version, 628
modifying network layout, 668
nonstandard precedence relationships, 645
spanning several pages, 634
specifying node layout through the Network data
set, 672
time-scaled network diagram, 652
zoned network diagram, 659
NETDRAW procedure
Annotate data set, 594, 602
Annotate facility, 626
arc layout options, 596599, 601
arc routing, 611, 613
backward arcs in networks, 619
computer resource requirements, 628
controlling the network layout, 617
cyclic networks, 584, 612, 619
default ID variables, 613
details, 609
dynamic programming, 613
format control, 596601, 613, 615
full-screen options, 594, 601, 602
full-screen version, 617, 622, 623, 625
functional summary, 590
graphics catalog specication, 594
graphics options, 594, 602608
graphics version, 625, 626
hierarchical charts, 621
horizontal placement of nodes, 617
HTML Imagemap data set, 594
Imagemap data set, 594
information within node, 613
input data sets, 583, 609
Layout data set, 595, 616
layout specication, 617
line-printer options, 594, 608, 609
missing values, 611, 614
modes of display, 584, 594, 595, 614
modifying the network layout, 585, 617
moving nodes, 622
Network data set, 594
network layout, 583, 585, 611614, 616618
network specication, 595, 600
node coordinates and layout, 611
node layout, 584, 585
number of pages, 615
options classied by function, 590
organizational charts, 621
TYPE variable
Usage data set (CPM), 94
ODS,
See Output Delivery System
offset specication
actual bar (GANTT), 436
baseline bar (GANTT), 437
early bar (GANTT), 440
holiday bar (GANTT), 441
late bar (GANTT), 440
resource-constrained schedule bar (GANTT),
449
schedule bar (GANTT), 437
zone line (GANTT), 451
oil wildcatters decision problem, 344, 348
a risk-averse setting, 364
an insurance option, 359
example, 307
sounding test option, 315
value of perfect control, 314
value of perfect information, 313
optimal decision
determining, 312
optimal decision summary
displaying, 306, 311, 325, 338, 347, 351, 352
example, 311, 316, 345, 346
suppress displaying, 325
optimal evaluating value, 336
options
not changed, 337
resetting, 306, 337, 347
specied on multiple statements, 347
options classied by function,
See functional summary
ORCPM
OUT variables,
See also OUTCOME variables
Stage data set (DTREE), 340
outcome name
on decision tree diagram, 323, 338
OUTCOME variables
Stage data set (DTREE), 340
outcomes
chance stage, 305
decision stage, 305
decision tree model, 305
name, 305
Subject Index
849
reward, 305
successor, 305
outlines and arcs
network diagrams, 602, 608
outlines and dividers
Gantt chart, 433
output,
See also displayed output
See also output data sets
output data sets,
See also Imagemap data set
See also Layout data set
See also Project data set
See also Resource Schedule data set
See also Schedule data set
See also Usage data set
CPM procedure, 18, 65
DTREE procedure, 306
GANTT procedure, 412, 423
NETDRAW procedure, 20, 21, 583
PM procedure, 22
Output Delivery System (ODS)
DTREE procedure, 306
GANTT procedure, 566
table names, 357
overprint character
for CHART variables, 434
for schedule variables, 434
overview
CPM procedure, 65
DTREE procedure, 305
GANTT procedure, 409
NETDRAW procedure, 583
PM procedure, 695
Projman, 749
P
padding nish times, 427, 430, 452, 454, 504
default behavior, 455
page
drawing decision tree on a single, 327, 378
drawing Gantt chart on a single, 507
drawing network on a single, 603, 606, 636
format of decision tree diagram, 352
format of Gantt chart, 455
format of network diagram, 615
page numbers
in NETDRAW procedure, 606
on decision tree diagram, 332
on Gantt charts, 447
suppress displaying (DTREE), 332
suppress displaying (GANTT), 446
suppress displaying (NETDRAW), 605
PAGEBRK variable
Label data set (GANTT), 485, 486
pages
display page number (GANTT), 447
limiting number of (GANTT), 431, 442, 450,
463
limiting number of (NETDRAW), 599
limiting number of horizontal (GANTT), 442
limiting number of vertical (GANTT), 450
needed in displaying decision tree diagram, 353
suppress page number (GANTT), 446
pattern specication
GANTT procedure, 448, 464
NETDRAW procedure, 625, 626
pattern selection guide, 468
table of assignments (GANTT), 465
PATTERN variable
Network data set (NETDRAW), 602, 606, 620,
622, 625
Schedule data set (GANTT), 439, 447, 448, 464,
465
PATTERN variable,
See also PATTERN variable
Network data set (NETDRAW), 602, 606, 616,
620, 625
Schedule data set (GANTT), 448, 465, 560, 563
Payoff data set
DTREE procedure, 306, 325, 343, 344
example, 308
redundant observations, 385
variables, 342, 343
payoffs
decision tree model, 344
different from rewards, 344
warning if unassigned, 326
PAYOFFS variables,
See VALUE variables
PCTCOMP variable
Activity data set (CPM), 84, 122, 203
PCT
COMP variable
Schedule data set (CPM), 83
percent complete, 84, 122
PERIOD variable
Resource data set (CPM), 99, 108, 126
petroleum distributors decision problem, 394
placement of activity text (GANTT), 441, 442
placement of ID variables (NETDRAW), 614
PM examples
adding subtasks, 728
baseline schedules, 731
new project, 723
PM procedure
activity numbers, 718
add activities, 712
details, 719
edit project, 711
Gantt View, 706
MDBTOPM Macro, 722
MP2KTOPM Macro, 722
ORCPM
macro variable, 22
overview, 22, 695
PM Window, 699
preferences data set, 721
progress updating, 721
progress variables, 721
850
Subject Index
Project data set, 721
project hierarchy, 702
Schedule data set, 719
Table View, 703
TIMENOW macro variable, 721
PM Window, 699
activity numbers, 718
add activities, 712
add subtasks, 714
alignment constraints, 715
baseline schedule, 712, 715
calendar information, 715
copy activities, 714
delete activities, 714
delete precedence constraints, 715
edit durations, 714
lters, 716
Gantt View, 706
milestones, 714
PM procedure, 699
print options, 719
print preview, 719
printing, 718
progress information, 713
project font, 717
project preferences, 716
resource requirements, 715
saving printed output, 719
sorting activities, 717
Table View, 703
user interface features, 700
PNTID variable
Schedule data set (PM), 720
pop-up menu
alignment constraints, 705
arc, 700, 710
calendar, 705
Gantt View, 706, 708
increment, 707
major axis, 707
minor axis, 707
scale, 708
schedule bar, 708
Table View, 703
target type, 705
task information, 709
Time Axis, 706
units, 708
PRATCVAL variable
PROJECT data set (PM), 721
PRATNVAL variable
PROJECT data set (PM), 721
precedence connections
color, 439
GANTT procedure, 473
line style, 444
line width, 450
Precedence data set, 411, 412, 423, 436, 449, 453, 474
graphics example (GANTT), 549
linking to Schedule data set, 474
precedence diagramming method,
See Activity-on-Node
precedence information, 436, 441, 443, 444, 449
precedence relationships
CPM procedure, 108, 109
GANTT procedure, 411, 412, 473475, 477
480
scheduling subject to, 106, 107
preference, DTREE procedure, 349
print options
PM Window, 719
print preview
PM Window, 719
printing
PM Window, 718
PROB variables
Probability data set (DTREE), 342
PROB variables,
See also PROB variables
Probability data set (DTREE), 342
probabilities
decision tree model, 305
do not sum to 1, 323
on decision tree diagram, 323, 324, 338
scaled by DTREE procedure, 323
warning when rescaled, 326
Probability data set
DTREE procedure, 305, 325, 343, 344, 346
example, 308
variables, 341, 342
problem size specication
CPM procedure, 154
number of activities (CPM), 79
number of adjacencies (CPM), 79
resource requirement array (CPM), 80
size of symbolic table (CPM), 79
utility data sets (CPM), 79, 154
progress information
Gantt View, 711
PM Window, 713
Table View, 705
progress updating
allow nonzero oat, 84, 124
automatic updating of progress information, 83,
123, 203, 204, 698
CPM procedure, 122124
current time, 84, 122
estimate percent completion time, 83, 699
example (CPM), 201
interrupt activities in progress, 85, 124
PM procedure, 721
resource allocation during, 136, 137
specifying information, 8284
progress variables, 122
CPM procedure, 82, 122124
PM procedure, 721
PROJATTR variable
PROJECT data set (PM), 721
Subject Index
851
PROJ
DUR variable
Schedule data set (CPM), 149
project
cost control, example, 49
denition, 17, 66
nish date, 78, 106, 107, 162
graphical representation, 585
introductory example, 26, 68
multiple projects, 38, 47
network diagram, example, 26
resource-constrained schedule, 34
schedule comparison, 87
scheduling and reporting, 30
start date, 77, 106, 158, 162
summary, 32
work breakdown structure (WBS) example, 29
project cost control, 49
ACWP, 50
BCWP, 50
BCWS, 50
denition of measures, 50
example, 49
plot of measures, 55
Project data set
PM procedure, 721
project deadlines,
See deadlines
project font
PM Window, 717
project hierarchy
PM procedure, 702
project management
decision analysis in, 17
examples, 26
introduction, 1725, 61
scheduling example, 31, 34
project management systems, 60
project monitoring
using baseline schedule, 521
project preferences
PM Window, 716
pull-down menu, 717, 718
project progress,
See also progress updating
measuring using baseline schedule, 521
PROJECT variable
Activity data set (CPM), 90, 146
Schedule data set (CPM, 149
PROJ
LEV variable
Schedule data set (CPM), 149
Projman
accessing reports, 755
application options, 752
calendar report options, 788
calendars, 757, 758
editing activities, 754
editing calendars, 755, 757, 758
editing holidays, 755, 759, 760
editing resources, 755, 762, 763
editing workshifts, 755, 768, 769
Gantt chart options, 790
holidays, 759, 760
importing activity data set, 753, 805
importing calendar data set, 758, 812
importing holiday data set, 760, 813
importing projects, 753
importing resourcein data set, 763, 815
importing workshift data set, 769, 816
introduction, 61
network diagram options, 795
overview, 749
project information, 754
project name option, 750
project summary, 755
projman command, 749
Projman window, 750
report macro variables, 785
report options, 779
reports, 777
resource report options, 802
resources, 762, 763
sample projects, 753
scheduling options, 770
tabular listing options, 803
workshifts, 768, 769
proportional compression
Gantt chart, 448
pull-down menu
edit, 712
le, 718
lters, 716
move column, 704
preferences, 717, 718
project, 700
project preferences, 717, 718
set baseline, 713
sort, 717
View, 702, 716
R
R
DELAY variable
Schedule data set (CPM), 95, 113, 213
rectangular corners
decision tree diagram, 332
network diagram, 606
reference lines, 431
automatic at every tick mark, 595
break character, 601
character to represent, 434, 602, 609
color, 439, 602, 604
labels, 431
line style, 444, 605
remaining duration, 84, 122
REMDUR variable
Activity data set (CPM), 84, 203
replenishable resource, 127
rescale probabilities
DTREE procedure, 323
852
Subject Index
warning in DTREE procedure, 326
research and development decision problem, 380
RESID variable
Resource data set (CPM), 100, 126
resource allocation, 126139, 142145,
See also resource allocation control
activity splitting, 135, 136, 236
actual dates, 136, 137
alternate resources, 128, 137, 138, 140, 240
analyzing infeasibilities, 97, 134, 223
auxiliary resources, 141
effect of the TIMENOW option, 137
example (CPM), 211
multiple alternates, 138, 139
negative resource requirements, 131
progress updating, 136, 137
resource availability prole, 129
resource calendars, 263
resource dictionary, 126
resource-driven durations, 135, 140
resource levels, 126
resource priority, 126, 127, 134
resource usage variables, 142
scheduling method, 131134
scheduling rule, 102, 133, 211
secondary scheduling rule, 102, 133
specifying resource requirements, 130, 131
substitutable resources, 128, 137
supplementary levels, 126, 127
supplementary resources, 134
resource allocation control
activity-splitting options, 97, 98, 102
alternate resources, 94, 98, 100
checking levels needed, 97
cutoff date, 102
options related to, 9395, 97, 98, 100, 102
scheduling rules, 102
resource calendars
example (CPM), 263
resource-constrained schedule, 34
example (GANTT), 526
ll pattern for (GANTT), 465
GANTT procedure, 452, 487
split activities, 452, 488
treatment of SEGMT
NO variable (GANTT),
488
resource-constrained schedule bar
height, 448
offset, 449
resource constraints,
See resource allocation
Resource data set
alternate resource specication, 137
CPM procedure, 65, 80, 126, 211
missing values, 152
multiple alternates, 139
observation type, 99
resource specication example (CPM), 129
variables, 126, 150
resource-driven durations, 103, 113, 125
and resource allocation (CPM), 135
CPM procedure, 140
example (CPM), 263, 295
resource infeasibilities, 97, 134, 223, 225, 230, 233
resource requirements
PM Window, 715
specifying, CPM procedure, 130, 131
Table View, 705
Resource Schedule data set
CPM procedure, 66, 81
resource type
consumable, 127, 211
replenishable, 127
resource usage,
See also Usage data set
CPM procedure, 126, 143
cumulative usage, 95, 143
cumulative usage example, 218, 219, 226
daily usage, 143
example of reports, 208
variables in Usage data set, 142
RESOURCE variables
Activity data set (CPM), 93, 130
example (CPM), 207
Resource data set (CPM), 93, 126
Resource Schedule data set (CPM), 145
REW variables,
See also REWARD variables
Stage data set (DTREE), 340
REWARD variables
Stage data set (DTREE), 340, 344, 345
rewards
decision tree model, 344
different from payoffs, 344
label on decision tree diagram, 324
modifying, 336
on decision tree diagram, 323, 338
risk, 350
risk averse, 363, 365
risk aversion
coefcient, 350
DTREE procedure, 350
risk tolerance
DTREE procedure, 312, 350
estimation, 350
example (DTREE), 363, 365
specifying, 312, 325, 351
RLABEL variable
Label data set (GANTT), 485, 486
rotating the network diagram, 585, 607, 613, 618, 621,
686
used for top-down trees, 618, 621
rounded corners
decision tree diagram, 332
network diagram, 606
rows in Gantt chart
between activities, 432, 487
R
RATE variable
Subject Index
853
Resource Schedule data set (CPM), 146
RSCHEDID variables
Activity data set (CPM), 101
Resource Schedule data set (CPM), 101
RT,
See risk tolerance
S
SAS catalogs,
See graphics catalog
SAS data sets,
See also input data sets
See also output data sets
CPM procedure, 65, 66
DTREE procedure, 305307, 343
GANTT procedure, 411, 412
NETDRAW procedure, 583
PM procedure, 22
used to model project information, 17
SAS date, time, and datetime values
CPM procedure, 78, 107, 108, 119, 153
SAT
variable
Calendar data set (CPM), 117
saving printed output
PM Window, 719
scenario of decision tree, 305, 338
schedule
character string to represent duration (GANTT),
433
character string to represent times (GANTT),
434
ll patterns to represent duration (GANTT), 465
variables format (GANTT), 453
schedule bar
height, 437
offset, 437
schedule computation
nish milestone, 111
multiproject, 148
nonstandard precedence constraints, 109
progress updating, 123, 124
resource constraints, 131134
standard precedence constraints, 106
time constraints, 110, 111
Schedule data set
as input to NETDRAW procedure, 609
CPM procedure, 65, 68, 80, 113115, 138
direct specication of schedule data (GANTT),
528
GANTT procedure, 411, 412, 422, 451
generated by PROC CPM, 411, 412, 451, 473,
475
linking to Precedence data set, 474
multiproject, 149
options to control, 77, 82, 9597, 99, 101103
PM procedure, 719
progress variables, 124, 721
resources used, 138, 244
sort variables, 91, 92, 149, 255
treatment of
DUR
NO variable (GANTT),
452, 488
treatment of start times, 452
variables, 70, 113115, 124, 136, 138
schedule information,
See Schedule data set
scheduling
around weekends and holidays, 70, 167, 171,
174, 179
multiple projects, example, 39, 49
projects, example, 31
resource-constrained, example, 34
rule for breaking ties, 102
rule for ordering activities, 102, 133, 134
sequential scheduling of multiple projects, 47
serial parallel method, CPM procedure, 131, 133
secondary levels of resource
CPM procedure, 134
segments,
See activity splitting
SEGMT
NO variable
Schedule data set (CPM), 115, 136, 238
Schedule data set (GANTT), 448, 452, 488, 529,
563
SEQ
variable
Layout data set (NETDRAW), 616
Network data set (NETDRAW), 610, 617
serial-parallel scheduling method
CPM procedure, 131, 133
S
FINISH variable
Network data set (NETDRAW), 597, 611, 614
Schedule data set (CPM), 113, 114, 136
Schedule data set (GANTT), 431, 434, 451, 453
SFINMILE variable
Schedule data set (CPM), 112
shift variables,
See Workday data set, shift variables
shifts,
See break and shift information
slack duration, 433
ll patterns for (GANTT), 465
slack time,
See oat
smallest identiable time unit, 430, 455
default values, 456
example (GANTT), 508
number of columns representing, 431, 455
time axis labeling corresponding to, 456
sort variables
Schedule data set (CPM), 91, 92, 149, 255
sorting activities
PM Window, 717
spacing between
activity plots, 432
ID columns, 426
854
Subject Index
nodes, 601
time axis labels, 429
two successive end nodes, 326
special symbol table
DTREE procedure, 333, 334
GANTT procedure, 450
split activities,
See activity splitting
split character for ID labels, 424
split ID column headings, 424
split labels
Labeling facility (GANTT), 443
SQUARE, special symbol table
DTREE procedure, 334
SS
ASC variable
Schedule data set (CPM), 91, 92
SS
DESC variable
Schedule data set (CPM), 91
S
START variable
Network data set (NETDRAW), 597, 611, 614
Schedule data set (CPM), 113, 114, 136
Schedule data set (GANTT), 431, 434, 451, 453
Stage data set
DTREE procedure, 305, 325, 343345, 348
example, 307
variables, 340, 341
stage name
on decision tree diagram, 323, 338
stage type
modifying, 336
STAGE variable
Stage data set (DTREE), 340
stages
chance, 305
decision, 305
decision tree model, 305
end, 305
name, 305
order, 337, 348
outcomes, 305
type, 305, 336
start times
format of, 453
interpretation of, CPM procedure, 107
treatment of, 452
START variable
Activity data set (CPM), 89
STAT variables,
See also STATE variables
Payoff data set (DTREE), 342
STATE variables
Payoff data set (DTREE), 342
statement order
DTREE procedure, 347
status ags, 426
displaying on multiple pages, 489
STATUS variable
Network data set (NETDRAW), 614
Resource Schedule data set (CPM), 146
Schedule data set (CPM), 113, 114, 124, 203,
600
STNAME
variable,
See also STAGE variable
Stage data set (DTREE), 340
straight-line utility function, 325
STTYPE
variable,
See also TYPE variable
Stage data set (DTREE), 341
style of lines,
See line style specication
subcontracting decisions, 57
subprojects,
See also multiproject scheduling
individual critical paths for (CPM), 92
ordering activities within (CPM), 91, 92
substitutable resources,
See alternate resources
SUCC variables,
See also SUCCESSOR variables
Stage data set (DTREE), 341
SUCCESSOR variables
Activity data set (CPM), 103
Network data set (NETDRAW), 600, 610
Precedence data set (GANTT), 443, 449, 474
Schedule data set (GANTT), 449
Stage data set (DTREE), 341
SUCCID variable
Schedule data set (PM), 720
summary of Gantt chart symbols, 432, 487, 496
SUN
variable
Calendar data set (CPM), 117
supercritical activities
denition of, 107, 111
example of, 201
ll pattern for duration of (GANTT), 465
ll pattern for slack time of (GANTT), 465
GANTT procedure, 426, 434
node pattern (NETDRAW), 625
supplementary resources
CPM procedure, 134
example (CPM), 218
innite levels, 223
SUPPL
R variable
Schedule data set (CPM), 95, 113, 213
S
VAR variable
Schedule data set (CPM), 87, 203, 233
symbol specication
chance nodes (DTREE), 332, 333
controlling the appearance of decision tree, 354
decision nodes (DTREE), 333
DTREE procedure, 330334
end nodes (DTREE), 333, 334
example (DTREE), 380, 382
GANTT procedure, 464, 468
identifying symbols for links on decision tree,
330
identifying symbols for nodes on decision tree,
332, 333
Subject Index
855
milestones (GANTT), 449
project management fonts, 473
special symbol table, 471
symbols for project management and decision analy-
sis, 471
syntax skeleton
CPM procedure, 72
DTREE procedure, 319
GANTT procedure, 416
NETDRAW procedure, 590
T
table of syntax elements,
See functional summary
Table View, 703
add tasks, 703
collapse supertasks, 705
column, change order, 704
column, change width, 704
delete tasks, 703
edit alignment constraints, 704
edit calendars, 705
edit durations, 704
expand supertasks, 705
hide tasks, 706
move tasks, 706
PM procedure, 703
PM Window, 703
pop-up menu, 703
progress information, 705
resource requirements, 705
target date, 704
target type, 704
time constraints, 704
TAIL variable
Activity data set (CPM), 104
Schedule data set (GANTT), 449, 473
target completion dates,
See deadlines
target date
Table View, 704
target schedule,
See baseline schedule
target type
Table View, 704
target variables,
See CHART variables
task axis,
See activity axis
task information dialog box, 702
text
color (DTREE), 328
color (GANTT), 439
color (NETDRAW), 604
font (DTREE), 329
font (GANTT), 440
font (NETDRAW), 604
font baseline (activity), 442
height (DTREE), 329
height (GANTT), 441
height (NETDRAW), 604
height, graphics example (GANTT), 539
maximum allowable height, 441
placement (GANTT), 442
placement, graphics example (GANTT), 539
T
FLOAT variable
Network data set (NETDRAW), 597, 611, 614
Schedule data set (CPM), 70, 102, 113, 114
thickness of lines,
See line width specication
THU
variable
Calendar data set (CPM), 117
tickmark label
suppress time portion, 446
tickmarks
limiting the number on rst page (GANTT), 447
time axis
altering range, graphics example (GANTT), 511
color, 438
extension of, 476
format (Gantt View), 707
formatting, 430, 432, 600, 618, 619, 679
GANTT procedure, 410, 456, 464
increments on, 429, 456
inter-label spacing, 429
labeling, 456, 457
largest time value, 430
maximum and minimum values, 595
NETDRAW procedure, 618, 619
scaling, 598, 618, 619
show break in, 599
smallest interval represented, 598
smallest time value, 430
suppress extension of, 446, 476
suppress printing, 599
suppress printing on every page, 598
units (Gantt View), 708
time-constrained scheduling
CPM procedure, 85, 107, 110, 111
example (CPM), 199
time constraints
activity align dates (CPM), 85, 199
activity align dates (PM), 704
activity align types (CPM), 85, 199
activity align types (PM), 704
x nish time (CPM), 78
Mandatory Finish, MF, 111, 201
Mandatory Start, MS, 111, 201
project nish date (CPM), 78, 107
project start date (CPM), 77, 106
scheduling subject to, 110, 111
Table View, 704
time increment
Gantt View, 707
time scale
Gantt View, 707
TIME
variable
856
Subject Index
Usage data set (CPM), 94, 9799, 101, 102, 142,
143, 145
time-scaled network diagrams, 584, 588, 618, 652,
655
default ALIGN variable, 618
spacing of nodes, 619
tick marks, 618
TIMENOW, 84,
See also progress updating
allow activity splitting at, 85
macro variable (PM), 721
timenow line, 426, 432
character for drawing, 435
color, 440
line style, 444
line width, 450
produced by COMBINE, 426, 488
produced by COMBINE, example (GANTT),
524
suppress label, 430
TO
variable
Layout data set (NETDRAW), 616
Network data set (NETDRAW), 600
top-down hierarchical diagram, 607
total oat,
See oat, total
total probability
DTREE procedure, 323
is not equal to 1, 323
tree diagrams
NETDRAW procedure, 584, 621, 674
TUE
variable
Calendar data set (CPM), 117
turning points
Logic Gantt charts, 474, 476
type of lines,
See line style specication
TYPE variable
Stage data set (DTREE), 341
U
unassigned payoffs
warning in DTREE procedure, 326
uncertain factor
represented as chance stage, 305
uncertainty, decision tree model, 305, 349
unconditional probability
DTREE procedure, 306
unit of measure, global graphics options
DTREE procedure, 326
units of duration
CPM procedure, 70
units of vertical space
DTREE procedure, 326
graphics version (DTREE), 326
line-printer version, 326
Usage data set
CPM procedure, 66, 80, 142, 143, 207, 208
description, 142, 143
GPLOT example, 37
options, 93101
rate of usage, 94, 102
resource usage and availability prole, 143, 144
total usage, 94, 102
variables, 142, 143, 145
user interface features
PM Window, 700
utility, 349
utility curve, 323, 349
utility function
DTREE procedure, 312, 349
exponential, 312, 323, 349351
straight-line, 325, 349
utility value, 349
UTILITY variables,
See VALUE variables
V
vacations,
See holidays
VALU variables,
See also VALUE variables
Payoff data set (DTREE), 343
value of imperfect information,
See value of sample information
value of perfect control, 314, 343
evaluating, 306, 314, 389, 390
misleading, 390
oil wildcatters decision problem, 314
value of perfect information, 313, 343
evaluating, 306, 313, 314, 348, 388
misleading, 389
oil wildcatters decision problem, 313
value of sample information, 317
evaluating, 318
VALUE variables
Payoff data set (DTREE), 343
variables
format of (CPM), 153
format of (GANTT), 453
list of, CPM procedure, 150
list of, DTREE procedure, 340
list of, GANTT procedure, 453
list of, NETDRAW procedure, 610, 611
treatment of missing values (CPM), 152
treatment of missing values (DTREE), 347
treatment of missing values (GANTT), 453
treatment of missing values (NETDRAW), 611
vertical space
around margin (NETDRAW), 607, 652
between activities (GANTT), 432, 487
between nodes (NETDRAW), 601, 613, 640
between two end nodes (DTREE), 326
units (DTREE), 326
View pull-down menu, 702
W
warning
Subject Index
857
suppress displaying (CPM), 81
suppress displaying (DTREE), 326, 345
WBS, 29, 92
WBS
CODE variable
Schedule data set (CPM), 92
Web-enabled decision tree, 330, 341, 356
Web-enabled Gantt charts, 423, 450, 486
graphics example (GANTT), 566
Web-enabled network diagram, 594, 608, 626
WEB variable
Imagemap data set (DTREE), 330
Imagemap data set (GANTT), 423
Network data set (NETDRAW), 608
Schedule data set (GANTT), 450, 486, 567
Stage data set (DTREE), 341, 356
WED
variable
Calendar data set (CPM), 117
weekends and non-worked days,
See also break and shift information
displaying, 430, 458
scheduling around, 70
width of lines,
See line width specication
work breakdown structure, 29, 584
work pattern, 411,
See also break and shift information
See also weekends and non-worked days
work shifts,
See break and shift information
WORK variable
Activity data set (CPM), 103, 125
WORK
variable
Resource Schedule data set (CPM), 146
workday
length of, 78, 107, 116, 117, 172, 427, 458
start of, 78, 107, 116, 117, 172, 427, 458
Workday data set
CPM procedure, 65, 81, 115, 116, 185
GANTT procedure, 411, 422, 424, 457, 458
missing values, 152
shift variables, 116
variables, 150
work shift example (CPM), 116
workshift information,
See Workday data set
X
X variable
Label data set (GANTT), 443, 481, 483, 486
variable
Layout data set (NETDRAW), 616
Network data set (NETDRAW), 610, 617
XOFFSET variable
Label data set (GANTT), 482, 484, 486
XSYS variable
Label data set (GANTT), 483, 486
XVAR variable
Label data set (GANTT), 443, 481, 483, 486,
558
Y
Y variable
Label data set (GANTT), 443, 481483, 486
variable
Layout data set (NETDRAW), 616
Network data set (NETDRAW), 610, 617
YOFFSET variable
Label data set (GANTT), 482, 484, 486, 558
YSYS variable
Label data set (GANTT), 482, 486
Z
zero duration activities,
See milestones
zone line
color, 440
line style, 444
line width, 450
ZONE variable
Network data set (NETDRAW), 601, 610, 617
Schedule data set (GANTT), 450, 489, 565
zoned Gantt charts
display ZONE variable only for new zones, 447
graphics example (GANTT), 565
line offset, 451
line span, 451
suppress ZONE variable column, 447
ZONE Variable, 450
zoned network diagrams, 584, 620, 659
858
Subject Index
Syntax Index
A
ABARHT= option
CHART statement (GANTT), 436, 463
ABAROFF= option
CHART statement (GANTT), 436
ACT statement,
See ACTIVITY statement
ACT= option,
See ACTIVITY= option
ACTDELAY= option
RESOURCE statement (CPM), 93, 134, 230
ACTION= option
VARIABLES statement (DTREE), 342
ACTIVITY statement
CPM procedure, 67, 82, 156
ACTIVITY= option
ACTNET statement (NETDRAW), 595, 628
CHART statement (GANTT), 416, 436, 474,
540
ACTIVITYPRTY= option
RESOURCE statement (CPM), 93
ACTNET statement (NETDRAW), 595
full-screen options, 601, 602
general options, 595601
graphics options, 602608
line-printer options, 608, 609
ACTPRTY keyword
SCHEDRULE= option (CPM), 102, 133
ACTPRTY= option,
See ACTIVITYPRTY= option
ACTUAL keyword
COMPARE= option (CPM), 87
PATLEVEL= option (GANTT), 447
SET= option (CPM), 87
UPDATE= option (CPM), 87
ACTUAL statement
CPM procedure, 82, 201
ADATE statement,
See ALIGNDATE statement
ADDACT option
PROC CPM statement, 77
PROC PM statement, 698
ADDALLACT option,
See ADDACT option
ADDCAL option
RESOURCE statement (CPM), 93
ADDWBS option,
See WBSCODE option
AF= option,
See A
FINISH= option
A
FINISH= option
ACTUAL statement (CPM), 83, 203
CHART statement (GANTT), 425, 519, 528
AFTER keyword
MOVE statement (DTREE), 337
AGGREGATEPARENTRES option
PROJECT statement (CPM), 91
AGGREGATEP
RES option,
See AGGREGATEPARENTRES option
AGGREGPR option,
See AGGREGATEPARENTRES option
ALAGCAL= option
SUCCESSOR statement (CPM), 103, 197
ALIGN statement,
See ALIGNTYPE statement
ALIGN= option
ACTNET statement (NETDRAW), 595, 618,
654
ALIGNDATE statement
CPM procedure, 85, 199
ALIGNTYPE statement
CPM procedure, 85, 199
ALL keyword
CTEXTCOLS= option (GANTT), 439
DISPLAY= option (DTREE), 323
PATLEVEL= option (GANTT), 447
ZONESPAN= option (GANTT), 451
ALL option,
PROJECT statement (CPM), See ORDERALL
option
RESOURCE statement (CPM), 93, 142
ALTBEFORESUP option
RESOURCE statement (CPM), 94, 244
ALTPRTY keyword
OBSTYPE variable (CPM), 99, 100, 127, 128,
137
ALTRATE keyword
OBSTYPE variable (CPM), 99, 100, 127, 128,
137
ANNO= option,
See ANNOTATE= option
ANNOTATE= option
ACTNET statement (NETDRAW), 602
CHART statement (GANTT), 437
PROC DTREE statement, 327, 382
PROC GANTT statement, 421, 552
860
Syntax Index
PROC NETDRAW statement, 594, 679
TREEPLOT statement (DTREE), 339
AOA option
CHART statement (GANTT), 437, 474
APPEND option
RESOURCE statement (CPM), 94
APPENDINTXRATE option,
See APPEND option
APPENDRATEXINT option,
See APPEND option
APPENDUSAGE option,
See APPEND option
AROUTCAL= option
RESOURCE statement (CPM), 94, 142
ARROWHEAD= option
ACTNET statement (NETDRAW), 602
AS= option,
See A
START= option
A
START= option
ACTUAL statement (CPM), 83, 203
CHART statement (GANTT), 425, 519, 528
ATYPE statement,
See ALIGNTYPE statement
AUTOREF option
ACTNET statement (NETDRAW), 595, 654,
661
AUTOSCALE option
PROC DTREE statement, 323
AUTOUPDT option
ACTUAL statement (CPM), 83, 123, 204
ACTUAL statement (PM), 698
AUTOZONE option
ACTNET statement (NETDRAW), 596
AUXRES keyword
OBSTYPE variable (CPM), 99, 100, 127, 128,
141
AVL option,
See AVPROFILE option
AVP option,
See AVPROFILE option
AVPROFILE option
RESOURCE statement (CPM), 94, 142, 225
AWAITDELAY option
RESOURCE statement (CPM), 94
B
BARHT= option
CHART statement (GANTT), 437, 440, 463
BAROFF= option
CHART statement (GANTT), 437, 440, 463
BASELINE keyword
PATLEVEL= option (GANTT), 447
BASELINE statement
CPM procedure, 86, 201
BBARHT= option
CHART statement (GANTT), 437
BBAROFF= option
CHART statement (GANTT), 437
BEFORE keyword
MOVE statement (DTREE), 337
BETWEEN= option
CHART statement (GANTT), 426, 496
BF= option,
See B
FINISH= option
B
FINISH= option
BASELINE statement (CPM), 86
CHART statement (GANTT), 426
BJUST option,
See BOTTOM option
BOTTOM option
CHART statement (GANTT), 438, 449
BOTTOMUP keyword
CHILDORDER= option (NETDRAW), 596
BOXHT= option
ACTNET statement (NETDRAW), 596, 613,
647
BOXWIDTH= option
ACTNET statement (NETDRAW), 596, 613,
640
BREAKCYCLE option
ACTNET statement (NETDRAW), 596, 666
BRKCHAR= option
ACTNET statement (NETDRAW), 601, 608
BS= option,
See B
START= option
B
START= option
BASELINE statement (CPM), 86
CHART statement (GANTT), 426
BY statement
GANTT procedure, 424, 455, 473, 531, 535
C
CA= option,
See CAXIS= option
CACTTEXT= option,
See CTEXTCOLS= option
CALEDATA= option
PROC CPM statement, 77
PROC GANTT statement, 422, 426, 518
CALENDAR keyword
OBSTYPE variable (CPM), 99, 127, 128
CALENDAR= option,
See CALEDATA= option
CALID statement
CPM procedure, 88, 188
CALID= option
CHART statement (GANTT), 422, 426, 518
CARCS= option
ACTNET statement (NETDRAW), 601, 602,
633, 634
CAXES= option,
See CAXIS= option
CAXIS= option
ACTNET statement (NETDRAW), 601, 602,
661
CHART statement (GANTT), 438, 505
CB= option,
See CBEST= option
Syntax Index
861
CBEST= option
PROC DTREE statement, 327
TREEPLOT statement (DTREE), 339
CC= option,
See CSYMBOLC= option
CCNODEFILL= option
ACTNET statement (NETDRAW), 603
CCRITARCS= option
ACTNET statement (NETDRAW), 601, 603,
634
CCRITOUT= option
ACTNET statement (NETDRAW), 603, 625,
634
CD= option,
See CSYMBOLD= option
CE= option,
See CSYMBOLE= option
CELL units
YBETWEEN= option (DTREE), 326
CENTERID option
ACTNET statement (NETDRAW), 603, 666
CENTERSUBTREE option
ACTNET statement (NETDRAW), 596, 621,
677
CFR= option,
See CFRAME= option
CFRAME= option
CHART statement (GANTT), 438, 505, 511
CHANCE keyword
TYPE variable (DTREE), 341
CHART statement (GANTT), 424
full-screen options, 432
general options, 424
graphics options, 435
line-printer options, 432
CHARTPCT= option,
See CHARTWIDTH= option
CHARTWIDTH= option
CHART statement (GANTT), 438
CHCON= option
CHART statement (GANTT), 433, 438, 519
CHILDORDER= option
ACTNET statement (NETDRAW), 596
CL= option,
See CLINK= option
CLINK= option
PROC DTREE statement, 327
TREEPLOT statement (DTREE), 339
CM units
YBETWEEN= option (DTREE), 326
CMILE= option
CHART statement (GANTT), 427, 438, 505,
508
CNODEFILL= option
ACTNET statement (NETDRAW), 603
COLLAPSE option
PROC CPM statement, 77, 195, 411, 423
COLORS= option, GOPTIONS statement
GANTT procedure, 438440, 463
NETDRAW procedure, 604
COMBINE option
CHART statement (GANTT), 426, 473, 488,
524
COMPARE= option
BASELINE statement (CPM), 87, 203
COMPRESS option
ACTNET statement (NETDRAW), 603, 636
CHART statement (GANTT), 411, 439, 442,
450, 463, 489, 507, 511
PROC DTREE statement, 327
TREEPLOT statement (DTREE), 339, 378, 382,
399
COST= option,
See REWARD= option
COUTLINE= option
ACTNET statement (NETDRAW), 603, 625,
634
CP option,
See COMPRESS option
CPATTERN= option, GOPTIONS statement
GANTT procedure, 467
CPATTEXT= option,
See CTEXTCOLS= option
CPM procedure, 72
ACTIVITY statement, 67, 82
ACTUAL statement, 82, 201
ALIGNDATE statement, 85, 199
ALIGNTYPE statement, 85, 199
BASELINE statement, 86, 201
CALID statement, 88, 188, 192
DURATION statement, 67, 88
HEADNODE statement, 67, 89
HOLIDAY statement, 89
ID statement, 90, 412
PROC CPM statement, 77
PROJECT statement, 90
RESOURCE statement, 93, 207
SUCCESSOR statement, 67, 103
TAILNODE statement, 67, 104
CPREC= option
CHART statement (GANTT), 439, 540, 549
CR keyword
DISPLAY= option (DTREE), 323
CREF= option
ACTNET statement (NETDRAW), 602, 604,
654
CHART statement (GANTT), 431, 439, 511
CREFBRK= option
ACTNET statement (NETDRAW), 602, 604,
655
CRITERION= option
EVALUATE statement (DTREE), 336
PROC DTREE statement, 323, 371, 382
RESET statement (DTREE), 363
CRITFLAG option
CHART statement (GANTT), 426, 489, 496
CSYMBOL= option, GOPTIONS statement
GANTT procedure, 470
862
Syntax Index
CSYMBOLC= option
PROC DTREE statement, 327
TREEPLOT statement (DTREE), 339
CSYMBOLD= option
PROC DTREE statement, 328
TREEPLOT statement (DTREE), 339
CSYMBOLE= option
PROC DTREE statement, 328
TREEPLOT statement (DTREE), 339
CT= option,
See CTEXT= option
CTEXT= option
ACTNET statement (NETDRAW), 604
CHART statement (GANTT), 439, 463, 484,
505
PROC DTREE statement, 328
TREEPLOT statement (DTREE), 339
CTEXT= option, GOPTIONS statement
GANTT procedure, 439, 463
NETDRAW procedure, 604
CTEXTCOLS= option
CHART statement (GANTT), 439
CTNOW= option
CHART statement (GANTT), 432, 440, 522,
525
CUMUSAGE option
RESOURCE statement (CPM), 95, 144, 218
CURRDATE= option,
See TIMENOW= option
CZLINE= option,
See CZONE= option
CZONE= option
CHART statement (GANTT), 440, 451, 565
D
DATA= option
PROC CPM statement, 77, 158
PROC GANTT statement, 422, 426
PROC NETDRAW statement, 594, 628
DATE statement,
See ALIGNDATE statement
DATE= option
PROC CPM statement, 77, 106, 158
DAY keyword
INTERVAL= option (CPM), 79
INTERVAL= option (GANTT), 429, 458
MININTERVAL= option (GANTT), 456
MININTERVAL= option (NETDRAW), 598
PADDING= option (GANTT), 430, 455
ROUTINTERVAL= option (CPM), 101
DAYLENGTH= option
CHART statement (GANTT), 427, 458
PROC CPM statement, 78, 107, 171
DAYSTART= option
CHART statement (GANTT), 427, 458
PROC CPM statement, 78, 171
DECISION keyword
TYPE variable (DTREE), 341
DELAY= option
RESOURCE statement (CPM), 95, 134, 218
DELAYANALYSIS option
RESOURCE statement (CPM), 95, 113, 211
DELAYLST keyword
SCHEDRULE= option (CPM), 102, 133
DES= option,
See DESCRIPTION= option
DESC option,
See DESCENDING option
DESCENDING option
PROJECT statement (CPM), 91
DESCRIPTION= option
ACTNET statement (NETDRAW), 604
CHART statement (GANTT), 440
PROC DTREE statement, 328
TREEPLOT statement (DTREE), 339
DISPLAY= option
PROC DTREE statement, 323
TREEPLOT statement (DTREE), 339
DOANNO option,
See DOANNOTATE option
DOANNOTATE option
PROC DTREE statement, 328
TREEPLOT statement (DTREE), 339
DP option
ACTNET statement (NETDRAW), 596, 613,
648
DRAIN keyword
ERRHANDLE= option (DTREE), 324
DTDAY keyword
INTERVAL= option (CPM), 79
INTERVAL= option (GANTT), 429, 458
MININTERVAL= option (GANTT), 456
ROUTINTERVAL= option (CPM), 101
DTHOUR keyword
INTERVAL= option (CPM), 79
INTERVAL= option (GANTT), 429, 458
MININTERVAL= option (GANTT), 456
PADDING= option (GANTT), 430, 455
ROUTINTERVAL= option (CPM), 101
DTMINUTE keyword
INTERVAL= option (CPM), 79
INTERVAL= option (GANTT), 429, 458
MININTERVAL= option (GANTT), 456
PADDING= option (GANTT), 430, 455
ROUTINTERVAL= option (CPM), 101
DTMONTH keyword
INTERVAL= option (CPM, 107
INTERVAL= option (CPM), 79
MININTERVAL= option (GANTT), 456
PADDING= option (GANTT), 430, 455
ROUTINTERVAL= option (CPM), 101
DTQTR keyword
INTERVAL= option (CPM, 107
INTERVAL= option (CPM), 79
MININTERVAL= option (GANTT), 456
PADDING= option (GANTT), 430, 455
ROUTINTERVAL= option (CPM), 101
DTREE procedure, 319
Syntax Index
863
EVALUATE statement, 336
MODIFY statement, 336
MOVE statement, 337
PROC DTREE statement, 323
QUIT statement, 337
RECALL statement, 337
RESET statement, 337
SAVE statement, 337
SUMMARY statement, 338
TREEPLOT statement, 338
VARIABLES statement, 339
VPC statement, 343
VPI statement, 343
DTSECOND keyword
INTERVAL= option (CPM), 79
INTERVAL= option (GANTT), 429, 458
MININTERVAL= option (GANTT), 456
PADDING= option (GANTT), 430, 455
ROUTINTERVAL= option (CPM), 101
DTWEEK keyword
INTERVAL= option (CPM, 107
INTERVAL= option (CPM), 79
MININTERVAL= option (GANTT), 456
PADDING= option (GANTT), 430, 455
ROUTINTERVAL= option (CPM), 101
DTWRKDAY keyword
INTERVAL= option (CPM), 79, 107
INTERVAL= option (GANTT), 429, 458
ROUTINTERVAL= option (CPM), 101
DTYEAR keyword
INTERVAL= option (CPM, 107
INTERVAL= option (CPM), 79
MININTERVAL= option (GANTT), 456
PADDING= option (GANTT), 430, 455
ROUTINTERVAL= option (CPM), 101
DUPOK option
CHART statement (GANTT), 427, 451
DUR statement,
See DURATION statement
DUR= option,
GANTT, See DURATION= option
DURATION statement
CPM procedure, 67, 88, 156
DURATION= option
ACTNET statement (NETDRAW), 596, 630
CHART statement (GANTT), 427, 430, 453,
455, 504, 505, 529
E
EARLY keyword
COMPARE= option (CPM), 87
PATLEVEL= option (GANTT), 447
SET= option (CPM), 87
UPDATE= option (CPM), 87
EBARHT= option
CHART statement (GANTT), 440
EBAROFF= option
CHART statement (GANTT), 440
EF= option,
See E
FINISH= option
E
FINISH= option
CHART statement (GANTT), 428
END keyword
TYPE variable (DTREE), 341
ERRHANDLE= option
PROC DTREE statement, 324
ES= option,
See E
START= option
ESO option,
See ESORDER option
ESORDER option
PROJECT statement (CPM), 91
ESP option,
See ESPROFILE option
ESPROFILE option
RESOURCE statement (CPM), 95, 142
ESS option,
See ESPROFILE option
E
START option
RESOURCE statement (CPM), 96
E
START= option
CHART statement (GANTT), 428
ESTIMATEPCTC option
ACTUAL statement (CPM), 83
ACTUAL statement (PM), 699
ESTPCTC option,
See ESTIMATEPCTC option
ESTPCTCOMP option,
See ESTIMATEPCTC option
ESTPROG option,
See ESTIMATEPCTC option
EV keyword
DISPLAY= option (DTREE), 323
EVALUATE statement
DTREE procedure, 336
EVENT= option
VARIABLES statement (DTREE), 341, 362
EXCLUNSCHED option
RESOURCE statement (CPM), 96
EXPAND option,
See ADDACT option
F
FBDATE= option
PROC CPM statement, 78, 107, 162
FEQ keyword
ALIGNTYPE variable (CPM), 85
FF keyword
LAG variable (CPM), 104
LAG variable (GANTT), 443
LAG variable (NETDRAW), 597
F
FLOAT option
RESOURCE statement (CPM), 96, 237
FGE keyword
ALIGNTYPE variable (CPM), 85
FILL option
CHART statement (GANTT), 428, 455, 458,
496
864
Syntax Index
FILLMISSING option,
See FILLUNSCHED option
FILLPAGES option
ACTNET statement (NETDRAW), 604
FILLUNSCHED option
RESOURCE statement (CPM), 96
FINISH= option
DURATION statement (CPM), 89
FINISHBEFORE option
PROC CPM statement, 78
FINPAD= option,
See PADDING= option
FIXASTART option
ACTUAL statement (CPM), 83
FIXFINISH option
PROC CPM statement, 78
FLAG keyword
CTEXTCOLS= option (GANTT), 439
FLAG option,
See CRITFLAG option
FLE keyword
ALIGNTYPE variable (CPM), 85
FMILE= option
CHART statement (GANTT), 427, 441, 449,
505
FONT= option,
DTREE, See FTEXT= option
ACTNET statement (NETDRAW), 604, 633
CHART statement (GANTT), 440, 464, 484,
501, 505, 508, 542
FORMCHAR= option
ACTNET statement (NETDRAW), 602, 608
CHART statement (GANTT), 433, 487
PROC DTREE statement, 334
TREEPLOT statement (DTREE), 339
FRAMCLIP keyword
LABRULE= option (GANTT), 443
FRAME option
ACTNET statement (NETDRAW), 597, 654,
657
FROM statement,
See TAILNODE statement
FS keyword
LAG variable (CPM), 104
LAG variable (GANTT), 443
LAG variable (NETDRAW), 597
FS option,
See FULLSCREEN option
FTEXT= option
PROC DTREE statement, 329
TREEPLOT statement (DTREE), 339, 378, 399
FTEXT= option, GOPTIONS statement
GANTT procedure, 440, 464
NETDRAW procedure, 604
FULLSCREEN option
PROC GANTT statement, 410, 422, 458
PROC NETDRAW statement, 585, 594, 622
G
GANTT procedure, 416
BY statement, 424, 473, 531, 535
CHART statement, 424
ID statement, 451, 473, 487, 488, 496, 526
PROC GANTT statement, 421
GIVEN= option
VARIABLES statement (DTREE), 342
GOPTIONS statement
COLORS= option, 438440, 463, 604
CPATTERN= option, 467
CSYMBOL= option, 470
CTEXT= option, 439, 463, 604
FTEXT= option, 440, 464, 604
GUNIT= option, 463
HPOS= option, 463, 487, 625, 633, 640
HTEXT= option, 441, 463
RESET= option, 466, 469
VPOS= option, 442, 463, 625, 633, 640
GOUT= option
PROC DTREE statement, 329
PROC GANTT statement, 422
PROC NETDRAW statement, 594
TREEPLOT statement (DTREE), 339
GRAPHICS option
PROC DTREE statement, 324, 378, 382
PROC GANTT statement, 410, 422, 499
PROC NETDRAW statement, 585, 594, 633
TREEPLOT statement (DTREE), 339, 399
GUNIT= option, GOPTIONS statement
GANTT procedure, 463
H
HBARHT= option
CHART statement (GANTT), 440, 441
HBAROFF= option
CHART statement (GANTT), 440, 441
HBETWEEN= option,
See XBETWEEN= option
HBY option, GOPTIONS statement
GANTT procedure, 531
HCONCHAR= option
CHART statement (GANTT), 433, 444, 487
HCONNECT option
CHART statement (GANTT), 428, 433, 444,
519
HDURATION= option,
See HOLIDUR= option
HEAD statement,
See HEADNODE statement
HEAD= option
CHART statement (GANTT), 441, 473, 542
HEADNODE statement
CPM procedure, 67, 89, 160
HEADNODE= option,
See HEAD= option
HEIGHT= option
ACTNET statement (NETDRAW), 604
CHART statement (GANTT), 441, 442, 463,
539
Syntax Index
865
HMARGIN= option
ACTNET statement (NETDRAW), 604, 652,
664
HMILE= option
CHART statement (GANTT), 427, 442
HOLICHAR= option
CHART statement (GANTT), 429, 430, 433,
434, 487
HOLIDATA= option
PROC CPM statement, 78, 174
PROC GANTT statement, 422, 426, 501
HOLIDAY statement
CPM procedure, 89, 174
HOLIDAY= option,
CPM, See HOLIDATA= option
CHART statement (GANTT), 422, 428, 501,
519
HOLIDAYS statement,
See HOLIDAY statement
HOLIDAYS= option,
See HOLIDAY= option
HOLIDUR= option
CHART statement (GANTT), 429, 512
HOLIDAY statement (CPM), 90, 174
HOLIEND= option,
See HOLIFIN= option
HOLIFIN= option
CHART statement (GANTT), 429, 501, 519
HOLIDAY statement (CPM), 90, 174
HOLINTERVAL= option,
See INTERVAL= option
HOUR keyword
INTERVAL= option (CPM), 79
MININTERVAL= option (GANTT), 456
MININTERVAL= option (NETDRAW), 598
PADDING= option (GANTT), 430, 455
ROUTINTERVAL= option (CPM), 101
HPAGES= option
ACTNET statement (NETDRAW), 604
CHART statement (GANTT), 439, 442, 448,
450, 463, 489, 501, 507
HPOS= option, GOPTIONS statement
GANTT procedure, 463, 487
NETDRAW procedure, 625, 633, 640
HS= option,
See HSYMBOL= option
HSYMBOL= option
PROC DTREE statement, 329
TREEPLOT statement (DTREE), 339, 378, 399
HT= option,
See HTEXT= option
HTEXT= option,
NETDRAW, See HEIGHT= option
PROC DTREE statement, 329
TREEPLOT statement (DTREE), 339, 378
HTEXT= option, GOPTIONS statement
GANTT procedure, 441, 463
HTML= option,
See WEB= option
HTOFF= option
CHART statement (GANTT), 442, 463, 539
HTRACKS= option
ACTNET statement (NETDRAW), 597, 613,
648
I
ID keyword
CTEXTCOLS= option (GANTT), 439
ID statement
CPM procedure, 90, 158, 412
GANTT procedure, 451, 473, 487, 488, 496, 526
ID= option
ACTNET statement (NETDRAW), 597, 613
IDPAGES option
CHART statement (GANTT), 429, 451, 489
IGNOREPARENTRES option
PROJECT statement (CPM), 91
IGNOREPR option,
See IGNOREPARENTRES option
IGNOREP
RES option,
See IGNOREPARENTRES option
IMAGEMAP= option
PROC DTREE statement, 330, 356
PROC GANTT statement, 423, 486
PROC NETDRAW statement, 594
TREEPLOT statement (DTREE), 339
INCH units
YBETWEEN= option (DTREE), 326
INCLUNSCHED option
RESOURCE statement (CPM), 96
INCREMENT= option
CHART statement (GANTT), 429, 456, 496
INDEPALLOC option,
See INDEPENDENTALLOC option
INDEPENDENTALLOC option
RESOURCE statement (CPM), 96, 135
INFEASDIAG option,
See INFEASDIAGNOSTIC option
INFEASDIAGNOSTIC option
RESOURCE statement (CPM), 97, 134, 144,
223
INTERVAL= option
CHART statement (GANTT), 422, 427, 429,
430, 457, 458, 512
PROC CPM statement, 7779, 107, 108, 167
INTPER= option
PROC CPM statement, 79
INTUSAGE option,
See TOTUSAGE option
INTXRATE option,
See TOTUSAGE option
J
JOBNUM keyword
CTEXTCOLS= option (GANTT), 439
JOINCHAR= option
CHART statement (GANTT), 433, 487
866
Syntax Index
L
L= option,
See LSTYLE= option
LABDATA= option
PROC GANTT statement, 423, 481, 485
LABEL option
PROC DTREE statement, 324
TREEPLOT statement (DTREE), 339
LABEL= option,
See LABDATA= option
LABELDATA= option,
See LABDATA= option
LABELSPLIT= option,
See LABSPLIT= option
LABFMT= option,
See LABRULE= option
LABMAXINT= option
PROC GANTT statement, 423, 484
LABRULE= option
CHART statement (GANTT), 443
LABSPLIT= option
CHART statement (GANTT), 443, 557
LABVAR= option
CHART statement (GANTT), 442, 481, 482,
557, 560
LAG= option
ACTNET statement (NETDRAW), 597
CHART statement (GANTT), 443, 474, 540,
549
PROC GANTT statement, 474
SUCCESSOR statement (CPM), 103, 104, 109,
195
LATE keyword
COMPARE= option (CPM), 87
PATLEVEL= option (GANTT), 447
SET= option (CPM), 87
UPDATE= option (CPM), 87
LB= option,
See LSTYLEB= option
LBARHT= option
CHART statement (GANTT), 440
LBAROFF= option
CHART statement (GANTT), 440
LC= option,
See LSTYLEC= option
LEFT keyword
ZONESPAN= option (GANTT), 451
LEFT option
CHART statement (GANTT), 444, 449
LEFTRGHT keyword
CHILDORDER= option (NETDRAW), 596
LEGEND option
PROC DTREE statement, 330
TREEPLOT statement (DTREE), 339
LEVEL= option
CHART statement (GANTT), 440, 444, 474,
540
LF= option,
See L
FINISH= option
L
FINISH= option
CHART statement (GANTT), 429, 529
LFT keyword
SCHEDRULE= option (CPM), 102, 133
LG option,
See LEGEND option
LHCON= option
CHART statement (GANTT), 433, 444, 487,
519
LINEAR option
ACTNET statement (NETDRAW), 597, 618,
657
LINEPRINTER option
PROC DTREE statement, 324
PROC GANTT statement, 410, 423
PROC NETDRAW statement, 594
TREEPLOT statement (DTREE), 339
LINESIZE system option, 455
LINK keyword
DISPLAY= option (DTREE), 323
LINKA= option
PROC DTREE statement, 330
TREEPLOT statement (DTREE), 339, 382
LINKB= option
PROC DTREE statement, 330
TREEPLOT statement (DTREE), 339, 382
LINKC= option
PROC DTREE statement, 330
TREEPLOT statement (DTREE), 339
LJUST option,
See LEFT option
LMI= option,
See LABMAXINT= option
LOSS= option,
See VALUE= option
LP option,
See LINEPRINTER option
LPREC= option
CHART statement (GANTT), 444, 540
LREF= option
ACTNET statement (NETDRAW), 605, 654
CHART statement (GANTT), 431, 444, 487,
511, 549
LREFBRK= option
ACTNET statement (NETDRAW), 605, 655
LS= option,
See L
START= option
LSO option,
See LSORDER option
LSORDER option
PROJECT statement (CPM), 91
LSP option,
See LSPROFILE option
LSPROFILE option
RESOURCE statement (CPM), 97, 142
LSS option,
See LSPROFILE option
LST keyword
SCHEDRULE= option (CPM), 102, 133
Syntax Index
867
L
START option
RESOURCE statement (CPM), 97
L
START= option
CHART statement (GANTT), 429, 529
LSTYLE= option
PROC DTREE statement, 331
TREEPLOT statement (DTREE), 339
LSTYLEB= option
PROC DTREE statement, 331
TREEPLOT statement (DTREE), 339, 378
LSTYLEC= option
PROC DTREE statement, 331
TREEPLOT statement (DTREE), 339
LTHICK= option,
See LWIDTH= option
LTHICKB= option,
See LWIDTHB= option
LTNOW= option
CHART statement (GANTT), 432, 444, 487,
522, 525
LWCRIT= option
ACTNET statement (NETDRAW), 605, 634
LWIDTH= option
ACTNET statement (NETDRAW), 605, 633,
634
CHART statement (GANTT), 431, 444
PROC DTREE statement, 331
TREEPLOT statement (DTREE), 339, 378, 399
LWIDTHB= option
PROC DTREE statement, 332
TREEPLOT statement (DTREE), 339, 378, 399
LWOUTLINE= option
ACTNET statement (NETDRAW), 605
LZLINE= option,
See LZONE= option
LZONE= option
CHART statement (GANTT), 444, 451, 565
M
M= option,
See MAXDEC= option
MARKBREAK option
CHART statement (GANTT), 427, 429, 458,
515
MARKWKND option
CHART statement (GANTT), 429, 430, 458
MAXCE keyword
CRITERION= option (DTREE), 323, 325
MAXDATE= option
CHART statement (GANTT), 430, 432, 446,
476, 511, 515, 518, 531, 545
RESOURCE statement (CPM), 97, 142, 208
MAXDEC= option
PROC GANTT statement, 423, 484
MAXDISLV= option
CHART statement (GANTT), 445, 474, 476,
478, 545, 546
MAXEMPTY= option,
See MAXNULLCOLUMN= option
MAXEV keyword
CRITERION= option (DTREE), 323
MAXIDS option
CHART statement (GANTT), 430, 451
MAXMLV keyword
CRITERION= option (DTREE), 323
MAXNCOL= option,
See MAXNULLCOLUMN= option
MAXNSEG= option,
See MAXNSEGMT= option
MAXNSEGMT= option
RESOURCE statement (CPM), 97, 102, 135
MAXNULLCOLUMN= option
ACTNET statement (NETDRAW), 597, 619
MAXOBS= option
RESOURCE statement (CPM), 98
MAXPREC= option
EVALUATE statement (DTREE), 336
PROC DTREE statement, 324
SUMMARY statement (DTREE), 338
TREEPLOT statement (DTREE), 339
MAXWIDTH= option
EVALUATE statement (DTREE), 336
PROC DTREE statement, 324
SUMMARY statement (DTREE), 338
TREEPLOT statement (DTREE), 339
MAXZCOL= option,
See MAXNULLCOLUMN= option
MF keyword
ALIGNTYPE variable (CPM), 85
MILECHAR= option
CHART statement (GANTT), 427, 434, 487
MILESTONENORESOURCE
RESOURCE statement (CPM), 98
MILESTONERESOURCE
RESOURCE statement (CPM), 98
MINARATE keyword
OBSTYPE variable (CPM), 99, 127, 128, 139
MINCE keyword
CRITERION= option (DTREE), 323, 325
MINDATE= option
CHART statement (GANTT), 430, 446, 476,
511, 515, 518, 531
RESOURCE statement (CPM), 98, 142
MINEV keyword
CRITERION= option (DTREE), 323
MININTERVAL= option
ACTNET statement (NETDRAW), 598, 618,
661
CHART statement (GANTT), 427, 430, 431,
456, 463, 496, 508, 515, 518
MININTGV= option
CHART statement (GANTT), 445, 474, 476,
478, 544, 545
MINMLV keyword
CRITERION= option (DTREE), 323
MINOFFGV= option
CHART statement (GANTT), 445, 474, 476,
478, 544
868
Syntax Index
MINOFFLV= option
CHART statement (GANTT), 446, 474, 476,
478, 545, 547
MINSEGD= option,
See MINSEGMTDUR= option
MINSEGMTDUR= option
RESOURCE statement (CPM), 98, 102, 135,
238
MINUTE keyword
INTERVAL= option (CPM), 79
MININTERVAL= option (GANTT), 456
MININTERVAL= option (NETDRAW), 598
PADDING= option (GANTT), 430, 455
ROUTINTERVAL= option (CPM), 101
MODIFY statement
DTREE procedure, 336, 385, 386, 389, 391
MONTH keyword
INTERVAL= option (CPM), 79
MININTERVAL= option (GANTT), 456
MININTERVAL= option (NETDRAW), 598
PADDING= option (GANTT), 430, 455
ROUTINTERVAL= option (CPM), 101
MOVE statement
DTREE procedure, 337, 387
MS keyword
ALIGNTYPE variable (CPM), 85
MULTALT keyword
OBSTYPE variable (CPM), 99, 127, 128, 139
MULTALT option,
See MULTIPLEALTERNATES option
MULTIPLEALTERNATES option
RESOURCE statement (CPM), 98, 138
N
NACTS= option,
GANTT, See NJOBS= option
PROC CPM statement, 79
NADJ= option
PROC CPM statement, 79
NAME= option,
PM, See PROJECTNAME= option
ACTNET statement (NETDRAW), 605
CHART statement (GANTT), 446
PROC DTREE statement, 332
TREEPLOT statement (DTREE), 339, 378
NETDRAW procedure, 590
ACTNET statement, 595
PROC NETDRAW statement, 594
NINCRS= option,
See NTICKS= option
NJOBS= option
CHART statement (GANTT), 446
NLAGCAL= option
SUCCESSOR statement (CPM), 104
NLEVELSPERCOLUMN= option
ACTNET statement (NETDRAW), 598, 619
NNODES= option
PROC CPM statement, 79
NOANNO option,
See NOANNOTATE option
NOANNOTATE option
PROC DTREE statement, 328
TREEPLOT statement (DTREE), 339
NOARRHD option,
See NOARROWHEAD option
NOARROWFILL option
ACTNET statement (NETDRAW), 605, 664
NOARROWHEAD option
CHART statement (GANTT), 446, 478
NOAUTOUPDT option
ACTUAL statement (CPM), 83, 123, 203
NOBYLINE option, OPTIONS statement
GANTT procedure, 531, 535
NOCOMPRESS option
PROC DTREE statement, 327
TREEPLOT statement (DTREE), 339
NOCP option,
See NOCOMPRESS option
NODEFID option
ACTNET statement (NETDRAW), 598, 613,
640
NODETRACK option
ACTNET statement (NETDRAW), 598
NODISPLAY option
PROC NETDRAW statement, 595
PROC PM statement, 698
NOE
START option
RESOURCE statement (CPM), 99
NOEXTRANGE option
CHART statement (GANTT), 430, 446, 476
NOF
FLOAT option
RESOURCE statement (CPM), 99
NOFR option,
See NOFRAME option
NOFRAME option
CHART statement (GANTT), 438, 446, 487
NOJOBNUM option
CHART statement (GANTT), 430, 496
NOLABEL option
ACTNET statement (NETDRAW), 598, 613,
640
CHART statement (GANTT), 489
PROC DTREE statement, 324
TREEPLOT statement (DTREE), 339
NOLEGEND option
CHART statement (GANTT), 430, 458, 487,
496
PROC DTREE statement, 330, 382
TREEPLOT statement (DTREE), 339, 399
NOLG option,
See NOLEGEND option
NOL
START option
RESOURCE statement (CPM), 99
NONDP option
ACTNET statement (NETDRAW), 598
NONE keyword
PADDING= option (GANTT), 430, 455
ZONESPAN= option (GANTT), 451
Syntax Index
869
NONODETRACK option
ACTNET statement (NETDRAW), 598
NONUMBER option,
NETDRAW, See NOPAGENUMBER option
NOPAGENUM option
CHART statement (GANTT), 446
PROC DTREE statement, 332
TREEPLOT statement (DTREE), 339
NOPAGENUMBER option,
DTREE, See NOPAGENUM option
ACTNET statement (NETDRAW), 605
NOPATBAR option
CHART statement (GANTT), 446
NORC option
PROC DTREE statement, 332
TREEPLOT statement (DTREE), 339
NOREPEATAXIS option
ACTNET statement (NETDRAW), 598
NORESOURCEVARS option
RESOURCE statement (CPM), 99
NORESVARS option,
See NORESOURCEVARS option
NORESVARSOUT option,
See NORESOURCEVARS option
NOSCALE option
PROC DTREE statement, 323
NOSUMMARY option
EVALUATE statement (DTREE), 336
PROC DTREE statement, 325
NOT
FLOAT option
RESOURCE statement (CPM), 99
NOTIMEAXIS option
ACTNET statement (NETDRAW), 599
NOTMTIME option
CHART statement (GANTT), 446
NOTNLABEL option
CHART statement (GANTT), 430, 522
NOUTIL option
PROC CPM statement, 79
NOVCENTER option
ACTNET statement (NETDRAW), 606, 614,
652
NOWARNING option
PROC DTREE statement, 326
NOXTRNG option,
See NOEXTRANGE option
NOZONECOL option
CHART statement (GANTT), 447, 450, 489
NOZONEDESCR option,
See NOZONELABEL option
NOZONELABEL option
ACTNET statement (NETDRAW), 599
NPERCOL= option,
See NLEVELSPERCOLUMN= option
NRESREQ= option
PROC CPM statement, 80
NROUTCAL= option
RESOURCE statement (CPM), 99, 142
NTICKS= option
CHART statement (GANTT), 447
NWIDTH= option
EVALUATE statement (DTREE), 336
PROC DTREE statement, 325
SUMMARY statement (DTREE), 338
TREEPLOT statement (DTREE), 339
NXNODES= option
ACTNET statement (NETDRAW), 606
NXPAGES= option,
See HPAGES= option
NYNODES= option
ACTNET statement (NETDRAW), 606
NYPAGES= option,
See VPAGES= option
O
OBSTYPE= option
RESOURCE statement (CPM), 99, 211
ODS HTML statement, 566
ANCHOR= option, 568
CLOSE option, 569
FILE= option, 567
ONEZONEVAL option
CHART statement (GANTT), 447
OR, iv
ORDERALL option
PROJECT statement (CPM), 91
ORPM, iv
OUT= option
PROC CPM statement, 80, 160
PROC NETDRAW statement, 595
OUTCOME= option
VARIABLES statement (DTREE), 340, 362
OVERLAPCH= option
CHART statement (GANTT), 434
OVERRIDEDUR option
DURATION statement (CPM), 89
OVLPCHAR= option,
See OVERLAPCH= option
OVPCHAR= option
CHART statement (GANTT), 434
P
P keyword
DISPLAY= option (DTREE), 323
PADDING= option
CHART statement (GANTT), 430, 453, 454,
504
PAGECLIP keyword
LABRULE= option (GANTT), 443
PAGELIMIT= option
CHART statement (GANTT), 431
PAGENUM option,
NETDRAW, See PAGENUMBER option
CHART statement (GANTT), 447
PROC DTREE statement, 332
TREEPLOT statement (DTREE), 339
PAGENUMBER option,
DTREE, See PAGENUM option
870
Syntax Index
ACTNET statement (NETDRAW), 606
PAGES= option,
GANTT, See PAGELIMIT= option
ACTNET statement (NETDRAW), 599
PAGESIZE system option, 455
PARENT statement,
See PROJECT statement
PATLEVEL= option
CHART statement (GANTT), 439, 447, 448,
464
PATTERN statement, 429, 465, 487, 499
options, 467
syntax, 466
PATTERN= option
ACTNET statement (NETDRAW), 602, 606,
620, 622, 625, 649
CHART statement (GANTT), 448, 464, 465
PATVAR= option,
See PATTERN= option
PAYOFFS= option,
VARIABLES statement (DTREE), See
VALUE= option
PROC DTREE statement, 325
PCOMP= option,
See PCTCOMP= option
PCOMPRESS option
ACTNET statement (NETDRAW), 606, 636
CHART statement (GANTT), 411, 439, 442,
448, 450, 463, 489, 507
PCT units
YBETWEEN= option (DTREE), 326
PCTCOMP= option
ACTUAL statement (CPM), 84, 203
PCTCOMPLETE= option,
See PCTCOMP= option
PER= option,
See PERIOD= option
PERIOD= option
RESOURCE statement (CPM), 99, 211
PM procedure
PROC PM statement, 697
PRECDATA= option
PROC GANTT statement, 412, 423, 436, 444,
449, 453, 549
PROB= option
VARIABLES statement (DTREE), 342, 362
PROBIN= option
PROC DTREE statement, 325
PROC CPM statement,
See also CPM procedure
statement options, 77
PROC DTREE statement,
See also DTREE procedure
general options, 323326
graphics options, 327334
line-printer options, 334
PROC GANTT statement,
See also GANTT procedure
statement options, 421
PROC NETDRAW statement,
See also NETDRAW procedure
statement options, 594
PROC PM statement,
See also PM procedure
statement options, 697
PROJDICT= option
Projman, 749
PROJECT statement
CPM procedure, 90
PROJECT= option
PROC PM statement, 698
PROJECTNAME= option
PROC PM statement, 698
Projman
PROJDICT= option, 749
project name option, 750
projman command, 749
PROJMAN Application, 749
PROJNAME= option,
See PROJECTNAME= option
Q
QTR keyword
INTERVAL= option (CPM), 79
MININTERVAL= option (GANTT), 456
MININTERVAL= option (NETDRAW), 598
PADDING= option (GANTT), 430, 455
ROUTINTERVAL= option (CPM), 101
QUIT keyword
ERRHANDLE= option (DTREE), 324
QUIT statement
DTREE procedure, 337
QUITMISSINGALIGN option
ACTNET statement (NETDRAW), 599
R
R keyword
DISPLAY= option (DTREE), 323
RATEXINT option,
See TOTUSAGE option
RBARHT= option
CHART statement (GANTT), 448
RBAROFF= option
CHART statement (GANTT), 449
RC option
PROC DTREE statement, 332
TREEPLOT statement (DTREE), 339
RCI option,
See RESCALINTERSECT option
RCP option,
See RCPROFILE option
RCPROFILE option
RESOURCE statement (CPM), 100, 142, 225
RCS option,
See RCPROFILE option
RDUR= option,
See REMDUR= option
RDURATION= option,
Syntax Index
871
See REMDUR= option
RECALL statement
DTREE procedure, 337, 387, 391
RECTILINEAR option
ACTNET statement (NETDRAW), 606, 675
REF= option
CHART statement (GANTT), 431, 434, 496,
511, 549
REFBREAK option
ACTNET statement (NETDRAW), 599, 655
REFCHAR= option
ACTNET statement (NETDRAW), 602, 609
CHART statement (GANTT), 431, 434, 444,
487
REFLABEL option
CHART statement (GANTT), 431, 511
REMDUR= option
ACTUAL statement (CPM), 84, 203
RES statement,
See RESOURCE statement
RESCALINT option,
See RESCALINTERSECT option
RESCALINTERSECT option
RESOURCE statement (CPM), 100
RESET statement
DTREE procedure, 337, 363
RESET= option, GOPTIONS statement
GANTT procedure, 466, 469
RESID= option
RESOURCE statement (CPM), 100, 242
RESIN= option,
See RESOURCEIN= option
RESLEVEL keyword
OBSTYPE variable (CPM), 99, 127
RESLEVEL= option,
See RESOURCEIN= option
RESOURCE keyword
COMPARE= option (CPM), 87
PATLEVEL= option (GANTT), 447
SET= option (CPM), 87
UPDATE= option (CPM), 87
RESOURCE statement
CPM procedure, 93, 207
RESOURCEIN= option
PROC CPM statement, 80, 211
RESOURCEOUT= option
PROC CPM statement, 80, 207
RESOURCESCHED= option
PROC CPM statement, 81
RESOURCEVARS option
RESOURCE statement (CPM), 101
RESOUT= option,
See RESOURCEOUT= option
RESPRTY keyword
OBSTYPE variable (CPM), 99, 127
SCHEDRULE= option (CPM), 102, 134
RESRCDUR keyword
OBSTYPE variable (CPM), 99, 127, 128
RESSCHED= option,
See RESOURCESCHED= option
RESTRICTSEARCH option
ACTNET statement (NETDRAW), 599
RESTYPE keyword
OBSTYPE variable (CPM), 99, 127
RESUSAGE keyword
OBSTYPE variable (CPM), 99, 127
RESUSAGE= option,
See RESOURCEOUT= option
RESVARSOUT option,
See RESOURCEVARS option
REVERSEY option
ACNET statement (NETDRAW), 606
REWARD keyword
MODIFY statement (DTREE), 336
REWARD= option
VARIABLES statement (DTREE), 340, 362
RGHTLEFT keyword
CHILDORDER= option (NETDRAW), 596
RIGHT keyword
ZONESPAN= option (GANTT), 451
RIGHT option
CHART statement (GANTT), 444, 449
RIN= option,
See RESOURCEIN= option
RJUST option,
See RIGHT option
ROTATE option
ACTNET statement (NETDRAW), 607, 621,
686, 688
ROTATETEXT option
ACTNET statement (NETDRAW), 607, 618,
621, 686, 688
ROUT= option,
See RESOURCEOUT= option
ROUTCONT option,
See ROUTNOBREAK option
ROUTINTERVAL= option
RESOURCE statement (CPM), 101, 142
ROUTINTPER= option
RESOURCE statement (CPM), 101, 142, 144
ROUTNOBREAK option
RESOURCE statement (CPM), 101, 143, 218
RSCHDORD option,
See RSCHEDORDER option
RSCHDWBS option,
See RSCHEDWBS option
RSCHED= option,
See RESOURCESCHED= option
RSCHEDID= option
RESOURCE statement (CPM), 101
RSCHEDORDER option
PROJECT statement (CPM), 91
RSCHEDULE= option,
See RESOURCESCHED= option
RSCHEDWBS option
PROJECT statement (CPM), 92
RSEARCH option,
See RESTRICTSEARCH option
872
Syntax Index
RSID= option,
See RSCHEDID= option
RSORDER option,
See RSCHEDORDER option
RSWBS option,
See RSCHEDWBS option
RT= option
EVALUATE statement (DTREE), 336
PROC DTREE statement, 325, 371, 382
RESET statement (DTREE), 363
RTEXT option,
See ROTATETEXT option
RULE2= option,
See SCHEDRULE2= option
RULE= option,
See SCHEDRULE= option
S
S= option,
PROC GANTT statement, See SPLIT= option
CHART statement (GANTT), See SKIP= option
SAS/OR, iv
SAS/ORPM, iv
SAVE statement
DTREE procedure, 337, 387, 391
SBARHT= option,
See RBARHT= option
SBAROFF= option,
See RBAROFF= option
SCALE= option
CHART statement (GANTT), 427, 430, 431,
458, 463, 487, 508, 518
SCHEDRULE2= option
RESOURCE statement (CPM), 102, 133
SCHEDRULE= option
RESOURCE statement (CPM), 102, 133, 211
SECOND keyword
INTERVAL= option (CPM), 79
MININTERVAL= option (GANTT), 456
MININTERVAL= option (NETDRAW), 598
PADDING= option (GANTT), 430, 455
ROUTINTERVAL= option (CPM), 101
SEPARATEARCS option
ACTNET statement (NETDRAW), 607, 614,
634
SEPARATESONS option
ACTNET statement (NETDRAW), 599, 621,
677
SEPCRIT option
PROJECT statement (CPM), 92
SEQ keyword
ALIGNTYPE variable (CPM), 85
SET= option
BASELINE statement (CPM), 87, 201
SETFINISHMILESTONE option
PROC CPM statement, 81
SF keyword
LAG variable (CPM), 104
LAG variable (GANTT), 443
LAG variable (NETDRAW), 597
SF= option,
See S
FINISH= option
S
FINISH= option
CHART statement (GANTT), 431, 529
SGE keyword
ALIGNTYPE variable (CPM), 85
SHORTDUR keyword
SCHEDRULE= option (CPM), 102, 134
SHOWBREAK option
ACTNET statement (NETDRAW), 599, 654
SHOWFLOAT option
ACTUAL statement (CPM), 84, 124, 205
ACTUAL statement (PM), 699
SHOWPREC option
CHART statement (GANTT), 449
SHOWSTATUS option
ACTNET statement (NETDRAW), 600, 614,
649
SKIP= option
CHART statement (GANTT), 432, 442, 487,
496
SLE keyword
ALIGNTYPE variable (CPM), 85
SLIPINF option,
See DELAYANALYSIS option
SPACE units
YBETWEEN= option (DTREE), 326
SPANNINGTREE option
ACTNET statement (NETDRAW), 600
SPLIT= option
PROC GANTT statement, 424, 531
SPLITFLAG option
RESOURCE statement (CPM), 102
SS keyword
LAG variable (CPM), 104
LAG variable (GANTT), 443
LAG variable (NETDRAW), 597
SS= option,
See S
START= option
SSO option,
See SSORDER option
SSORDER option
PROJECT statement (CPM), 92
S
START= option
CHART statement (GANTT), 431, 529
STAGE keyword
DISPLAY= option (DTREE), 323
STAGE= option
VARIABLES statement (DTREE), 340, 362
STAGEIN= option
PROC DTREE statement, 325
START= option
DURATION statement (CPM), 89
STATE= option
VARIABLES statement (DTREE), 342, 362
STEP= option,
See ROUTINTPER= option
STEPINT= option,
Syntax Index
873
See ROUTINTERVAL= option
STEPSIZE= option,
See ROUTINTPER= option
STOPDATE= option
RESOURCE statement (CPM), 102, 251
STRIPID option,
See STRIPIDBLANKS option
STRIPIDBLANKS option
CHART statement (GANTT), 432
SUCC statement,
See SUCCESSOR statement
SUCC= option,
See SUCCESSOR= option
SUCCESSOR statement
CPM procedure, 67, 103, 156
SUCCESSOR= option
ACTNET statement (NETDRAW), 600, 628
CHART statement (GANTT), 416, 449, 474,
540, 560
VARIABLES statement (DTREE), 341, 362
SUMMARY option
CHART statement (GANTT), 432, 458, 487,
496
EVALUATE statement (DTREE), 336, 391, 399
PROC DTREE statement, 325, 385
SUMMARY statement
DTREE procedure, 338, 362, 371, 385
SUPLEVEL keyword
OBSTYPE variable (CPM), 99, 127
SUPPRESSOBSWARN option
PROC CPM statement, 81
SYMBC= option,
See SYMBOLC= option
SYMBD= option,
See SYMBOLD= option
SYMBE= option,
See SYMBOLE= option
SYMBOL statement, 435, 468, 487, 499
options, 469
syntax, 469
SYMBOLC= option
PROC DTREE statement, 332
TREEPLOT statement (DTREE), 339, 382
SYMBOLD= option
PROC DTREE statement, 333
TREEPLOT statement (DTREE), 339, 382
SYMBOLE= option
PROC DTREE statement, 333
TREEPLOT statement (DTREE), 339, 382
SYMCHAR= option
CHART statement (GANTT), 434, 487
T
TAIL statement,
See TAILNODE statement
TAIL= option
CHART statement (GANTT), 449, 473, 542
TAILNODE statement
CPM procedure, 67, 104, 160
TAILNODE= option,
See TAIL= option
TARGET= option
EVALUATE statement (DTREE), 336, 391
PROC DTREE statement, 325, 385
SUMMARY statement (DTREE), 338, 362, 371,
385
T
FLOAT option
RESOURCE statement (CPM), 102, 237
TIMENOW= option
ACTUAL statement (CPM), 84, 203
CHART statement (GANTT), 426, 432, 522,
525
TIMENOWSPLT option
ACTUAL statement (CPM), 85, 124
TIMESCALE option
ACTNET statement (NETDRAW), 600, 618,
652
TJUST option,
See TOP option
TNCHAR= option
CHART statement (GANTT), 432, 435, 487
TO statement,
See HEADNODE statement
TOLERANCE= option
PROC DTREE statement, 325
TOP option
CHART statement (GANTT), 449
TOPDOWN keyword
CHILDORDER= option (NETDRAW), 596
TOTUSAGE option
RESOURCE statement (CPM), 102
TREE option
ACTNET statement (NETDRAW), 600, 621,
675
TREELAYOUT option,
See TREE option
TREEPLOT statement
DTREE procedure, 338, 339, 378, 382, 399
TYPE keyword
MODIFY statement (DTREE), 336
TYPE= option
VARIABLES statement (DTREE), 341, 362
U
UNSCHEDMISS option
RESOURCE statement (CPM), 103
UPDATE= option
BASELINE statement (CPM), 87
UPDTUNSCHED option
RESOURCE statement (CPM), 103
USEFORMAT option
ACTNET statement (NETDRAW), 600, 679
CHART statement (GANTT), 432
USEPROJDUR option
PROJECT statement (CPM), 92
USEPROJDURSPEC option,
See USEPROJDUR option
USESPECDUR option,
874
Syntax Index
See USEPROJDUR option
UTILITY= option,
See VALUE= option
V
VALUE= option
VARIABLES statement (DTREE), 343, 362
VARIABLES statement
DTREE procedure, 339343, 362
VBETWEEN= option,
See YBETWEEN= option
VC= option,
See VSYMBOLC= option
VD= option,
See VSYMBOLD= option
VE= option,
See VSYMBOLE= option
VMARGIN= option
ACTNET statement (NETDRAW), 607, 652
VMILE= option
CHART statement (GANTT), 427, 441, 449,
487, 505
VPAGES= option
ACTNET statement (NETDRAW), 607
CHART statement (GANTT), 439, 442, 446,
448, 450, 463, 489, 507
VPC statement
DTREE procedure, 343, 390
VPI statement
DTREE procedure, 343, 388
VPOS= option, GOPTIONS statement
GANTT procedure, 442, 463
NETDRAW procedure, 625, 633, 640
VSYMBOLC= option
PROC DTREE statement, 333
TREEPLOT statement (DTREE), 339
VSYMBOLD= option
PROC DTREE statement, 333
TREEPLOT statement (DTREE), 339
VSYMBOLE= option
PROC DTREE statement, 334
TREEPLOT statement (DTREE), 339
VTRACKS= option
ACTNET statement (NETDRAW), 601, 613
W
WARNING option
PROC DTREE statement, 326
WBS option,
See WBSCODE option
WBSCODE option
PROJECT statement (CPM), 92
WEB= option
ACTNET statement (NETDRAW), 608
CHART statement (GANTT), 450, 486, 568
VARIABLES statement (DTREE), 341, 356
WEEK keyword
INTERVAL= option (CPM), 79
MININTERVAL= option (GANTT), 456
MININTERVAL= option (NETDRAW), 598
PADDING= option (GANTT), 430, 455
ROUTINTERVAL= option (CPM), 101
WEEKDAY keyword
INTERVAL= option (CPM), 79
INTERVAL= option (GANTT), 429, 458
ROUTINTERVAL= option (CPM), 101
WORK= option
RESOURCE statement (CPM), 103
WORKDATA= option
PROC CPM statement, 81, 185
PROC GANTT statement, 424, 518
WORKDAY keyword
INTERVAL= option (CPM), 79, 107
INTERVAL= option (GANTT), 429, 458
ROUTINTERVAL= option (CPM), 101
WORKDAY= option,
See WORKDATA= option
WPREC= option
CHART statement (GANTT), 450, 540, 549
WTNOW= option
CHART statement (GANTT), 432, 450, 487,
522, 525
WZLINE= option,
See WZONE= option
WZONE= option
CHART statement (GANTT), 450, 451, 565
X
XBETWEEN= option
ACTNET statement (NETDRAW), 601, 613,
647
XFERVARS option
PROC CPM statement, 82, 200, 412
PROC PM statement, 699
Y
YBETWEEN= option
ACTNET statement (NETDRAW), 601, 613,
640
PROC DTREE statement, 326
TREEPLOT statement (DTREE), 339, 378, 399
YEAR keyword
INTERVAL= option (CPM), 79
MININTERVAL= option (GANTT), 456
MININTERVAL= option (NETDRAW), 598
PADDING= option (GANTT), 430, 455
ROUTINTERVAL= option (CPM), 101
Z
ZONE keyword
CTEXTCOLS= option (GANTT), 439
ZONE= option
ACTNET statement (NETDRAW), 601, 620,
659
CHART statement (GANTT), 450, 489
ZONEDESCR option,
See ZONELABEL option
ZONELABEL option
Syntax Index
875
ACTNET statement (NETDRAW), 601
ZONELEVADD option,
See ZONESPACE option
ZONELINE= option,
See ZONESPAN= option
ZONEOFF= option
CHART statement (GANTT), 451, 565
ZONEOFFSET= option,
See ZONEOFF= option
ZONEPAT option
ACTNET statement (NETDRAW), 602, 608,
620, 659
ZONESPACE option
ACTNET statement (NETDRAW), 601, 661
ZONESPAN= option
CHART statement (GANTT), 451, 565
ZONEVAR= option,
See ZONE= option
Your Turn
If you have comments or suggestions about SAS/OR