0% found this document useful (0 votes)
237 views884 pages

Or Ug Proj 7310

m
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
237 views884 pages

Or Ug Proj 7310

m
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 884

SAS/OR

9.1 Users Guide:


Project Management
The correct bibliographic citation for this manual is as follows: SAS Institute Inc. 2004. SAS/OR

9.1 Users Guide:


Project Management. Cary, NC: SAS Institute Inc.
SAS/OR

9.1 Users Guide: Project Management


Copyright 2004, SAS Institute Inc., Cary, NC, USA
ISBN 1-59047-240-3
All rights reserved. Produced in the United States of America. No part of this publication may be reproduced, stored in
a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, or otherwise,
without the prior written permission of the publisher, SAS Institute Inc.
U.S. Government Restricted Rights Notice: Use, duplication, or disclosure of this software and related
documentation by the U.S. government is subject to the Agreement with SAS Institute and the restrictions set forth in
FAR 52.227-19, Commercial Computer Software-Restricted Rights (June 1987).
SAS Institute Inc., SAS Campus Drive, Cary, North Carolina 27513.
1st printing, January 2004
SAS Publishing provides a complete selection of books and electronic products to help customers use SAS software to
its fullest potential. For more information about our e-books, e-learning products, CDs, and hard-copy books, visit the
SAS Publishing Web site at support.sas.com/pubs or call 1-800-727-3228.
SAS

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

is the SAS macro variable


dened by PROC CPM.
activity data
resource data
calendar data
workday data
holiday data
-
schedule data
resource schedule data
resource usage data
-
-
-
PROC
CPM

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 that has a character string indicating if the procedure terminated


successfully. Figure 1.2 illustrates the ow of data in and out of PROC GANTT.
20

Chapter 1. Introduction to Project Management
schedule data
calendar data
workday data
holiday data
label data
-
imagemap data
-
PROC
GANTT

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

, is used to indicate if the schedule was computed successfully.


activity data
resource data
calendar data
workday data
holiday data
preference data
-
schedule data
resource schedule data
resource usage data
preference data
-
-
-
-
PROC
PM

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

START schedules (in the data set bookschd) and


note that on January 1, the activity B1PEDT for Book1 is scheduled to start while
the preliminary editing of book 2 (activity B2PEDT) has been postponed, due to
subproject Book 1 having priority over subproject Book 2. On January 22, there is
no activity belonging to subproject Book 1 that demands an editor; thus, the activity
B2PEDT is scheduled to start on that day. As a result, the editor is working on an
activity in the second project for two weeks starting from January 22, 2003; when
B1CEDT is ready to start, the editor is not available, causing a delay in this activity.
Thus, even though the rst book has priority over the second book, the scheduling
algorithm does not keep a resource waiting for activities in the rst project. However,
if you enable activity splitting, you can reclaim the resource for the rst book by
allowing activities in the second project to be split, if necessary. For details regarding
the scheduling algorithm allowing splitting of activities, see Chapter 2, The CPM
Procedure.
Note: The entire project nishes on April 1, 2003; resource constraints have delayed
project completion by four weeks. The variable R

DELAY in the Schedule data set


bookschd indicates the amount of delay in weeks caused by resource constraints.
The value of R

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

index.html). The graphs and reports in the


demo have not been saved, but are calculated on demand; this means that they change
dynamically as the data used to calculate them change. This demo requires Internet
Explorer, version 5.0 or later.
62

Chapter 1. Introduction to Project Management
Microsoft Project Conversion Macros
MDBTOPM and MP2KTOPM are two SAS macros that convert Microsoft

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

FINISH for nish tasks to E

FINISH PROC CPM FIXFINISH


74

Chapter 2. The CPM Procedure
Table 2.8. Network Specications
Description Statement Option
AON format activity variable ACTIVITY
AOA format headnode variable HEADNODE
project variable PROJECT
AON format successor variables SUCCESSOR
AOA format tailnode variable TAILNODE
Table 2.9. Multiproject Specications
Description Statement Option
project variable PROJECT
aggregate parent resources PROJECT AGGREGATEPARENTRES
ignore parent resources PROJECT IGNOREPARENTRES
compute separate critical paths PROJECT SEPCRIT
use specied project duration PROJECT USEPROJDUR
compute WBS Code PROJECT WBSCODE
Table 2.10. OUT= Data Set Options
Description Statement Option
include percent complete variable ACTUAL ESTIMATEPCTC
add an observation for missing activities PROC CPM ADDACT
single observation per activity PROC CPM COLLAPSE
copy relevant variables to Schedule data set PROC CPM XFERVARS
variables to be copied to Schedule data set ID
include descending sort variables PROJECT DESCENDING
include all sort order variables PROJECT ORDERALL
include early start sort order variable PROJECT ESORDER
include late start sort order variable PROJECT LSORDER
include resource start order variable PROJECT SSORDER
include WBS Code PROJECT WBSCODE
include information about resource delays RESOURCE DELAYANALYSIS
include early start schedule RESOURCE E

START
include free oat RESOURCE F

FLOAT
set unscheduled S

START and S

FINISH RESOURCE FILLUNSCHED


include late start schedule RESOURCE L

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 RESOURCE UPDTUNSCHED


Functional Summary

75
Table 2.11. Problem Size Options
Description Statement Option
number of precedence constraints PROC CPM NADJ=
number of activities PROC CPM NACTS=
number of distinct node or activity names PROC CPM NNODES=
number of resource requirements PROC CPM NRESREQ=
do not use utility data set PROC CPM NOUTIL
Table 2.12. Progress Updating Options
Description Statement Option
actual nish variable ACTUAL A

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

START + DELAY RESOURCE AWAITDELAY


delay specication RESOURCE DELAY=
schedule even if insufcient resources RESOURCE INFEASDIAGNOSTIC
independent allocation RESOURCE INDEPENDENTALLOC
milestones can consume resources RESOURCE MILESTONERESOURCE
milestones can not consume resources RESOURCE MILESTONENORESOURCE
use multiple alternates for a single resource RESOURCE MULTIPLEALTERNATES
resource calendar intersect RESOURCE RESCALINTERSECT
scheduling priority rule RESOURCE SCHEDRULE=
secondary scheduling priority rule RESOURCE SCHEDRULE2=
stop date for resource constrained scheduling RESOURCE STOPDATE=
76

Chapter 2. The CPM Procedure
Table 2.15. RESOURCEOUT= Data Set Options
Description Statement Option
include all types of resource usage RESOURCE ALL
append observations for total usage RESOURCE APPEND
alphanumeric calendar for

TIME

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

FINISH, REMDUR, PCTCOMP) needs to


be specied in the ACTUAL statement. These variables are referred to as progress
variables. The TIMENOW= option in this statement represents the value of the cur-
rent time (referred to as TIMENOW), and it is used in conjunction with the values
of the progress variables to check for consistency and to determine default values if
necessary.
You can also specify options in the ACTUAL statement that control the updating
of the project schedule. Using the ACTUAL statement causes four new variables
(A

START, A

FINISH, A

DUR, and STATUS) to be added to the Schedule data


set; these variables are dened in the OUT= Schedule Data Set section on page
113. See the Progress Updating section on page 122 for more information.
The following options can be specied in the ACTUAL statement after a slash (/).
ACTUAL Statement

83
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

COMP is to be added to the Schedule output


data set (and the Resource Schedule output data set) that contains the percent com-
pletion time for each activity (for each resource used by each activity) in the project.
Note that this value is 0 for activities that have not yet started and 100 for completed
activities; for activities in progress, this value is computed using the actual start time,
the value of TIMENOW, and the revised duration of the activity.
FIXASTART
species that the actual start time of an activity should not be overwritten if it is
specied to be on a non-work day. By default, none of the start or nish times of an
activity can occur during a non-work period corresponding to the activitys calendar.
If the actual start time is specied on a non-work day, it is moved to the nearest work
day. The FIXASTART option species that the actual start and nish times be left
unchanged even if they coincide with a non-working time. Thus, if the actual start
time is specied to be sometime on Sunday, it is left unchanged even if Sunday is a
non-working day in the activitys calendar.
NOAUTOUPDT
requests that PROC CPM should not assume automatic completion of activities. (The
NOAUTOUPDT option is the reverse of the AUTOUPDT option.) In other words,
only those activities that have nonmissing actual start or nonmissing actual nish
times or both (either specied as values for the A

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

FINISH variables, or by indicating the particular


schedule (EARLY, LATE, ACTUAL, or RESOURCE constrained schedule) that is to
be used to set the B

START and B

FINISH variables. The second method of setting


the schedule is useful when you want to set the baseline schedule on the basis of the
current invocation of PROC CPM.
Note that the BASELINE statement needs to be specied in order for the baseline start
and nish times to be copied to the Schedule data set. Just including the 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

FINISH variable or if the SET=


option is also specied. In other words, the COMPARE option is valid only if there
is a baseline schedule to compare with. The comparison is specied in two variables
in the Schedule data set, S

VAR and F

VAR, which have the following denition:


S_VAR = Compare Start - B_START;
F_VAR = Compare Finish - B_FINISH;
where Compare Start and Compare Finish refer to the start and nish times
corresponding to the schedule that is used as a comparison.
Note that the values of the variables S

VAR and F

VAR are calculated in units of


the INTERVAL= parameter, taking into account the calendar dened for the activity.
SET=schedule
species which of the four schedules (EARLY, LATE, RESOURCE, or ACTUAL)
to set the baseline schedule equal to. The SET= option causes the addition of two
new variables in the Schedule data set; these are the B

START and B

FINISH vari-
ables. The procedure sets B

START and B

FINISH equal to the start and nish


times corresponding to the EARLY, LATE, ACTUAL, or RESOURCE schedules. If
the Activity data set already has a B

START and B

FINISH variable, it is overwrit-


ten by the SET= option and a warning is displayed. Note that the value RESOURCE
is valid only if resource-constrained scheduling is being performed, and the value
ACTUAL is valid only if the ACTUAL statement is present.
Note: The values ACTUAL, RESOURCE, and so on cause the B

START and
B

FINISH values to be set to the computed values of A

START, S

START, . . . , and
so on. They cannot be used to set the B

START and B

FINISH values to be equal


to, say, A

START and A

FINISH or S

START and S

FINISH, if these variables


are present in the Activity data set; to do that you must use B

START=A

START,
B

FINISH=A

FINISH, and so on.


UPDATE=schedule
species the name of the schedule (EARLY, LATE, ACTUAL, or RESOURCE) that
can be used to update the B

START and B

FINISH variables. This sets 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

FINISH. Note that if both


the UPDATE= and SET= options are specied, the SET= specication is used.
88

Chapter 2. The CPM Procedure
CALID Statement
CALID variable ;
The CALID statement species the name of a SAS variable that is used in the
Activity, Holiday, and Calendar data sets to identify the calendar to which each obser-
vation refers. This variable can be either numeric or character depending on whether
the different calendars are identied by unique numbers or names. If this variable
is not found in any of the three data sets, PROC CPM looks for a default variable
named

CAL

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

ASC is to be added to the Schedule output data


set; this variable can be used to order the activities in such a way that the activities
within each subproject are in increasing order of the early start time. Note that this
order is not necessarily the same as the one that would be obtained by sorting all the
activities in the Schedule data set by E

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

ASC is to be added to the Schedule output data


set; this variable can be used to order the activities in such a way that the activities
within each subproject are in increasing order of the late start time.
ORDERALL
ALL
is equivalent to specifying the ESORDER and LSORDER options (and the
SSORDER option when resource constrained scheduling is performed).
RSCHEDORDER
RSCHDORD
RSORDER
indicates that the order variables that are included in the Schedule output data set are
also to be included in the Resource Schedule output data set.
92

Chapter 2. The CPM Procedure
RSCHEDWBS
RSCHDWBS
RSWBS
indicates that the WBS code is also to be included in the Resource Schedule data set.
SEPCRIT
computes individual critical paths for each project. By default, the master projects
early nish time is treated as the starting point for the calculation of the backward
pass (which calculates the late start schedule). The late nish time for each sub-
project is then determined during the backward pass on the basis of the precedence
constraints. If a time constraint is placed on the nish time of a subproject (using the
ALIGNDATE and ALIGNTYPE variables), the late nish time of the subproject is
further constrained by this value.
The SEPCRIT option, on the other hand, requires the late nish time of each sub-
project to be less than or equal to the early nish time of the subproject. Thus, if
you have a set of independent, parallel projects, the SEPCRIT option enables you to
compute separate critical paths for each of the subprojects.
SSORDER
SSO
indicates that a variable named SS

ASC is to be added to the Schedule output data


set; this variable can be used to order the activities in such a way that the activities
within each subproject are in increasing order of the resource-constrained start time.
USEPROJDUR
USEPROJDURSPEC
USESPECDUR
uses the specied subproject duration to compute the maximum allowed late nish
for each subproject. This is similar to the SEPCRIT option, except that the specied
project duration is used to set an upper bound on each subprojects late nish time in-
stead of the project span as computed from the span of all the subtasks of the project.
In other words, if E

START and E

FINISH are the early start and nish times of the


subproject under consideration, and the subproject duration is PROJ

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

CODE in the Schedule output data set.


RESOURCE Statement

93
RESOURCE Statement
RESOURCE variables / resource options ;
RES variables / resource options ;
The RESOURCE statement identies the variables in the Activity data set that con-
tain the levels of the various resources required by the different activities. This state-
ment is necessary if the procedure is required to summarize resource utilization for
various resources.
This statement is also required when the activities in the network use limited re-
sources and a schedule is to be determined subject to resource constraints in addition
to precedence constraints. The levels of the various resources available are obtained
from the RESOURCEIN= data set (the Resource data set.) This data set need not
contain all of the variables listed in the RESOURCE statement. If any resource vari-
able specied in the RESOURCE statement is not also found in the Resource data
set, it is assumed to be available in unlimited quantity and is not used in determining
the constrained schedule.
The following options are available with the RESOURCE statement to help con-
trol scheduling the activities subject to resource constraints. Some control the
scheduling heuristics, some control the amount of information to be output to the
RESOURCEOUT= data set (the Usage data set), and so on.
ACTDELAY=variable
species the name of a variable in the Activity data set that species a value for the
maximum amount of delay allowed for each activity. The values of this variable
should be greater than or equal to 0. If a value is missing, the value of the DELAY=
option is used instead.
ACTIVITYPRTY=variable
ACTPRTY=variable
identies the variable in the Activity data set that contains the priority of each ac-
tivity. This option is required if resource-constrained scheduling is to be performed
and the scheduling rule specied is ACTPRTY. If the value of the SCHEDRULE=
option is specied as the keyword ACTPRTY, then all activities waiting for resources
are ordered by increasing values of the ACTPRTY= variable. Missing values of the
activity priority variable are treated as +INFINITY. See the Scheduling Method
section on page 131 for a description of the various scheduling rules used during
resource constrained scheduling.
ADDCAL
requests that a variable,

CAL

, be added to the Resource Schedule data set that


identies the resource calendar for each resource used by each activity. For obser-
vations that summarize the activitys schedule, this variable identies the activitys
calendar.
ALL
is equivalent to specifying the ESPROFILE and LSPROFILE options when an un-
constrained schedule is obtained and is equivalent to specifying all four options,
AVPROFILE (AVP), ESPROFILE (ESP), LSPROFILE (LSP), and RCPROFILE
94

Chapter 2. The CPM Procedure
(RCP), when a resource-constrained schedule is obtained. If none of these four op-
tions are specied and a Usage data set is specied, by default the ALL option is
assumed to be in effect.
ALTBEFORESUP
indicates that all alternate resources are to be checked rst before using supplemen-
tary resources. By default, if supplementary levels of resources are available, the
procedure uses supplementary levels rst and uses alternate resources only if the sup-
plementary levels are not sufcient.
APPEND
APPENDINTXRATE
APPENDRATEXINT
APPENDUSAGE
indicates that the Usage data set is to contain two sets of observations: the rst set
indicates the rate of usage for each resource at the beginning of the current time
period, and the second set contains the total usage of each resource for the current
time period. In other words, the Usage data set appends observations indicating the
total usage of each resource to the default set of observations. If the APPEND option
is specied, the procedure adds a variable named OBS

TYPE to the Usage data set.


This variable contains the value RES

RATE for the observations that indicate rate


of usage and the value RES

USED for the observations that indicate the total usage.


AROUTCAL=calname
species the name of the calendar to be used for incrementing the

TIME

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, where delay is the maximum


delay allowed for the activity (which is the value of the ACTDELAY= variable or
the DELAY= option), before an activity is scheduled using supplementary levels
of resources. By default, even if an activity has a nonzero value specied for the
ACTDELAY= variable (or the DELAY= option), it may be scheduled using supple-
mentary resources before L

START+delay. This happens if the procedure does not


see any increase in the resource availability in the future. Thus, if it appears that the
activity will require supplementary resources anyway, the procedure may schedule it
before L

START+delay. The AWAITDELAY option prohibits this behavior; it will


not use supplementary resources to schedule an activity before L

START+delay.
This option can be used to force activities with insufcient resources to start at
L

START by setting DELAY=0.


RESOURCE Statement

95
CUMUSAGE
species that the Usage data set should indicate the cumulative usage of consumable
resources. Note that by default, for consumable resources, each observation in the
Usage data set contains the rate of usage for each resource at the start of the given
time interval. See the RESOURCEOUT= Usage Data Set section on page 142 for a
denition of the variables in the resource usage output data set. In some applications,
it may be useful to obtain the cumulative usage of these resources. The CUMUSAGE
option can be used to obtain the cumulative usage of consumable resources up to the
time specied in the

TIME

variable.
DELAY=delay
species the maximum amount by which an activity can be delayed due to lack of
resources. If E

START of an activity is 1JUN04 and L

START is 5JUN04 and


delay is specied as 2, PROC CPM rst tries to schedule the activity to start on June
1, 2004. If there are not enough resources to schedule the activity, the CPM procedure
postpones the activitys start time. However, it does not postpone the activity beyond
June 7, 2004 (because delay=2 and L

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

DELAY variable indicates the


number of units (in interval units) by which the activitys schedule has slipped due
to resource unavailability, and the DELAY

R variable contains the name of the re-


source, the delaying resource, that has caused the slippage.
The R

DELAY variable is calculated as follows: it is the difference between


S

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

DELAY is not necessarily


the same as S

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

FINISH variables, namely the variables specify-


ing the early start schedule, be included in the Schedule data set in addition to the
S

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

FINISH values for activities that are still unscheduled when


resource constrained scheduling is stopped either by the STOPDATE= option or
due to resource infeasibilities. By default, the Schedule data set contains missing
values for S

START and S

FINISH corresponding to unscheduled activities. If


the FILLUNSCHED option is on, the procedure uses the original E

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

FLOAT variable computed using


the unconstrained early and late start schedules. Note that if resource allocation is
not performed, this variable is always included in the output data set.
INCLUNSCHED
enables the inclusion of activities that are still unscheduled in the computation of
daily (or cumulative) resource usage in the Usage data set when resource-constrained
scheduling is stopped either by the STOPDATE= option or due to resource infeasi-
bilities. This option is the default and can be turned off by the EXCLUNSCHED
option.
INDEPENDENTALLOC
INDEPALLOC
enables each resource to be scheduled independently for each activity during
resource-constrained scheduling. Consider the basic resource scheduling algorithm
described in the Scheduling Method section on page 131. When all the precedence
requirements of an activity are satised, the activity is inserted into the list of activi-
ties that are waiting for resources using the appropriate scheduling rule. An activity
in this list is scheduled to start at a particular time only if all the resources required by
it are available in sufcient quantity. Even if the resources are required by the activity
RESOURCE Statement

97
for different lengths of time, or if the resources have different calendars, all resources
must be available to start at that particular time (or at the beginning of the next work
period for the resources calendar).
If you specify the INDEPENDENTALLOC option, however, each resource is sched-
uled independently of the others. This may cause an activitys schedule to be ex-
tended if its resources cannot all start at the same time.
INFEASDIAGNOSTIC
INFEASDIAG
requests PROC CPM to continue scheduling even when resources are insufcient.
When PROC CPM schedules the project subject to resource constraints, the schedul-
ing process is stopped when the procedure cannot nd sufcient resources for an
activity before the activitys latest possible start time (accounting for the DELAY=
or ACTDELAY= options and using supplementary or alternate resources if neces-
sary and if allowed). The INFEASDIAGNOSTIC option can be used to override this
default action. (Sometimes, you may want to know the level of resources needed to
schedule a project to completion even if resources are insufcient.) This option is
equivalent to specifying innite supplementary levels for all the resources under con-
sideration; the DELAY= value is assumed to equal the default value of +INFINITY,
unless otherwise specied.
LSPROFILE
LSP
LSS
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
late start schedule for the corresponding resource variable.
L

START
requests that the L

START and L

FINISH variables, namely the variables specify-


ing the late start schedule, be included in the Schedule data set in addition to the
S

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

variable in the Usage data set. The


default value of maxdate is the maximum nish time for all of the schedules for
which a usage prole was requested.
MAXNSEGMT=variable
MAXNSEG=variable
species a variable in the Activity data set that indicates the maximum number of
segments that the current activity can be split into. A missing value for this variable
is set to a default value that depends on the duration of the activity and the value of the
MINSEGMTDURvariable. Avalue of 1 indicates that the activity cannot be split. By
default, PROC CPM assumes that any activity, once started, cannot be stopped until
it is completed (except for breaks due to holidays or weekends). Thus, even during
resource-constrained scheduling, an activity is scheduled only if enough resources
can be found for it throughout its entire duration. Sometimes, you may want to allow
98

Chapter 2. The CPM Procedure
preemption of activities already in progress; thus, a more critical activity could cause
another activity to be split into two or more segments.
However, you may not want a particular activity to be split into too many segments,
or to be split too many times. The MAXNSEGMT= and MINSEGMTDUR= options
enable you to control the number of splits and the length of each segment.
MAXOBS=max
species an upper limit on the number of observations that the Usage data set can
contain. If the values specied for the ROUTINTERVAL= and ROUTINTPER= op-
tions are such that the data set will contain more than max observations, then PROC
CPM does not create the output data set and stops with an error message.
The MAXOBS= option is useful as a check to ensure that a very large data set (with
several thousands of observations) is not created due to a wrong specication of the
ROUTINTERVAL= option. For example, if interval is DTYEAR and routinterval is
DTHOUR and the project extends over 2 years, the number of observations would
exceed 15,000. The default value of the MAXOBS= option is 1000.
MILESTONERESOURCE
species that milestone activities consume resources. If a nonzero requirement is
specied for a milestone, the corresponding consumable resources are used at the
scheduled time of that milestone.
MILESTONENORESOURCE
species that milestone activities do not consume resources. This implies that all re-
source requirements are ignored for milestone activities. This is the default behavior.
MINDATE=mindate
species the minimum value of the

TIME

variable in the Usage data set. The


default value of mindate is the minimum start time for all of the schedules for which
a usage prole is requested. Thus, the Usage data set has observations containing the
resource usage and availability information from mindate through maxdate .
MINSEGMTDUR=variable
MINSEGD=variable
species a variable in the Activity data set that indicates the minimum duration of
any segment of the current activity. A missing value for this variable is set to a value
equal to one fth of the activitys duration.
MULTIPLEALTERNATES
MULTALT
indicates that multiple alternate resources can be used to substitute for a single re-
source. In other words, if one of the alternate resources is not sufcient to substitute
for the primary resource, the procedure will use other alternates, as needed, to fulll
the resource requirement. For example, if an activity needs 1.5 programmers and the
allowed alternates are JOHN and MARY, the procedure will use JOHN (at rate 1)
and MARY (at rate 0.5) to allocate a total of 1.5 programmers. See the Specifying
Multiple Alternates section on page 138 for details.
RESOURCE Statement

99
NOE

START
requests that the E

START and E

FINISHvariables, namely the variables specifying


the early start schedule, be dropped from the Schedule data set. Note that the default
is E

START. Also, if resource allocation is not performed, the NOE

START option
is ignored.
NOF

FLOAT
requests that the F

FLOAT variable be dropped from the Schedule data set when


resource-constrained scheduling is requested. This is the default behavior. To in-
clude the F

FLOAT variable in addition to the resource-constrained schedule, use


the F

FLOAT option. Note that if resource allocation is not performed, 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

FINISH variables. Note that the default is L

START. Also, if
resource allocation is not performed, the NOL

START option is ignored.


NORESOURCEVARS
NORESVARSOUT
NORESVARS
requests that the variables specied in the RESOURCE statement be dropped from
the Schedule data set. By default, all of the resource variables specied on the
RESOURCE statement are also included in the Schedule data set.
NOT

FLOAT
requests that the T

FLOAT variable be dropped from the Schedule data set when


resource-constrained scheduling is requested. This is the default behavior. To in-
clude the T

FLOAT variable in addition to the resource-constrained schedule, use


the T

FLOAT option. Note that if resource allocation is not performed, 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

variable in the Usage data set. It can be used in conjunction


with the ROUTINTPER= option to control the amount of information to be included
in the data set. Valid values for routinterval are DAY, WORKDAY, WEEK, MONTH,
WEEKDAY, QTR, YEAR, DTDAY, DTWRKDAY, DTWEEK, DTMONTH,
DTQTR, DTYEAR, DTSECOND, DTMINUTE, DTHOUR, SECOND, MINUTE,
or HOUR. The value of this parameter must be chosen carefully; a massive amount
of data could be generated by a bad choice. If this parameter is not specied, a
default value is chosen depending on the format of the schedule variables.
ROUTINTPER=routintper
STEPSIZE=routintper
STEP=routintper
species the number of routinterval units between successive observations in the
Usage data set where routinterval is the value of the ROUTINTERVAL= option. For
example, if routinterval is MONTH and routintper is 2, the time interval between each
pair of observations in the Usage data set is two months. The default value of routint-
per is 1. If routinterval is blank ( ), then routintper can be used to specify the exact
numeric interval between two successive values of the

TIME

variable in the Usage


data set. Note that routintper is only allowed to have integer values when routinter-
val is specied as one of the following: WEEK, MONTH, QTR, YEAR, DTWEEK,
DTMONTH, DTQTR, or DTYEAR.
ROUTNOBREAK
ROUTCONT
species that the

TIME

variable is to be incremented using a calendar with no


breaks or holidays. Thus, the Usage data set contains one observation per unit routin-
terval from mindate to maxdate, without any breaks for holidays or weekends. Note
that, by default, the

TIME

variable is incremented using the default calendar; thus,


if the default calendar follows a ve-day work week, the Usage data set skips week-
ends.
RSCHEDID=(variables)
RSID=(variables)
identies variables not specied in the TAILNODE, HEADNODE, or ACTIVITY
statements that are to be included in the Resource Schedule data set. This option
is useful for carrying any relevant information about each activity from the Activity
data set to the Resource Schedule data set.
102

Chapter 2. The CPM Procedure
SCHEDRULE=schedrule
RULE=schedrule
species the rule to be used to order the list of activities whose predecessor activi-
ties have been completed while scheduling activities subject to resource constraints.
Valid values for schedrule are LST, LFT, SHORTDUR, ACTPRTY, RESPRTY, and
DELAYLST. (See the Scheduling Rules section on page 133 for more informa-
tion.) The default value of SCHEDRULE is LST. If an invalid specication is given
for the SCHEDRULE= option, the default value is used, and a warning message is
displayed in the log.
SCHEDRULE2=schedrule2
RULE2=schedrule2
species the rule to be used to break ties caused by the SCHEDRULE= option.
Valid values for schedrule2 are LST, LFT, SHORTDUR, ACTPRTY, RESPRTY,
and DELAYLST. Note that ACTPRTY and RESPRTY cannot be specied at the
same time for the two scheduling rules; in other words, if schedrule is ACTPRTY,
schedrule2 cannot be RESPRTY and vice versa.
SPLITFLAG
indicates that activities are allowed to be split into segments during resource alloca-
tion. This option can be used instead of specifying either the MAXNSEGMT= or the
MINSEGMTDUR= variable; PROC CPM assumes that the activity can be split into
no more than ve segments.
STOPDATE=stdate
species the cutoff date for resource-constrained scheduling. When such a date
is specied, S

START and S

FINISH are set to missing beyond the cutoff date.


Options are available to set these missing values to the original E

START and
E

FINISH times (FILLUNSCHED) or to updated values based on the scheduled


activities (UPDTUNSCHED).
T

FLOAT
requests that the Schedule data set include the T

FLOAT variable computed using


the unconstrained early and late start schedules. Note that if resource allocation is
not performed, this variable is always included in the Schedule data set.
TOTUSAGE
INTXRATE
INTUSAGE
RATEXINT
species that the Usage data set is to indicate the total usage of the resource for
the current time period. The current time period is the time interval from the time
specied in the

TIME

variable for the current observation to the time specied in


the

TIME

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

FINISH values to missing for activities that are still


unscheduled when resource constrained scheduling is stopped either by the
STOPDATE= option or due to resource infeasibilities. This is the default and can be
turned off by specifying the FILLUNSCHED option.
UPDTUNSCHED
causes the procedure to use the S

START and S

FINISH times of scheduled ac-


tivities to update the projected start and nish times for the activities that are
still unscheduled when resource constrained scheduling is stopped either by the
STOPDATE= option or due to resource infeasibilities. These updated dates are used
as the 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

calendar information is expected to


be specied as
keyword

duration

calendar
where keyword is one of , FS, SS, SF, or FF, duration is a number specifying
the duration of the lag (in interval units), and calendar is either a calendar name or
number identifying the calendar followed by the lag duration. A missing value for
the keyword is assumed to mean the same as FS, which is the standard relation of
nish-to-start. The other three values, SS, SF, and FF, denote relations of the type
start-to-start, start-to-nish, and nish-to-nish, respectively. If there are no LAG
variables, all relationships are assumed to be of the type nish-to-start with no lag
duration. Table 2.19 contains some examples of lag specications.
Table 2.19. Lag Specications
Activity Successor LAG Interpretation
A B SS

3 Start to start lag of 3 units


A B

5.5 Finish to start lag of 5.5 units
A B FF

4 Finish to nish lag of 4 units


A B

SS Invalid and ignored (with warning)
A SS

3 Ignored
A B SS

1 Start to start lag of 3 units w.r.t. calendar 1


NLAGCAL=calnum
species the number of the calendar to be used for all lags. The default value for this
option is the DEFAULT calendar.
TAILNODE Statement
TAILNODE variable ;
TAIL variable ;
FROM variable ;
The TAILNODE statement is required when data are input in AOA (arrow notation)
format. It species the variable that contains the name of each node on the tail of
an arc in the project network. This node is identied with the event that signals the
start of the activity on that arc. The variable specied can be either a numeric or
character variable since the procedure treats this variable symbolically. Each node
must be uniquely dened.
Details

105
Details
This section provides a detailed outline of the use of the CPMprocedure. The material
is organized in subsections that describe different aspects of the procedure. They have
been placed in increasing order of functionality. The rst section describes how to
use PROC CPM to schedule a project subject only to precedence constraints. The
next two sections describe some of the features that enable you to control the units of
duration and specify nonstandard precedence constraints. In the Time-Constrained
Scheduling section on page 110, the statements needed to place time constraints on
the activities are introduced. The Finish Milestones section on page 111 describes
some options controlling the treatment of milestones.
The OUT= Schedule Data Set section on page 113 describes the format of the
schedule output data set (the Schedule data set). The Multiple Calendars section
on page 115 deals with calendar specications for the different activities.
The Baseline and Target Schedules section on page 121 describes how you can
save specic schedules as baseline or target schedules. The Progress Updating
section on page 122 describes how to incorporate the actual start and nish times for
a project that is already in progress. The Resource-Driven Durations and Resource
Calendars section on page 125 describes how the WORK variable can be used to
specify resource-driven durations and the effect of resource calendars on the activity
schedules.
Next, the Resource Usage and Allocation section on page 126 pertains to resource
usage and resource-constrained scheduling and describes how to specify information
about the resources and the resource requirements for the activities. The scheduling
algorithm is also described in this section and some advanced features such as alter-
nate resources, auxiliary resources, negative resource requirements, and so on, are
discussed under separate subsections.
The RESOURCEOUT= Usage Data Set section on page 142 describes the format
of the resource usage output data set (the Usage data set) and explains howto interpret
the variables in it.
When resource-driven durations are specied or resource calendars are in effect, each
resource used by an activity may have a different schedule. In this case, the Resource
Schedule data set, described in the RESOURCESCHED= Resource Schedule Data
Set section on page 145, contains the individual resource schedules for each activity.
The Multiproject Scheduling section on page 146 describes how you can use PROC
CPM when there are multiple projects that have been combined together in a multi-
project structure.
PROC CPM also denes a macro variable that is described in the Macro Variable

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) for all start activities (those


activities with no predecessors) in the project is set to be equal to the value of the
DATE parameter (if the FINISHBEFORE option is not specied). The early nish
time (E

FINISH) for each start activity is computed as E

START + dur , where dur


is the activitys duration (as specied in the Activity data set). For each of the other
activities in the network, the early start time is computed as the maximum of the early
nish time of all its immediate predecessors.
The project nish time is computed as the maximum of the early nish time of all the
activities in the network. The late nish time (L

FINISH) for all the nish activities


(those activities with no successors) in the project is set to be equal to the project
nish time. The late start time (L

START) is computed as L

FINISH dur. For


each of the other activities in the network, the late nish time is computed as the
minimum of the late start time of all its immediate successors. If the FIXFINISH
option is specied, the late nish time for each nish activity is set to be equal to its
early nish time. In other words, the nish activities are not allowed to oat to the
end of the project.
Once the early and late start schedules have been computed, the procedure computes
the free and total oat times for each activity. Free oat (F

FLOAT) is dened as
the maximum delay that can be allowed in an activity without delaying a successor
activity. Total oat (T

FLOAT) is calculated as the difference between the activitys


late nish time and early nish time; it indicates the amount of time by which an
activity can be delayed without delaying the entire project. The values of both the
oat variables are calculated in units of the INTERVAL parameter.
An activity that has zero T

FLOAT is said to be critical. As a result of the forward


and backward pass computations just described, there is at least one path in the project
Using the INTERVAL= Option

107
network that contains only critical activities. This path is called the critical path. The
duration of the project is equal to the length of the critical path.
If the FBDATE= option is also specied, the project nish time is set equal to the
value of the FBDATE= option. The backward pass computation is initiated by setting
the late nish time for all the nish activities in the project to be equal to fbdate. If
the project nish time, as computed from the forward pass calculations, is different
from fbdate, the longest path in the network may no longer have 0 total oat. In such
a situation, the critical path is dened to be the path in the network with the least total
oat. Activities with negative T

FLOAT are referred to as supercritical activities.


Note: An important requirement for a project network is that it should be acyclic (cy-
cles are not allowed). A network is said to contain a cycle (or loop) if the precedence
relationships starting from an activity loops back to the same activity. The forward
and backward pass computations cannot be performed for a cyclic network. If the
project network has a cycle, the CPM procedure stops processing after identifying
the cycle.
Using the INTERVAL= Option
The INTERVAL= option enables you to dene the units of the DURATION vari-
able; that is, you can indicate whether the durations are specied as hours, minutes,
days, or in terms of workdays, and so on. In addition to specifying the units, the
INTERVAL= option also indicates whether the schedule is to be output as SAS time,
date, or datetime values, or as unformatted numeric values.
The prex DT in the value of the INTERVAL= option (as in DTDAY, DTWEEK, and
so on) indicates to PROC CPM that the schedule is output as SAS datetime values,
and the DATE= option is expected to be a SAS datetime value. Thus, use DTYEAR,
DTMONTH, DTQTR, or DTWEEK instead of the corresponding YEAR, MONTH,
QTR, or WEEK if the DATE= option is specied as a SAS datetime value.
The start and nish times for the different schedules computed by PROC CPM denote
the rst and last day of work, respectively, when the values are formatted as SAS date
values. If the times are SAS time or datetime values, they denote the rst and last
second of work, respectively.
If the INTERVAL= option is specied as WORKDAY, the procedure schedules work
on weekdays and nonholidays starting at 9 a.m. and ending at 5 p.m. If you use
INTERVAL=DTWRKDAY, the procedure also schedules work only on weekdays
and nonholidays. In this case, however, the procedure expects the DATE= option
to be a SAS datetime value, and the procedure interprets the start of the workday
from the time portion of that option. To change the length of the workday, use the
DAYLENGTH= option in conjunction with INTERVAL=DTWRKDAY.
The procedure sets the default value of the INTERVAL= option on the basis of
the units of the DATE= option. Table 2.20 lists various valid combinations of the
INTERVAL= option and the type of the DATE= option (number, SAS time, date or
datetime value) and the resulting interpretation of the duration units and the format
type of the schedule variables (numbers, SAS time, date or datetime format) output
to the Schedule data set. For each DATE type value, the rst INTERVAL value is
108

Chapter 2. The CPM Procedure
the default. Thus, if the DATE= option is a SAS date value, the default value of the
INTERVAL= option is DAY, and so on.
For the rst ve specications of the INTERVAL= option in the last part of Table 2.20
(DTDAY , . . . , DTHOUR), the day starts at daystart and is daylength hours long.
Note that the procedure may change the INTERVAL= specication and the units
of the schedule variables to be compatible with the format specication of the
ALIGNDATE variable, or the A

START or A

FINISH variables in the Activity data


set, or the PERIOD variable in the Resource data set. For example, if interval is
specied as DAY, but the ALIGNDATE variable contains SAS datetime values, the
schedule is computed in SAS datetime values. Similarly, if interval is specied as
DAY or WEEKDAY, but some of the durations are fractional, the schedule is com-
puted as SAS datetime values.
Table 2.20. INTERVAL= and DATE= Parameters and Units of Duration
DATE Type INTERVAL Units of Duration Format of Schedule
Variables
number period unformatted
SAS time HOUR hour SAS time
MINUTE minute SAS time
SECOND second SAS time
SAS date DAY day SAS date
WEEKDAY day (5-day week) SAS date
WORKDAY day (5-day week: SAS datetime
9-5 day)
WEEK week SAS date
MONTH month SAS date
QTR quarter SAS date
YEAR year SAS date
SAS datetime DTDAY day (7-day week) SAS datetime
DTWRKDAY day (5-day week) SAS datetime
DTSECOND second SAS datetime
DTMINUTE minute SAS datetime
DTHOUR hour SAS datetime
DTWEEK week SAS datetime
DTMONTH month SAS datetime
DTQTR quarter SAS datetime
DTYEAR year SAS datetime
Nonstandard Precedence Relationships
A standard precedence constraint between two activities (for example, activity A
and an immediate successor B) implies that the second activity is ready to start as
soon as the rst activity has nished. Such a relationship is called a nish-to-start
relationship with zero lag. Often, you want to specify other types of relationships
between activities; for example,
Nonstandard Precedence Relationships

109
activity B can start ve days after activity A has started: start-to-start lag of
ve days
activity B can start three days after activity A has nished: nish-to-start lag
of three days.
The AON representation of the network enables you to specify such relationships be-
tween activities: use the LAG= option in the SUCCESSOR statement. This enables
you to use variables in the Activity data set that specify the type of relationship be-
tween two activities and the time lag between the two events involved; you can also
specify the calendar to be used in measuring the lag duration. See the SUCCESSOR
Statement section on page 103 for information on the specication. Example 2.11,
Non-Standard Relationships, in the Examples section illustrates a nonstandard
precedence relationship.
This section briey discusses how the computation of the early and late start sched-
ules, described in the Scheduling Subject to Precedence Constraints section on page
106, changes in the presence of nonstandard relationships.
For each (predecessor, successor) pair of activities, the procedure saves the lag type,
lag duration, and lag calendar information. Suppose that the predecessor is A, the
immediate successor is B, the durations of the two activities are durA and durB, re-
spectively, and the activitys early start and nish times are pes and pef, respectively.
Suppose further that the lag type is lt, lag duration is ld, and lag calendar is lc. Recall
that the basic forward and backward passes described in the Scheduling Subject to
Precedence Constraints section on page 106 assume that all the precedence con-
straints are standard of the type nish-to-start with zero lag. Thus, in terms of the
notation just dened, the early start time of an activity is computed as the maxi-
mum of pef for all the preceding activities. However, in the presence of nonstandard
relationships, the predecessors value used to compute an activitys early start time
depends on the lag type and lag value. Table 2.21 lists the predecessors value that is
used to determine the successors early start time.
Table 2.21. Effect of Lag Duration and Calendar on Early Start Schedule
Lag Type Denition Value Used to Compute Successors E

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 + dur). If nonstandard relationships


are present in the project, the predecessors value that is used depends on the type of
the lag and the lag duration; Table 2.21 in the previous section lists the values used
as a function of the lag type. If a target completion date is not specied (using the
FBDATE or FINISHBEFORE options), the project completion time is determined as
the maximum value of E

FINISH over all of the activities in the project. The late


nish time (L

FINISH) for each of the nish activities (those with no successors) is


Finish Milestones

111
computed as the minimum of its maxfdate and the project completion date; late start
time (L

START) is computed as L

FINISH dur. The late nish time (L

FINISH)
for each of the other activities in the network is computed as the minimum of its
maxfdate and the L

START times of all its successors.


It is important to remember that the precedence constraints of the network are always
respected (for these rst six alignment types). Thus, it is possible that an activity that
has an alignment constraint of the type SEQ, constraining it to start on a particular
date, say d, may not start on the specied date d due to its predecessors not being
nished before d. During resource-constrained scheduling, a further slippage in the
start date could occur due to insufcient resources. In other words, the precedence
constraints and resource constraints have priority over the time constraints (as im-
posed by the ALIGNDATE and ALIGNTYPE statements) in the determination of the
schedule of the activities in the network.
The last two alignment types, MS and MF, however, specify mandatory dates for
the start and nish times of the activities for both the early and late start schedules.
These alignment types can be used to schedule activities to start or nish on a given
date disregarding precedence and resource constraints. Thus, an activity with the
ALIGNTYPE variables value equal to MS and the ALIGNDATE variables value
equal to d is scheduled to start on d (for the early, late, and resource-constrained
schedules) irrespective of whether or not its predecessors are nished or whether or
not there are enough resources.
Note that it is possible for the L

START time of an activity to be less than its


E

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

FLOAT, indicating that these activities are supercritical.


See Example 2.12, Activity Time Constraints, for a demonstration of this situation.
Finish Milestones
By default, the start and nish times for the different schedules computed by PROC
CPM denote the rst and last day of work, respectively, when the values are formatted
as SAS date values. All start times are assumed to denote the beginning of the day and
all nish times are assumed to correspond to the end of the day. If the times are SAS
time or datetime values, they denote the rst and last second of work, respectively.
However, for zero duration activities, both the start and the nish times correspond to
the beginning of the date (or second) specied.
Thus, according to the preceding denitions, the CPM procedure assumes that all
milestones are scheduled at the beginning of the day indicated by their start times. In
other words, the milestones can be regarded as start milestones since they correspond
to the beginning of the time period indicated by their scheduled times.
However, in some situations, you may want to treat the milestones as nish mile-
stones.
Consider the following example:
112

Chapter 2. The CPM Procedure
Activity A has a 2-day duration and is followed by a milestone (zero duration) activ-
ity, B. Suppose that activity A starts on March 15, 2004. The default calculations
by the CPM procedure will produce the following schedule for the two activities:
OBS Activity Duration E_START E_FINISH
1 A 2 15MAR2004 16MAR2004
2 B 0 17Mar2004 17MAR2004
The start and nish times of the milestone activity, B, are interpreted as the begin-
ning of March 17, 2004. In some situations, you may want the milestones to start and
nish on the same day as their predecessors. For instance, in this example, you may
want the start and nish time of activity B to be set to March 16, 2004, with the
interpretation that the time corresponds to the end of the day. Such milestones will
be referred to as nish milestones.
The SETFINISHMILESTONE option in the PROC CPM statement indicates that a
milestone that is linked to its predecessor by a Finish-to-Start or a Finish-to-Finish
precedence constraint should be treated as a nish milestone. In other words, such
a milestone should have the start and nish time set to the end of the day that the
predecessor activity nishes. There are some exceptions to this rule:
There is an alignment constraint on activity B that requires the milestone to
start on a later day than the date dictated by the precedence constraint.
Activity B has an actual start or nish time specied that is inconsistent with
the predecessors nish date.
Note that the alignment constraint that affects the early schedule of the project may
not have any impact on the late schedule. Thus, a milestone may be treated as a nish
milestone for the late schedule even if it is not a nish milestone according to the
early schedule. See Example 2.28 for an illustration of this situation. In addition,
while computing the resource-constrained schedule, a start milestone (according to
the early schedule) may in fact turn out to be a nish milestone according to the
resource-constrained schedule.
Since the same milestone could be treated as either a start or a nish milestone de-
pending on the presence or absence of an alignment constraint, or depending on the
type of the schedule (early, late, resource-constrained, or actual), the CPM procedure
adds extra variables to the Schedule data set corresponding to each type of sched-
ule. These variables, EFINMILE, LFINMILE, SFINMILE, and AFINMILE, indicate
for each milestone activity in the project whether the corresponding schedule times
(early, late, resource-constrained, or actual) are to be interpreted as nish milestone
times. These variables have a value of 1 if the milestone is treated as a nish mile-
stone for the corresponding schedule; otherwise, the value is missing. In addition
to providing an unambiguous interpretation for the schedule times of the milestones,
these variables are useful in plotting the schedules correctly using the Gantt proce-
dure. (See Example 2.28).
OUT= Schedule Data Set

113
OUT= Schedule Data Set
The Schedule data set always contains the variables in the Activity data set that are
listed in the TAILNODE, HEADNODE, ACTIVITY, SUCCESSOR, DURATION,
and ID statements. If the INTPER= option is specied in the PROC CPM statement,
then the values of the DURATION variable in the Schedule data set are obtained by
multiplying the corresponding values in the Activity data set by intper. Thus, the
values in the Schedule data set are the durations used by PROC CPM to compute the
schedule. If the procedure is used without specifying a RESOURCEIN= data set and
only the unconstrained schedule is obtained, then the Schedule data set contains six
new variables named E

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

FINISH variables by specifying NOE

START and the omission of the L

START
and L

FINISH variables by specifying NOL

START in the RESOURCE statement.


The variables listed in the RESOURCE statement are also included in the Schedule
data set; to omit them, use the NORESOURCEVARS option in the RESOURCE
statement. If the DELAYANALYSIS option is specied, the Schedule data set also
includes the variables R

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

DUR, and STATUS.


The format of the schedule variables in this data set (namely, A

START, A

FINISH,
E

START, E

FINISH, L

START, and so on) is consistent with the format of the


DATE= specication and the INTERVAL= option in the PROC CPM statement.
Denitions of Variables in the OUT= Data Set
Each observation in the Schedule data set is associated with an activity. The variables
in the data set have the following meanings.
A

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

FLOAT=0. The values of this variable


are calculated in units of the INTERVAL= parameter.
If activity splitting is allowed during resource-constrained scheduling, the Schedule
data set may contain more than one observation corresponding to each observation
in the Activity data set. It will also contain the variable SEGMT

NO, which is ex-


plained in the Activity Splitting section on page 135.
If the PROJECT statement is used, some additional variables are added to the output
data set. See the Schedule Data Set section on page 149 for details.
Multiple Calendars
Work pertaining to a given activity is assumed to be done according to a particular
calendar. A calendar is dened here in terms of a work pattern for each day and a
work week structure for each week. In addition, each calendar may have holidays
during a given year.
You can associate calendars with Activities (using the CALID variable in the Activity
data set) or Resources (using observations with the keyword CALENDAR for the
OBSTYPE variable in the Resource data set).
PROC CPM enables you to dene very general calendars using the WORKDATA,
CALEDATA, and HOLIDATA data sets and options in the PROC CPM statement.
Recall that these data sets are referred to as the Workday, Calendar, and Holiday data
sets, respectively. The Workday data set species distinct shift patterns during a day.
The Calendar data set species a typical work week for any given calendar; for each
day of a typical week, it species the shift pattern that is followed. The 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,
or by specifying the start and end of the holiday period. The Activity data set (the
DATA= input data set) then species the calendar that is used by each activity in the
project through the CALID variable (or a default variable

CAL

). Each of the three


data sets used to dene calendars is described in greater detail later in this section.
Each new value for the CALID variable in either the Calendar data set or the Holiday
data set denes a new calendar. If a calendar value appears in the Calendar data set
and not in the Holiday data set, it is assumed to have the same holidays as the default
calendar (the default calendar is dened later in this section). If a calendar value
appears in the Holiday data set and not in the Calendar data set, it is assumed to have
the same work pattern structures (for each week and within each day) as the default
calendar. In the Activity data set, valid values for the CALID variable are those that
are dened in either the Calendar data set or the Holiday data set.
Cautions
The Holiday, Calendar, and Workday data sets and the processing of holidays and
different calendars are supported only when interval is DAY, WEEKDAY, DTDAY,
WORKDAY, DTWRKDAY, DTHOUR, DTMINUTE, or DTSECOND. PROC CPM
116

Chapter 2. The CPM Procedure
uses default specications whenever some information required to dene a calendar
is missing or invalid. The defaults have been chosen to provide consistency among
different types of specications and to correct for errors in input, while maintaining
compatibility with earlier versions of PROC CPM. You get a wide range of control
over the calendar specications, from letting PROC CPM dene a single calendar
entirely from defaults, to dening several calendars of your choice with precisely
dened work patterns for each day of the week and for each week. If the Calendar,
Workday, and Holiday data sets are used along with multiple calendar specications,
it is important to remember how all of the data sets and the various options interact
to form the work patterns for the different calendars.
Default Calendar
The default calendar is a special calendar that is dened by PROC CPM; its denition
and uses are explained in this subsection.
If there is no CALID variable and no Calendar and Workday data sets, the default
calendar is dened by interval and the DAYSTART= and DAYLENGTH= options in
the PROC CPM statement. If interval is DAY, DTDAY, DTHOUR, DTMINUTE or
DTSECOND, work is done on all seven days of the week; otherwise, Saturday and
Sunday are considered to be non-working days. Further, if the schedule is computed
as SAS datetime values, the length of the working day is determined by daystart and
daylength. All of the holidays specied in the Holiday data set refer to this default
calendar, and all of the activities in the project follow it. Thus, if there is no CALID
variable, the default calendar is the only calendar that is used for all of the activities
in the project.
If there is a CALID variable that identies distinct calendars, you can use an observa-
tion in the Calendar data set to dene the work week structure for the default calen-
dar. Use the value 0 (if CALID is a numeric variable) or the value DEFAULT (if
CALID is a character variable) to identify the default calendar. In the absence of such
an observation, the default calendar is dened by interval, daystart, and daylength, as
described earlier. The default calendar is used to substitute default work patterns for
missing values in the Calendar data set or to set default work week structures for
newly dened calendars in the Holiday data set.
WORKDATA Data Set
All numeric variables in the Workday data set are assumed to denote unique shift pat-
terns during one working day. For each variable the observations specify, alternately,
the times when consecutive shifts start and end. Suppose S1, S2, and S3 are numeric
variables formatted as TIME6. Consider the following Workday data:
S1 S2 S3
7:00 . 7:00 (start)
11:00 08:00 11:00 (end)
12:00 . . (start)
16:00 . . (end)
Multiple Calendars

117
The variables S1, S2, and S3 dene three different work patterns. A missing value
in the rst observation is assumed to be 0 (or 12:00 midnight); a missing value in
any other observation is assumed to denote 24:00 and ends the denition of the shift.
Thus, the workdays dened are:
S1 denes a workday starting at 7:00 a.m. and continuing until 4:00 p.m. with
an hour off for lunch from 11:00 a.m. until 12:00 noon.
S2 denes a workday from midnight to 8:00 a.m.
S3 denes a workday from 7:00 a.m. to 11:00 a.m.
The last two values for the variables S2 and S3 (both values are 24:00, by default)
are ignored. This data set can be used to dene all of the unique shift patterns that oc-
cur in any of the calendars in the project. These shift patterns are tied to the different
calendars in which they occur using the Calendar data set.
CALEDATA Data Set
The Calendar data set denes specic calendars using the names of the shift variables
in the Workday data set. You can use the variable specied in the CALID statement
or a variable named

CAL

to identify the calendar name or number. Character vari-


ables named

SUN

,

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

LENGTH can be specied in the Calendar data set to


dene the length of a standard working day for the specied calendar. If this variable
is not found in the Calendar data set, all calendars for the project are assumed to have
a standard daylength as dened by the default calendar.
For example, consider the following Calendar data:
_CAL_ _SUN_ _MON_ _TUE_ _FRI_ _SAT_ D_LENGTH
1 HOLIDAY S1 S1 S2 S3 8:00
2 HOLIDAY . . . HOLIDAY .
3 . . . . . .
These three observations dene three calendars: 1, 2, and 3. The values S1,
S2, and S3 refer to the shift variables dened in the WORKDATA Data Set
118

Chapter 2. The CPM Procedure
section on page 116. Activities in the project can followeither of these three calendars
or the default calendar.
Suppose daystart has been specied as 9:00 a.m. and daylength is eight hours.
Further, suppose that interval is DTDAY. Using these parameter specications, PROC
CPM denes the default calendar and calendars 1, 2 and 3 using the Calendar data
set just dened:
The default calendar (not specied explicitly in the Calendar data set) is dened
using interval, daystart, and daylength. It follows a seven-day week with each
day being an eight-hour day (from 9:00 a.m. to 5:00 p.m.). Recall that the
default calendar is dened to have seven or ve working days depending on
whether interval is DTDAY or WORKDAY, respectively.
Calendar 1 (dened in observation 1) has a holiday on Sunday; on Monday
and Tuesday work is done from 7:00 a.m. to 11:00 a.m. and then from 12:00
noon to 4:00 p.m.; work on Friday is done from 12:00 (midnight) to 8:00 a.m.;
work on Saturday is done from 7:00 a.m. to 11:00 a.m.; on other days work
is done from 9:00 a.m. to 5:00 p.m., as dened by the default calendar. The
value of D

LENGTH species the number of hours in a standard work day;


when durations of activities are specied in terms of number of workdays, then
the value of D

LENGTH is used as a multiplier to convert workdays to the


appropriate number of hours.
Calendar 2 (dened in observation 2) has holidays on Saturday and Sunday,
and on the remaining days, it follows the standard working day as dened by
the default calendar.
Calendar 3 (dened in observation 3) follows the same denition as the de-
fault calendar.
Note: If there are multiple observations in the Calendar data set identifying the same
calendar, all except the rst occurrence are ignored. The value 0 (if CALID is a
numeric variable) or the value DEFAULT (if CALID is a character variable) refers
to the default calendar. A missing value for the CALID variable is also assumed to
refer to the default calendar. Note that the Calendar data set can be used to dene the
default calendar also.
HOLIDATA Data Set
The HOLIDATA data set (referred to as the Holiday data set) denes holidays for
the different calendars that may be used in the project. Holidays are specied by
using the HOLIDAY statement. See the HOLIDAY statement earlier in this chapter
for a description of the syntax. This data set must contain a variable (the HOLIDAY
variable) whose values specify the start of each holiday. Optionally, the data set
may also contain a variable (the HOLIDUR variable) used to specify the length of
each holiday or another variable (the HOLIFIN variable) specifying the nish time
of each holiday. The variable specied by the CALID statement (or a variable named

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

and, hence, the holiday in this observation pertains


to all the calendars. As dened by the Holiday data, the holiday lists for the different
calendars (not including breaks due to shift denitions) are as shown in Table 2.23.
Note that, even though both calendars 2 and 3 have the same specications for
HOLISTA and HOLIDUR, the actual holiday periods are different for the two calen-
dars. For calendar 2, the three days starting from Thursday, January 29, imply that
the holidays are on Thursday, Friday, and Monday (because Saturday and Sunday are
already holidays). For calendar 3 (all seven days are working days), the holidays
are on Thursday, Friday, and Saturday.
120

Chapter 2. The CPM Procedure
Table 2.23. Holiday Denitions
Calendar Holiday Start Holiday End
0 24DEC03:09:00 26DEC03:16:59:59
1 24DEC03:09:00 26DEC03:07:59:59
01JAN04:00:00 01JAN04:07:59:59
2 24DEC03:09:00 26DEC03:16:59:59
19JAN04:09:00 19JAN04:16:59:59
29JAN04:09:00 02FEB04:16:59:59
3 24DEC03:09:00 26DEC03:16:59:59
29JAN04:09:00 31JAN04:16:59:59
You can use the GANTT procedure to visualize the breaks and holidays for the dif-
ferent calendar. Figure 2.4 shows all the breaks and holidays for the period between
Christmas and New Year. Holidays and breaks are denoted by *. Likewise, Figure
2.5 shows the vacation periods in January for calendars 2 and 3.
Christmas and New Year Holidays
DEC DEC DEC DEC DEC DEC
22 22 23 23 24 24
_cal_ 00:00 12:00 00:00 12:00 00:00 12:00
-+-----------+-----------+-----------+-----------+-----------+-
0 |*********--------****************--------********************|
1 |*******----*----***************----*----*********************|
2 |*********--------****************--------********************|
3 |*********--------****************--------********************|
-+-----------+-----------+-----------+-----------+-----------+-
Christmas and New Year Holidays
DEC DEC DEC DEC DEC DEC DEC
24 25 25 26 26 27 27
12:00 00:00 12:00 00:00 12:00 00:00 12:00
-+-----------+-----------+-----------+-----------+-----------+-----------+-
|*********************************************************************----|
|*******************************************************************----**|
|*************************************************************************|
|*********************************************************************----|
-+-----------+-----------+-----------+-----------+-----------+-----------+-
Christmas and New Year Holidays
DEC DEC DEC DEC DEC DEC DEC
27 28 28 29 29 30 30
12:00 00:00 12:00 00:00 12:00 00:00 12:00
-+-----------+-----------+-----------+-----------+-----------+-----------+-
|-----****************--------****************--------****************----|
|*******************************************----*----***************----*-|
|*********************************************--------****************----|
|-----****************--------****************--------****************----|
-+-----------+-----------+-----------+-----------+-----------+-----------+-
Christmas and New Year Holidays
DEC DEC DEC JAN JAN JAN JAN
30 31 31 01 01 02 02
12:00 00:00 12:00 00:00 12:00 00:00 12:00
-+-----------+-----------+-----------+-----------+-----------+-----------+-
|-----****************--------****************--------****************----|
|----*****************--------****************************************----|
|-----****************--------****************--------****************----|
|-----****************--------****************--------****************----|
-+-----------+-----------+-----------+-----------+-----------+-----------+-
Figure 2.4. Christmas and New Year Holidays for Multiple Calendars
Baseline and Target Schedules

121
Vacation Times for Calendars 2 and 3
JAN JAN JAN JAN JAN JAN JAN
18 18 19 19 20 20 21
_cal_ 00:00 12:00 00:00 12:00 00:00 12:00 00:00
-+-----------+-----------+-----------+-----------+-----------+-----------+-
2 |*********************************************************--------********|
3 |*********--------****************--------****************--------********|
-+-----------+-----------+-----------+-----------+-----------+-----------+-
Vacation Times for Calendars 2 and 3
JAN JAN JAN JAN JAN JAN JAN JAN
21 21 22 22 23 23 24 24
00:00 12:00 00:00 12:00 00:00 12:00 00:00 12:00
-+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-
|*********--------****************--------****************--------********************|
|*********--------****************--------****************--------****************----|
-+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-
Vacation Times for Calendars 2 and 3
JAN JAN JAN JAN JAN JAN JAN JAN
24 25 25 26 26 27 27 28
12:00 00:00 12:00 00:00 12:00 00:00 12:00 00:00
-+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-
|*********************************************--------****************--------********|
|-----****************--------****************--------****************--------********|
-+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-
Vacation Times for Calendars 2 and 3
JAN JAN JAN JAN JAN JAN JAN JAN
28 28 29 29 30 30 31 31
00:00 12:00 00:00 12:00 00:00 12:00 00:00 12:00
-+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-
|*********--------********************************************************************|
|*********--------********************************************************************|
-+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-
Vacation Times for Calendars 2 and 3
JAN FEB FEB FEB FEB FEB FEB FEB
31 01 01 02 02 03 03 04
12:00 00:00 12:00 00:00 12:00 00:00 12:00 00:00
-+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-
|*********************************************************************--------********|
|*********************--------****************--------****************--------********|
-+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-
Figure 2.5. Vacation Time for Calendars 2 and 3
Baseline and Target Schedules
An important aspect of project management is to examine the effects of changing
some of the parameters of the project on project completion time. For example,
you may want to examine different scenarios by changing the durations of some of
the activities, or increasing or decreasing the resource levels. To see the effect of
these changes, you need to compare the schedules corresponding to the changes. The
BASELINE statement enables you to save a particular schedule as a target schedule
and then compare a new schedule against that. See the BASELINE Statement
section on page 86 for a description of the syntax.
122

Chapter 2. The CPM Procedure
Progress Updating
Once a project has been dened with all of its activities and their relationships, the
durations, the resources needed, and so on, it is often useful to monitor its progress
periodically. During resource-constrained scheduling, it is useful to schedule only
activities that have not yet started, taking into consideration the activities that have
already been completed or scheduled and the resources that have already been used by
them or allotted for them. The ACTUAL statement is used in PROC CPM to convey
information about the current status of a project. As information about the activities
becomes available, it can be incorporated into the schedule of the project through
the specication of the actual start or nish times or both, the duration that is still
remaining for the activity, or the percentage of work that has been completed on an
activity. The specication of the progress variables and the options in the ACTUAL
statement have been described earlier in this chapter. This section describes how the
options work together and how some default values are determined.
The following options are discussed in this section:
the TIMENOW= option
the AUTOUPDT and NOAUTOUPDT options
the TIMENOWSPLT option
the progress variables (A

START, A

FINISH, REMDUR, and PCTCOMP)


The TIMENOW= option is specied in the ACTUAL statement. The value of the
TIMENOW= option (often referred to simply as TIMENOW) is used as a reference
point to resolve the values of the remaining duration and percent completion times.
All actual start and nish times specied are checked to ensure that they are less than
TIMENOW. If there is some inconsistency, a warning message is printed to the log.
If the ACTUAL statement is used, at least one of the four progress variables must be
specied. PROC CPM uses the nonmissing values for the progress variables in any
given observation to determine the information that is to be used for the activity. It is
possible that there are some inconsistencies in the specication of the values relating
to the progress information. For example, an activity may have valid values for both
the A

START and the A

FINISHvariables and also have the value of the PCTCOMP


variable less than 100. PROC CPM looks at the values in a specic order, resolving
inconsistencies in a reasonable manner. Further, PROC CPM determines revised
estimates of the durations of the activities on the basis of the actual information.
Suppose that for a given activity, as is the actual start, af is the actual nish, remdur
is the remaining duration, pctc is the percent complete, and dur is the duration of the
activity as specied by the values of the corresponding variables in the Activity data
set. (If a particular variable is not specied, assume that the corresponding value is
missing.)
The elapsed duration of an activity in progress is the time lapse between its actual
start and TIMENOW; the revised duration of the activity is the updated duration of
the activity that is used to calculate the projected nish time for activities in progress
Progress Updating

123
and the actual duration for activities that are completed. The revised duration is used
by PROC CPM to compute the updated schedule as described later in this section.
In the discussion that follows, as, af, remdur, and pctc refer to the actual start time,
actual nish time, remaining duration, and percent completed, respectively, for the
activity in the Activity data set, while 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

DUR is also set to this value; A

START is set to as and 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. But how about predecessors of the activity? If they


have missing values for A

START and A

FINISH, does it mean that there was an


error in the input of the actual dates or an error in the precedence constraints? The
AUTOUPDT and NOAUTOUPDT options enable you to control the answer to this
question. AUTOUPDT instructs CPM to automatically ll in appropriate 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 is not missing, the E

START time is set equal to A

START
during the forward pass, and the E

FINISH time is set equal to E

START +
the revised duration.
If A

START is missing, the E

START time is computed as before.


If A

FINISH or A

START is not missing, the L

FINISH time is set equal


to A

FINISH during the backward pass, and the L

START time is computed


on the basis of L

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

FLOAT are 0 for such activities.


Use the SHOWFLOAT option if you want to allownonzero oat for in-progress
or completed activities. In this case, the late start schedule is computed as
before, using the precedence constraints, so that you can determine the degree
of lateness for the activities that have already been completed or are in progress.
If E

START is less than TIMENOW for an activity (and thus it is also the
same as A

START), the activity is scheduled during resource allocation even


if there are not enough resources (a warning message is printed to the log if this
is the case). Thus, resource-constrained scheduling is done only for the period
starting from TIMENOW.
Note: The resources required by activities that are completed or in progress
are accounted for and the corresponding changes are made to the resource
availability prole before starting the constrained scheduling process at
TIMENOW.
If resource-constrained scheduling is being performed, the TIMENOWSPLT
option can be used. This option affects those activities that are currently
in progress that cause resource infeasibilities. The TIMENOWSPLT option
causes such activities to be split at TIMENOW into segments; the rst seg-
ment is assumed to be complete before TIMENOW, and the second segment is
delayed until sufcient resources are available.
The Schedule data set contains the actual start times (A

START) for all activities


that are in progress or completed and the actual nish times (A

FINISH) and the


actual duration times (A

DUR) for all activities that are completed. Some of these


values may have been derived from the percent completion or remaining duration
times in the Activity data set or may have been implicitly determined through the
AUTOUPDT option. Also included in the Schedule data set is a variable named
STATUS describing the status of each activity. The possible values are Completed,
In Progress, Infeasible, and Pending; the interpretations are self-evident.
If the ESTPCTC option is specied, the Schedule data set also contains a variable
named PCT

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, as calculated in this step). Set time=min(e

start), where the


minimum is taken over all the activities in the network.
2. All of the activities whose e

start values coincide with time are arranged in a


waiting list that is sorted according to the rule specied in the SCHEDRULE=
132

Chapter 2. The CPM Procedure
option. (See the Scheduling Rules section on page 133 for details on the
valid values of this option.) The SCHEDRULE2= option can be used to break
ties. PROC CPM tries to schedule the activities in the same order as on this
list. For each activity the procedure checks to see if the required amount of
each resource will be available throughout the activitys duration; if enough
resources are available, the activity is scheduled to start at time. Otherwise,
the resource availability prole is examined to see if there is likely to be an
increase in resources in the future. If none is perceived until l

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 + delay, and the activity


cannot be scheduled (even using supplementary resources), PROC CPM stops
with an error message, giving a partial schedule. You can also specify a cut-off
date (using the STOPDATE= option) when resource constrained scheduling is
to stop.
Note that once an activity that uses a supplementary level of a replenishable re-
source is over, the supplementary level that was used is returned to the reservoir
and is not used again until needed. For consumable resources, if supplemen-
tary levels were used on a particular date, PROC CPM attempts to bring the
reservoir back to the original level at the earliest possible time. In other words,
the next time the primary availability of the resource increases, the reservoir is
rst used to replenish the supplementary level of the resource. (See Example
2.16, Using Supplementary Resources). Adjustment is made to the resource
availability prole to account for any activity that is scheduled to start at time.
3. All of the activities in the waiting list that were unable to be scheduled in Step
2 are postponed and are tentatively scheduled to start at the time when the next
change takes place in the resource availability prole (that is, their e

start is
set to the next change date in the availability of resources). time is advanced to
the minimum e

start time of all unscheduled activities.


Steps 1, 2, and 3 are repeated until all activities are scheduled or the procedure stops
with an error message.
Resource Usage and Allocation

133
Some important points to keep in mind are:
Holidays and other non-working times are automatically accounted for in the
process of resource allocation. Do not specify zero availabilities for the re-
sources on holidays; PROC CPM accounts for holidays and weekends during
resource allocation just as in the unrestricted case.
It is assumed that the activities cannot be interrupted once they are started,
unless one of the splitting options is used. See the Activity Splitting section
on page 135 for details.
Scheduling Rules
The SCHEDRULE= option species the criterion to use for determining the order
in which activities are to be considered while scheduling them subject to resource
constraints. As described in the Scheduling Method section on page 131, at a
given time specied by time, all activities whose tentative e

start coincides with


time are arranged in a list ordered according to the scheduling rule, schedrule. The
SCHEDRULE2= option can be used to break ties caused by the SCHEDRULE= op-
tion; valid values for schedrule2 are the same as for schedrule. However, if schedrule
is ACTPRTY, then schedrule2 cannot be RESPRTY, and vice versa.
The following is a list of the six valid values of schedrule, along with a brief descrip-
tion of their respective effects.
ACTPRTY
species that PROC CPM should sort the activities in the waiting list in the order
of increasing values of the variable specied in the ACTIVITYPRTY= option in the
RESOURCE statement. This variable species a user-assigned priority to each activ-
ity in the project (low value of the variable indicates high priority).
Note: If SCHEDRULE is specied as ACTPRTY, the RESOURCE statement must
contain the specication of the variable in the Activity data set that assigns priorities
to the activities; if the variable name is not specied through the ACTIVITYPRTY=
option, then CPM ignores the specication for the SCHEDRULE= option and uses
the default scheduling rule, LST, instead.
DELAYLST
species that the activities in the waiting list are sorted in the order of increasing
L

START + ACTDELAY, where ACTDELAY is the value of the ACTDELAY vari-


able for that activity.
LFT
species that the activities in the waiting list are sorted in the order of increasing
L

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 (segment number). If splitting does occur, the Schedule data


set has more observations than the Activity data set. Activities that are not split are
treated as before, except that the value of the variable 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

FINISH times are set to be equal to the start and nish


times, respectively, of the entire activity. That is, S

START is equal to the scheduled


start time of the rst segment, and S

FINISH is equal to the scheduled nish time of


the last segment that the activity is split into. Following this observation, there are
as many observations as the number of disjoint segments in the activity. All values
for these additional observations are the same as the corresponding values for the
rst observation for this activity, except for the variables SEGMT

NO, S

START,
S

FINISH, and the DURATION variable. SEGMT

NO is the index of the segment,


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). Thus, in the


preceding example, John can be one of the multiple alternates when substituting for
himself. To exclude John from the list, set the value of the variable JOHN to 0 in
observation 2. Note that you will also need to set the value of JOHN to 0 in any
observation with OBSTYPE=ALTPRTY and 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

that species the date


for which the resource usage or availability in the observation is valid. For each of the
variables specied in the RESOURCE statement, one, two, three, or four new vari-
ables are created depending on how many of the four possible options (AVPROFILE,
ESPROFILE, LSPROFILE, and RCPROFILE) are in effect. If none of these four
options is specied, the ALL option is assumed to be in effect. Recall that the ALL
option is equivalent to specifying ESPROFILE and LSPROFILE when PROC CPM
is used to obtain an unconstrained schedule, and it is equivalent to specifying all four
options when PROC CPM is used to obtain a resource-constrained schedule.
The new variables are named according to the following convention:
The prex A is used for the variable describing the resource availability prole.
The prex E is used for the variable denoting the early start usage.
The prex L is used for the variable denoting the late start usage.
The prex R is used for the variable denoting the resource-constrained usage.
The sufx is the name of the resource variable if the name is less than the maximum
possible variable length (which is dependent on the VALIDVARNAME option). If the
length of the name is equal to this maximum length, the sufx is formed by deleting
the character following the (n/2)th position. The user must ensure that this naming
convention results in unique variable names in the Usage data set.
The ROUTINTERVAL=routinterval and ROUTINTPER=routintper options specify
that two successive values of the

TIME

variable differ by routintper number of


routinterval units, measured with respect to a specic calendar. If the routinterval is
not specied, PROCCPMchooses a default value depending on the format of the start
and nish variables in the Schedule data set. The value of routinterval is indicated in
a message written to the SAS log.
The MINDATE=mindate and MAXDATE=maxdate options specify the minimum
and maximum values of the

TIME

variable, respectively. Thus, the Usage data set


has observations containing the resource usage information from mindate to maxdate
with the time interval between the values of the

TIME

variable in two successive


observations being equal to routintper units of routinterval, measured with respect to a
specic calendar. For example, if routinterval is MONTH and routintper is 3, then the
time interval between successive observations in the Usage data set is three months.
RESOURCEOUT= Usage Data Set

143
The calendar used for incrementing the

TIME

variable is specied using the


AROUTCAL= or NROUTCAL= options depending on whether the calendars for
the project are specied using alphanumeric or numeric values, respectively. In the
absence of either of these specications, the default calendar is used. For example, if
the default calendar follows a ve-day work week and ROUTINTERVAL=DAY, the
Usage data set will not contain observations corresponding to Saturdays and Sundays.
You can also use the ROUTNOBREAK option to indicate that there should be no
breaks in the

TIME

values due to breaks or holidays.


Interpretation of Variables
The availability prole indicates the amount of resources available at the beginning of
the time interval specied in the

TIME

variable, after accounting for the resources


used through the previous time period.
By default, each observation in the Resource Usage data set indicates the rate of
resource usage per unit routinterval at the start of the time interval specied in the

TIME

variable. Note that replenishable resources are assumed to be tied to an


activity during any of the activitys breaks or holidays that fall in the course of the
activitys duration. For consumable resources, you can use the CUMUSAGE option
to obtain cumulative usage of the resource, instead of daily rate of usage. Often, it is
more useful to obtain cumulative usage for consumable resources.
You can use the TOTUSAGE option on the RESOURCE statement to get the total
resource usage for each resource within each time period. If you wish to obtain both
the rate of usage and the total usage for each time period, use the APPEND option
on the RESOURCE statement.
The following example illustrates the default interpretation of the new variables.
Suppose that for the data given earlier (see the Specifying Resource Requirements
section on page 130), activities A and B have S

START equal to 1JUL04 and


5JUL04, respectively. If the RESOURCE statement has the options AVPROFILE and
RCPROFILE, the Usage data set has these ve variables,

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

in each observation. That is why, for example, RBRICKS = 0 on 1JUL04


and not 200.
If the procedure uses supplementary levels of resources, then, on a day when sup-
plementary levels of resources were used through the beginning of the day, the
value for the availability prole for the relevant resources would be negative. The
absolute magnitude of this value would denote the amount of supplementary re-
source that was used through the beginning of the day. For instance, if ABRICKS
is 100 on 11JUL04, it would indicate that 100 bricks from the supplementary
reservoir were used through the end of July 10, 2004. See Example 2.16, Using
Supplementary Resources, and Example 2.17, INFEASDIAGNOSTIC Option and
Aggregate Resource Type.
If, for the same data, ROUTINTPER is 2, and the APPEND option is specied, the
Usage data set would contain two sets of observations, the rst indicating the rate
of resource usage per day, and the second set indicating the product of the rate and
the time interval between two successive observations. The observations (ve in each
set) would be as follows:
_TIME_ OBS_TYPE RWORKERS RBRICKS
01JUL04 RES_RATE 0 100
03JUL04 RES_RATE 0 100
05JUL04 RES_RATE 2 100
07JUL04 RES_RATE 2 0
09JUL04 RES_RATE 0 0
01JUL04 RES_USED 0 200
03JUL04 RES_USED 0 200
05JUL04 RES_USED 4 100
07JUL04 RES_USED 4 0
09JUL04 RES_USED 0 0
RESOURCESCHED= Resource Schedule Data Set

145
Variable Usage Prole for Consumable Resources
For consumable resources that have a variable usage prole (as indicated by the val-
ues 1 or 2 for observations of type RESUSAGE in the Resource data set), the values
of the usage variables indicate the amount of the resource consumed by an activity at
the beginning or end of the activity. For example, consider the resources PAYMENT
and ADVANCE specied in the following Resource data set:
OBS OBSTYPE DATE WORKERS BRICKS PAYMENT ADVANCE
1 RESTYPE . 1 2 2 2
2 RESUSAGE . . . 2 1
3 RESLEVEL 1JUL2004 4 1000 2000 500
Suppose the activity Task 1, specied in the following observation, is scheduled to
start on July 1, 2004:
OBS ACTIVITY DUR WORKERS BRICKS PAYMENT ADVANCE
1 Task 1 5 1 100 1000 200
For these data, the resource usage prole for the resources will be as indicated in the
following output:
_TIME_ RWORKERS RBRICKS RPAYMENT RADVANCE
1JUL04 1 100 0 200
2JUL04 1 100 0 0
3JUL04 1 100 0 0
4JUL04 1 100 0 0
5JUL04 1 100 0 0
6JUL04 0 0 1000 0
RESOURCESCHED= Resource Schedule Data Set
The Resource Schedule data set (requested by the RESSCHED= option on the CPM
statement) is very similar to the Schedule data set, and it contains the start and nish
times for each resource used by each activity. The data set contains the variables
listed in the ACTIVITY, TAILNODE, and HEADNODE statements and all the rele-
vant schedule variables (E

START, E

FINISH, and so forth). For each activity in the


project, this data set contains the schedule for the entire activity as well as the sched-
ule for each resource used by the activity. The variable RESOURCE identies the
name of the resource to which the observation refers; the value of the RESOURCE
variable is missing for observations that refer to the entire activitys schedule. The
variable DUR

TYPE indicates whether the resource is a driving resource or a span-


ning resource or whether it is of the xed type.
A variable

DUR

indicates the duration of the activity for the resource identied in


that observation. This variable has missing values for resources that are of the span-
ning type. For resources that are of the driving type, the variable

WORK

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

FINISH for the supertask is initialized to this value. If the SEPCRIT


option is specied, the supertasks late nish time is initialized to its early nish
time. If the USEPROJDUR option is specied, the late nish time for the supertask
is initialized using the early start time of the supertask and the specied supertask
duration. Note that the late nish time of the supertask could further be affected by
the precedence constraints. Once a supertasks late nish has been determined, this
value is treated as an upper bound on the late nish of all its subtasks.
As with the early start schedule, once all the subtasks have been scheduled, the late
start and nish times for a supertask are set to the minimum late start and maximum
late nish time, respectively, of all its subtasks.
Macro Variable

ORCPM


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

DUR and PROJ

LEV.
The PROJ

DUR variable contains the project duration (computed as


E

FINISH - E

START of the project) for each superproject in the master


project. This variable has missing values for the leaf tasks. Note that it is possible
for (L

FINISH - L

START) to be different from the value of PROJ

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

LEV = 0; note that if the


project does not have a single root, a common root is dened by the CPM procedure.
The ADDACT option on the PROC CPM statement causes an observation to be
added to the Schedule data set for this common root. This observation contains the
project start and nish times and the project duration. The ADDACT option also
adds an observation for any activity that may appear as a value of the SUCCESSOR
or PROJECT variable without appearing as a value of the ACTIVITY variable.
In addition to the PROJ

DUR and PROJ

LEV variables, you can request that a WBS


code be added to the output data set (using the option ADDWBS). You can also add
variables, ES

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

The CPM procedure denes a macro variable named



ORCPM

. This variable con-


tains a character string that indicates the status of the procedure. It is set at procedure
termination. The form of the

ORCPM

character string is STATUS= REASON=,


where STATUS= is either SUCCESSFUL or ERROR

EXIT and REASON= (if


PROC CPM terminated unsuccessfully) can be one of the following:
CYCLE
RES

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

LENGTH Length of standard


names work day

SUN

Work pattern on day of


. . . week, valid values:

SAT

WORKDAY, HOLIDAY, or one


of the numeric variables
in the Workday data set
DATA ACTIVITY ACTIVITY Activity in AON format
ACTUAL A

START Actual start time of activity


A

FINISH Actual nish time of activity


REMDUR Remaining duration
PCTCOMP Percentage of work
completed
ALIGNDATE ALIGNDATE Time constraint on
activity
ALIGNTYPE ALIGNTYPE Type of time constraint,
valid values: SGE, SEQ,
SLE, FGE, FEQ, FLE, MS,
MF
BASELINE B

START Baseline start time


of activity
B

FINISH Baseline nish time


of activity
CALID CALID Calendar followed by
activity
Input Data Sets and Related Variables

151
Table 2.24. (continued)
Data Set Statement Variable Name Interpretation
DURATION DURATION Duration of activity
FINISH Finish time of activity
START Start time of activity
HEADNODE HEADNODE Head of arrow (arc) in
AOA format
ID ID Additional project
information
PROJECT PROJECT Project to which activity
belongs
RESOURCE ACTDELAY Activity delay
ACTPRTY Activity priority
MAXNSEGMT Maximum number of
segments
MINSEGMTDUR Minimum duration of a
segment
RESOURCE Amount of resource
required
WORK Amount of work required
SUCCESSOR SUCCESSOR Successor in AON format
LAG Nonstandard precedence
relationship
TAILNODE TAILNODE Tail of arrow (arc) in
AOA format
HOLIDATA CALID CALID Calendar to which
holiday applies
HOLIDAY HOLIDAY Start of holiday
HOLIDUR Duration of holiday
HOLIFIN End of holiday
RESOURCEIN RESOURCE OBSTYPE Type of observation;
valid values: RESLEVEL,
RESTYPE, SUPLEVEL,
RESPRTY, ALTRATE,
ALTPRTY, RESUSAGE,
AUXRES, MULTALT,
MINARATE, CALENDAR
PERIOD Time from which resource
is available
RESID Resource for which
152

Chapter 2. The CPM Procedure
Table 2.24. (continued)
Data Set Statement Variable Name Interpretation
alternates are given
RESOURCE Resource type, priority,
availability, alternate
rate, alternate priority
WORKDATA Any numeric On-off pattern of work
variable (shift denition)
Missing Values in Input Data Sets
The following table summarizes the treatment of missing values for variables in the
input data sets used by PROC CPM.
Table 2.25. Treatment of Missing Values in the CPM Procedure
Data Set Variable Value Used / Assumption Made /
Action Taken
CALEDATA CALID default calendar (0 or DEFAULT)
D

LENGTH DAYLENGTH, if available.


8:00, if INTERVAL = WORKDAY, DTWRKDAY
24:00, otherwise

SUN

corresponding shift for default


. . . calendar

SAT

DATA ACTIVITY input error: procedure stops with error message


ACTDELAY DELAY= specication
ACTPRTY innity (indicates lowest priority)
ALIGNDATE project start date for start activity
ALIGNTYPE SGE: if ALIGNDATE is not missing
A

FINISH see Progress Updating for details


A

START see Progress Updating for details


B

FINISH updated if UPDATE= option is on


B

START updated if UPDATE= option is on


CALID default calendar (0 or DEFAULT)
DURATION input error: procedure stops with error message
FINISH value ignored
HEADNODE input error: procedure stops with error message
ID missing
LAG FS

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

, and a single observation identifying Sunday as a


holiday. The DATA step creating CALENDAR and the invocation of PROC CPM is
shown in the following code. Output 2.9.2 displays the resulting schedule.
/* Set up a 6-day work week, with Sundays off */
data calendar;
_sun_=holiday;
run;
title Scheduling on the 6-Day Week;
proc cpm data=widget9 holidata=holidays
out=savec date=1dec03:07:00dt
interval=dtday daylength=08:30t
calendar=calendar;
activity task;
succ succ1 succ2 succ3;
duration days;
holiday holiday / holifin=(holifin);
run;
Example 2.9. CALEDATA and WORKDATA Data Sets

181
Output 2.9.2. Scheduling on the Six-Day Week
Scheduling on the 6-Day Week
Project Schedule
Obs task days E_START E_FINISH
1 Approve Plan 5.5 01DEC03:07:00:00 06DEC03:11:14:59
2 Drawings 10.0 06DEC03:11:15:00 18DEC03:11:14:59
3 Anal. Market 5.0 06DEC03:11:15:00 12DEC03:11:14:59
4 Write Specs 4.5 06DEC03:11:15:00 11DEC03:15:29:59
5 Prototype 15.0 18DEC03:11:15:00 09JAN04:11:14:59
6 Mkt. Strat. 10.0 12DEC03:11:15:00 27DEC03:11:14:59
7 Materials 10.0 09JAN04:11:15:00 21JAN04:11:14:59
8 Facility 10.0 09JAN04:11:15:00 21JAN04:11:14:59
9 Init. Prod. 10.0 21JAN04:11:15:00 02FEB04:11:14:59
10 Evaluate 10.0 02FEB04:11:15:00 13FEB04:11:14:59
11 Test Market 15.0 02FEB04:11:15:00 19FEB04:11:14:59
12 Changes 5.0 19FEB04:11:15:00 25FEB04:11:14:59
13 Production 0.0 25FEB04:11:15:00 25FEB04:11:15:00
14 Marketing 0.0 02FEB04:11:15:00 02FEB04:11:15:00
Obs L_START L_FINISH T_FLOAT F_FLOAT
1 01DEC03:07:00:00 06DEC03:11:14:59 0.0 0.0
2 06DEC03:11:15:00 18DEC03:11:14:59 0.0 0.0
3 15JAN04:11:15:00 21JAN04:11:14:59 30.0 0.0
4 13DEC03:07:00:00 18DEC03:11:14:59 5.5 5.5
5 18DEC03:11:15:00 09JAN04:11:14:59 0.0 0.0
6 21JAN04:11:15:00 02FEB04:11:14:59 30.0 30.0
7 09JAN04:11:15:00 21JAN04:11:14:59 0.0 0.0
8 09JAN04:11:15:00 21JAN04:11:14:59 0.0 0.0
9 21JAN04:11:15:00 02FEB04:11:14:59 0.0 0.0
10 07FEB04:11:15:00 19FEB04:11:14:59 5.0 5.0
11 02FEB04:11:15:00 19FEB04:11:14:59 0.0 0.0
12 19FEB04:11:15:00 25FEB04:11:14:59 0.0 0.0
13 25FEB04:11:15:00 25FEB04:11:15:00 0.0 0.0
14 25FEB04:11:15:00 25FEB04:11:15:00 20.0 20.0
Suppose now that you want to schedule work on a ve-and-a-half day week (ve full
working days starting on Monday and half a working day on Saturday). A full work
day is from 8 a.m. to 4 p.m. Output 2.9.3 shows the data set WORKDAT, which
is used to dene the work pattern for a full day (in the shift variable fullday and a
half-day (in the shift variable halfday). Output 2.9.4 displays the Calendar data set,
CALDAT, which species the appropriate work pattern for each day of the week. The
schedule produced by invoking the following program is displayed in Output 2.9.5.
proc cpm data=widget9 holidata=holidays
out=savecw date=1dec03d
interval=day
workday=workdat calendar=caldat;
activity task;
succ succ1 succ2 succ3;
duration days;
holiday holiday / holifin=(holifin);
run;
182

Chapter 2. The CPM Procedure
Output 2.9.3. Workday Data Set
Scheduling on a Five-and-a-Half-Day Week
Workdays Data Set
Obs fullday halfday
1 8:00 8:00
2 16:00 12:00
Output 2.9.4. Calendar Data Set
Scheduling on a Five-and-a-Half-Day Week
Calendar Data Set
Obs _sun_ _mon_ _tue_ _wed_ _thu_ _fri_ _sat_ d_length
1 holiday fullday fullday fullday fullday fullday halfday 8:00
Output 2.9.5. Scheduling on a Five-and-a-Half Day Week
Scheduling on a Five-and-a-Half-Day Week
Project Schedule
Obs task days E_START E_FINISH
1 Approve Plan 5.5 01DEC03:08:00:00 06DEC03:11:59:59
2 Drawings 10.0 08DEC03:08:00:00 19DEC03:11:59:59
3 Anal. Market 5.0 08DEC03:08:00:00 12DEC03:15:59:59
4 Write Specs 4.5 08DEC03:08:00:00 12DEC03:11:59:59
5 Prototype 15.0 19DEC03:12:00:00 13JAN04:11:59:59
6 Mkt. Strat. 10.0 13DEC03:08:00:00 30DEC03:11:59:59
7 Materials 10.0 13JAN04:12:00:00 26JAN04:11:59:59
8 Facility 10.0 13JAN04:12:00:00 26JAN04:11:59:59
9 Init. Prod. 10.0 26JAN04:12:00:00 06FEB04:15:59:59
10 Evaluate 10.0 07FEB04:08:00:00 19FEB04:15:59:59
11 Test Market 15.0 07FEB04:08:00:00 26FEB04:11:59:59
12 Changes 5.0 26FEB04:12:00:00 03MAR04:15:59:59
13 Production 0.0 04MAR04:08:00:00 04MAR04:08:00:00
14 Marketing 0.0 07FEB04:08:00:00 07FEB04:08:00:00
Obs L_START L_FINISH T_FLOAT F_FLOAT
1 01DEC03:08:00:00 06DEC03:11:59:59 0.0 0.0
2 08DEC03:08:00:00 19DEC03:11:59:59 0.0 0.0
3 20JAN04:08:00:00 26JAN04:11:59:59 30.0 0.0
4 15DEC03:08:00:00 19DEC03:11:59:59 5.5 5.5
5 19DEC03:12:00:00 13JAN04:11:59:59 0.0 0.0
6 26JAN04:12:00:00 06FEB04:15:59:59 30.0 30.0
7 13JAN04:12:00:00 26JAN04:11:59:59 0.0 0.0
8 13JAN04:12:00:00 26JAN04:11:59:59 0.0 0.0
9 26JAN04:12:00:00 06FEB04:15:59:59 0.0 0.0
10 13FEB04:12:00:00 26FEB04:11:59:59 5.0 5.0
11 07FEB04:08:00:00 26FEB04:11:59:59 0.0 0.0
12 26FEB04:12:00:00 03MAR04:15:59:59 0.0 0.0
13 04MAR04:08:00:00 04MAR04:08:00:00 0.0 0.0
14 04MAR04:08:00:00 04MAR04:08:00:00 20.0 20.0
Example 2.9. CALEDATA and WORKDATA Data Sets

183
Note that, in this case, it was not necessary to specify the DAYLENGTH=,
DAYSTART=, or INTERVAL= option in the PROC CPM statement. The default
value of INTERVAL=DAY is assumed, and the CALDAT and WORKDAT data sets
dene the workday and work week completely. The length of a standard working day
is also included in the Calendar data set, completing all the necessary specications.
To visualize the breaks in the work schedule created by these specications, you
can use the following simple data set with a dummy activity Schedule Breaks to
produce a Gantt chart, shown in Output 2.9.6. The period illustrated on the chart is
from December 19, 2003 to December 27, 2003. The breaks are denoted by *.
/* To visualize the breaks, use following "dummy" data set
to plot a schedule bar showing holidays and breaks */
data temp;
e_start=19dec03:08:00dt;
e_finish=27dec03:23:59:59dt;
task=Schedule Breaks;
label task=Project Calendar;
format e_start e_finish datetime16.;
run;
options ps=20;
title2 Holidays and Breaks in the Project Calendar;
proc gantt data=temp lineprinter
calendar=caldat holidata=holidays
workday=workdat;
chart / interval=dtday mininterval=dthour skip=0
holiday=(holiday) holifin=(holifin) markbreak
nojobnum nolegend increment=8 holichar=*;
id task;
run;
184

Chapter 2. The CPM Procedure
Output 2.9.6. Gantt Chart Showing Breaks and Holidays
Scheduling on a Five-and-a-Half-Day Week
Holidays and Breaks in the Project Calendar
DEC DEC DEC DEC DEC DEC
Project 19 19 20 20 20 21
Calendar 08:00 16:00 00:00 08:00 16:00 00:00
-+-------+-------+-------+-------+-------+-
Schedule Breaks |<-------****************----*************|
-+-------+-------+-------+-------+-------+-
Scheduling on a Five-and-a-Half-Day Week
Holidays and Breaks in the Project Calendar
DEC DEC DEC DEC DEC DEC DEC DEC
21 21 21 22 22 22 23 23
00:00 08:00 16:00 00:00 08:00 16:00 00:00 08:00
-+-------+-------+-------+-------+-------+-------+-------+-
|********************************--------****************-|
-+-------+-------+-------+-------+-------+-------+-------+-
Scheduling on a Five-and-a-Half-Day Week
Holidays and Breaks in the Project Calendar
DEC DEC DEC DEC DEC DEC DEC DEC
23 23 24 24 24 25 25 25
08:00 16:00 00:00 08:00 16:00 00:00 08:00 16:00
-+-------+-------+-------+-------+-------+-------+-------+-
|--------*************************************************|
-+-------+-------+-------+-------+-------+-------+-------+-
Scheduling on a Five-and-a-Half-Day Week
Holidays and Breaks in the Project Calendar
DEC DEC DEC DEC DEC DEC DEC DEC
25 26 26 26 27 27 27 28
16:00 00:00 08:00 16:00 00:00 08:00 16:00 00:00
-+-------+-------+-------+-------+-------+-------+-------+-
|****************************************----*************|
-+-------+-------+-------+-------+-------+-------+-------+-
Example 2.10. Multiple Calendars
This example illustrates the use of multiple calendars within a project. Different sce-
narios are presented to show the use of different calendars and how project schedules
are affected. Output 2.10.1 shows the data set WORKDATA, which denes several
shift patterns. These shift patterns are appropriately associated with three different
calendars in the data set CALEDATA, also shown in the same output. The three cal-
endars are dened as follows:
The DEFAULT calendar has ve eight-hour days (Monday through Friday) and
holidays on Saturday and Sunday.
The calendar OVT

CAL species an overtime calendar that has 10-hour work


days on Monday through Friday and a half day on Saturday and a holiday on
Sunday.
The calendar PROD

CAL follows a more complicated work pattern: Sunday


is a holiday; on Monday work is done from 8 a.m. through midnight with a
two hour break from 6 p.m. to 8 p.m.; on Tuesday through Friday work is done
round the clock with two 2-hour breaks from 6 a.m. to 8 a.m. and 6 p.m. to 8
Example 2.10. Multiple Calendars

185
p.m.; on Saturday the work shifts are from midnight to 6 a.m. and again from
8 a.m. to 6 p.m. In other words, work is done continuously from 8 a.m. on
Monday morning to 6 p.m. on Saturday with two hour breaks every day at 6
a.m. and 6 p.m.
Output 2.10.1. Workday and Calendar 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 . . . . . .
Multiple Calendars
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
The same set of holidays is used as in Example 2.9, except that in this case the hol-
iday for New Years is dened by specifying both the start and nish time for the
holiday instead of defaulting to a one-day long holiday. When multiple calendars are
involved, it is often less confusing to dene holidays by specifying both a start and
a nish time for the holiday instead of the start time and duration. Output 2.10.2
displays the Holiday data set.
Output 2.10.2. Holiday Data Set
Multiple Calendars
Holidays Data Set
Obs holiday holifin holidur
1 24DEC03 26DEC03 4
2 01JAN04 01JAN04 .
Note that the data set HOLIDAYS does not include any variable identifying the cal-
endars with which to associate the holidays. By default, the procedure associates the
two holiday periods with all the calendars.
An easy way to visualize all the breaks and holidays for each calendar is to use a
Gantt chart, plotting a bar for each calendar from the start of the project to January
4, 2004, with all the holiday and work shift specications. The following program
produces Output 2.10.3. Note that holidays and breaks are marked with a solid ll
pattern.
186

Chapter 2. The CPM Procedure
goptions hpos=160 vpos=25 ftext=swiss;
title h=1.5 Multiple Calendars;
title2 Breaks and Holidays for the Different Calendars;
proc gantt data=cals graphics
calendar=calendar holidata=holidays
workday=workdata;
chart / interval=dtday mininterval=dthour skip=2
holiday=(holiday) holifin=(holifin)
markbreak daylength=08:00t calid=cal
ref=1dec03:00:00dt to 4jan04:08:00dt by dtday
nolegend nojobnum increment=16
hpages=6;
id cal;
run;
Output 2.10.3. Gantt Chart Showing Breaks and Holidays for Multiple Calendars
Example 2.10. Multiple Calendars

187
188

Chapter 2. The CPM Procedure
The Activity data set used in Example 2.9 is modied by adding a variable called
cal, which sets the calendar to be PROD

CAL for the activity Production, and


OVT

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

cal, is dened that has the same work pattern as the


default calendar, but it also contains an extra vacation period. Output 2.10.6 displays
the data sets HOLIDATA and CALEDATA, which contain information about the new
calendar. The fourth observation in the data set CALEDATA has missing values for
the variables

sun

, . . . ,

sat

, indicating that the calendar, Eng

cal, follows the


same work pattern as the default calendar.
Example 2.10. Multiple Calendars

191
Output 2.10.6. HOLIDATA and CALEDATA Data Sets
Multiple Calendars
Holidays Data Set
Obs holiday holifin holidur cal
1 08DEC03 . 7 Eng_cal
2 24DEC03 26DEC03 .
3 01JAN04 01JAN04 .
Multiple Calendars
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
Once again, in the following code, PROC GANTT is used to compare the new cal-
endar with the default calendar, as shown in Output 2.10.7. Note that the breaks and
holidays are marked with a solid ll pattern.
/* Create a data set to illustrate holidays with PROC GANTT */
data cals2;
e_start=1dec03:00:00dt;
e_finish=18dec03:00:00dt;
label cal =Schedule Breaks / Holidays;
format e_start e_finish datetime16.;
length cal $8.;
cal=DEFAULT ; output;
cal=Eng_cal ; output;
run;
title2 Breaks and Holidays for Eng_cal and the DEFAULT Calendar;
proc gantt data=cals2 graphics
calendar=caledata holidata=holidata
workday=workdata;
chart / interval=dtday mininterval=dthour skip=2
holiday=(holiday) holifin=(holifin) holidur=(holidur)
markbreak daylength=08:00t calid=cal
ref=1dec03:00:00dt to 18dec03:00:00dt by dtday
nojobnum nolegend increment=16 hpages=3;
id cal;
run;
192

Chapter 2. The CPM Procedure
Output 2.10.7. Difference between Eng

cal and DEFAULT Calendar


The Activity data set is modied to redene the calendar for the task Write Specs.
PROC CPM is invoked, and Output 2.10.8 shows the new schedule obtained. Note
the effect of the Engineers vacation on the project completion time. The project is
now scheduled to nish at 10 a.m. on March 9, 2004; in effect, the delay is only one
day, even though the planned vacation period is seven days. This is due to the fact
that the activity Write Specs, which follows the new calendar, had some slack time
present in its original schedule; however, this activity has now become critical.
Example 2.10. Multiple Calendars

193
data widgvac;
set widgcal;
if task = Write Specs then cal = Eng_cal;
run;
proc cpm date=01dec03d data=widgvac out=schedvac
holidata=holidata daylength=08:00t
workday=workdata
calendar=caledata;
holiday holiday / holifin = holifin holidur=holidur;
activity task;
duration days;
successor succ1 succ2 succ3;
calid cal;
run;
title2 Project Schedule: Four Calendars;
proc print;
var task days cal e_: l_: t_float f_float;
run;
194

Chapter 2. The CPM Procedure
Output 2.10.8. Schedule Using Four Calendars
Multiple Calendars
Project Schedule: Four 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 Eng_cal 17DEC03:08:00:00 23DEC03:11:59:59
5 Prototype 15.0 OVT_CAL 23DEC03:12:00:00 13JAN04:09:59:59
6 Mkt. Strat. 10.0 DEFAULT 15DEC03:12:00:00 02JAN04:11:59:59
7 Materials 10.0 DEFAULT 13JAN04:10:00:00 27JAN04:09:59:59
8 Facility 10.0 DEFAULT 13JAN04:10:00:00 27JAN04:09:59:59
9 Init. Prod. 10.0 DEFAULT 27JAN04:10:00:00 10FEB04:09:59:59
10 Evaluate 10.0 DEFAULT 10FEB04:10:00:00 24FEB04:09:59:59
11 Test Market 15.0 DEFAULT 10FEB04:10:00:00 02MAR04:09:59:59
12 Changes 5.0 DEFAULT 02MAR04:10:00:00 09MAR04:09:59:59
13 Production 0.0 PROD_CAL 09MAR04:10:00:00 09MAR04:10:00:00
14 Marketing 0.0 DEFAULT 10FEB04:10:00:00 10FEB04:10:00:00
Obs L_START L_FINISH T_FLOAT F_FLOAT
1 02DEC03:08:00:00 09DEC03:11:59:59 1.00 0.00
2 09DEC03:12:00:00 23DEC03:11:59:59 1.00 1.00
3 20JAN04:10:00:00 27JAN04:09:59:59 26.75 0.00
4 17DEC03:08:00:00 23DEC03:11:59:59 0.00 0.00
5 23DEC03:12:00:00 13JAN04:09:59:59 0.00 0.00
6 27JAN04:10:00:00 10FEB04:09:59:59 26.75 26.75
7 13JAN04:10:00:00 27JAN04:09:59:59 0.00 0.00
8 13JAN04:10:00:00 27JAN04:09:59:59 0.00 0.00
9 27JAN04:10:00:00 10FEB04:09:59:59 0.00 0.00
10 17FEB04:10:00:00 02MAR04:09:59:59 5.00 5.00
11 10FEB04:10:00:00 02MAR04:09:59:59 0.00 0.00
12 02MAR04:10:00:00 09MAR04:09:59:59 0.00 0.00
13 09MAR04:10:00:00 09MAR04:10:00:00 0.00 0.00
14 09MAR04:10:00:00 09MAR04:10:00:00 20.00 20.00
Example 2.11. Nonstandard Relationships
This example shows the use of LAG variables to describe nonstandard relationships.
Consider the project network in AON format. Output 2.11.1 shows the data set
WIDGLAG, which contains the required project information; here the data set con-
tains only one successor variable, requiring multiple observations for activities that
have more than one immediate successor. In addition, the data set contains two new
variables, lagdur and lagdurc, which are used to convey nonstandard relationships
that exist between some of the activities. In the rst part of the example, lagdur spec-
ies a lag type and lag duration between activities; in the second part, the variable
lagdurc species a lag calendar in addition to the lag type and lag duration. Note
that when multiple successor variables are used, you can specify multiple lag vari-
ables and the lag values specied are matched one-for-one with the corresponding
successor variables.
Example 2.11. Nonstandard Relationships

195
Output 2.11.1. Network Data
Non-Standard Relationships
Activity Data Set WIDGLAG
Obs task days succ lagdur lagdurc
1 Approve Plan 5 Drawings
2 Approve Plan 5 Anal. Market
3 Approve Plan 5 Write Specs
4 Drawings 10 Prototype
5 Anal. Market 5 Mkt. Strat.
6 Write Specs 5 Prototype
7 Prototype 15 Materials ss_9 ss_9
8 Prototype 15 Facility ss_9 ss_9
9 Mkt. Strat. 10 Test Market
10 Mkt. Strat. 10 Marketing
11 Materials 10 Init. Prod.
12 Facility 10 Init. Prod. fs_2 fs_2_SEVENDAY
13 Init. Prod. 10 Test Market
14 Init. Prod. 10 Marketing
15 Init. Prod. 10 Evaluate
16 Evaluate 10 Changes
17 Test Market 15 Changes
18 Changes 5 Production
19 Production 0
20 Marketing 0
Suppose that the project calendar follows a ve-day work week. Recall fromExample
2.6 that the project nishes on March 8, 2004. The data set, WIDGLAG, species that
there is a ss

9 lag between the activities Prototype and Materials, which means


that you can start acquiring raw materials nine days after the start of the activity
Prototype instead of waiting until its nish time. Likewise, there is an ss

9 lag
between Prototype and Facility. The fs

2 lag between Facility and Init. Prod


indicates that you should wait two days after the completion of the Facility task
before starting the initial production. To convey the lag information to PROC CPM,
use the LAG= specication in the SUCCESSOR statement. The program and the
resulting output (Output 2.11.2) follow.
proc cpm data=widglag date=1dec03d
interval=weekday collapse out=lagsched;
activity task;
succ succ / lag = (lagdur);
duration days;
run;
196

Chapter 2. The CPM Procedure
Output 2.11.2. Project Schedule: Default LAG Calendar
Non-Standard Relationships
Lag Type and Duration: Default LAG Calendar
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 13JAN04 19JAN04 26 0
Write Specs 08DEC03 12DEC03 15DEC03 19DEC03 5 5
Prototype 22DEC03 09JAN04 22DEC03 09JAN04 0 0
Mkt. Strat. 15DEC03 26DEC03 20JAN04 02FEB04 26 26
Materials 02JAN04 15JAN04 06JAN04 19JAN04 2 2
Facility 02JAN04 15JAN04 02JAN04 15JAN04 0 0
Init. Prod. 20JAN04 02FEB04 20JAN04 02FEB04 0 0
Evaluate 03FEB04 16FEB04 10FEB04 23FEB04 5 5
Test Market 03FEB04 23FEB04 03FEB04 23FEB04 0 0
Changes 24FEB04 01MAR04 24FEB04 01MAR04 0 0
Production 02MAR04 02MAR04 02MAR04 02MAR04 0 0
Marketing 03FEB04 03FEB04 02MAR04 02MAR04 20 20
Note that due to the change in the type of precedence constraint (from the default
fs

0 to ss

9), the project nishes earlier, on March 2, 2004, instead of on March


8, 2004 (compare with Output 2.6.1).
By default, all the lags are assumed to follow the default calendar for the
project. In this case, the default project calendar has ve workdays (since
INTERVAL=WEEKDAY). Suppose now that the fs

2 lag between Facility and


Init. Prod. really indicates two calendar days and not two workdays. (Perhaps
you want to allow two days for the paint to dry or the building to be ventilated.)
The variable lagdurc in the WIDGLAG data set indicates the calendar for this
lag by specifying the lag to be fs

sevenday where sevenday is the name of


the seven-day calendar dened in the Calendar data set, CALENDAR, displayed
in Output 2.11.3. PROC CPM is invoked with LAG=lagdurc and Output 2.11.4
displays the resulting schedule. Note that the project now nishes on March 1, 2004.
proc cpm data=widglag date=1dec03d calendar=calendar
interval=weekday collapse out=lagsched;
activity task;
succ succ / lag = (lagdurc);
duration days;
run;
Example 2.11. Nonstandard Relationships

197
Output 2.11.3. Calendar Data Set
Non-Standard Relationships
Calendar Data Set
Obs _cal_ _sun_ _mon_ _tue_ _wed_ _thu_ _fri_ _sat_
1 SEVENDAY workday workday workday workday workday workday workday
Output 2.11.4. Project Schedule: Lag Type, Duration, and Calendar
Non-Standard Relationships
Lag Type, Duration, and Calendar
task E_START E_FINISH L_START L_FINISH T_FLOAT F_FLOAT
Approve Plan 01DEC03 05DEC03 02DEC03 08DEC03 1 0
Drawings 08DEC03 19DEC03 09DEC03 22DEC03 1 0
Anal. Market 08DEC03 12DEC03 12JAN04 16JAN04 25 0
Write Specs 08DEC03 12DEC03 16DEC03 22DEC03 6 5
Prototype 22DEC03 09JAN04 23DEC03 12JAN04 1 0
Mkt. Strat. 15DEC03 26DEC03 19JAN04 30JAN04 25 25
Materials 02JAN04 15JAN04 05JAN04 16JAN04 1 1
Facility 02JAN04 15JAN04 05JAN04 16JAN04 1 1
Init. Prod. 19JAN04 30JAN04 19JAN04 30JAN04 0 0
Evaluate 02FEB04 13FEB04 09FEB04 20FEB04 5 5
Test Market 02FEB04 20FEB04 02FEB04 20FEB04 0 0
Changes 23FEB04 27FEB04 23FEB04 27FEB04 0 0
Production 01MAR04 01MAR04 01MAR04 01MAR04 0 0
Marketing 02FEB04 02FEB04 01MAR04 01MAR04 20 20
In fact, you can specify an alternate calendar for all the lag durations by us-
ing the ALAGCAL= or NLAGCAL= option in the SUCCESSOR statement.
The next invocation of the CPM procedure illustrates this feature by specifying
ALAGCAL=SEVENDAY in the SUCCESSOR statement. Thus, all the lag durations
now follow the seven-day calendar instead of the ve-day calendar, which is the
default calendar for this project. Output 2.11.5 shows the resulting schedule.
Note that now the project nishes on February 27, 2004. Output 2.11.6 displays
a precedence Gantt chart of the project. Note how the nonstandard precedence
constraints are displayed.
proc cpm data=widglag date=1dec03d calendar=calendar
interval=weekday collapse out=lagsched;
activity task;
succ succ / lag = (lagdur) alagcal=sevenday;
duration days;
run;
198

Chapter 2. The CPM Procedure
goptions hpos=100 vpos=60;
title c=black f=swiss h=2.5 Non-Standard Relationships;
title2 c=black f=swiss h=2 Precedence Gantt Chart;
title3 ;
proc gantt graphics data=lagsched logic=widglag;
chart / compress act=task succ=(succ) dur=days
font=swiss
cprec=black cmile=blue
caxis=black cfram=cyan
height=1.5 skip=2 nojobnum
dur=days increment=7 lag=(lagdur);
id task;
run;
Output 2.11.5. Project Schedule: LAG Calendar = SEVENDAY
Non-Standard Relationships
Lag Type and Duration: LAG Calendar = SEVENDAY
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 09JAN04 15JAN04 24 0
Write Specs 08DEC03 12DEC03 15DEC03 19DEC03 5 5
Prototype 22DEC03 09JAN04 22DEC03 09JAN04 0 0
Mkt. Strat. 15DEC03 26DEC03 16JAN04 29JAN04 24 24
Materials 31DEC03 13JAN04 02JAN04 15JAN04 2 2
Facility 31DEC03 13JAN04 31DEC03 13JAN04 0 0
Init. Prod. 16JAN04 29JAN04 16JAN04 29JAN04 0 0
Evaluate 30JAN04 12FEB04 06FEB04 19FEB04 5 5
Test Market 30JAN04 19FEB04 30JAN04 19FEB04 0 0
Changes 20FEB04 26FEB04 20FEB04 26FEB04 0 0
Production 27FEB04 27FEB04 27FEB04 27FEB04 0 0
Marketing 30JAN04 30JAN04 27FEB04 27FEB04 20 20
Example 2.12. Activity Time Constraints

199
Output 2.11.6. Precedence Gantt Chart
Example 2.12. Activity Time Constraints
Often, in addition to a project start date or a project nish date, there may be
other time constraints imposed selectively on the activities in the project. The
ALIGNDATE and ALIGNTYPE statements enable you to add various types of time
constraints on the activities. In this example, the data set WIDGET12 displayed in
Output 2.12.1 contains two variables, adate and atype, which enable you to specify
these restrictions. For example, the activity Drawings has an feq (Finish Equals)
constraint, requiring it to nish on the 15th of December. The activity Test Market
has a mandatory start date imposed on it.
200

Chapter 2. The CPM Procedure
Output 2.12.1. Activity Data Set WIDGET12
Activity Time Constraints
Activity data set
Obs task days succ1 succ2 succ3 adate atype
1 Approve Plan 5 Drawings Anal. Market Write Specs .
2 Drawings 10 Prototype 15DEC03 feq
3 Anal. Market 5 Mkt. Strat. .
4 Write Specs 5 Prototype 15DEC03 sge
5 Prototype 15 Materials Facility .
6 Mkt. Strat. 10 Test Market Marketing .
7 Materials 10 Init. Prod. .
8 Facility 10 Init. Prod. .
9 Init. Prod. 10 Test Market Marketing Evaluate .
10 Evaluate 10 Changes 27FEB04 fle
11 Test Market 15 Changes 16FEB04 ms
12 Changes 5 Production .
13 Production 0 .
14 Marketing 0 .
The following statements are needed to schedule the project subject to these restric-
tions. The option XFERVARS in the PROC CPM statement causes CPM to transfer
all variables that were used in the analysis to the Schedule data set. Output 2.12.2
shows the resulting schedule.
proc cpm data=widget12 date=1dec03d
xfervars interval=weekday;
activity task;
successor succ1 succ2 succ3;
duration days;
aligndate adate;
aligntype atype;
run;
options ls=90;
title Activity Time Constraints;
title2 Aligned Schedule;
proc print;
id task;
var adate atype e_: l_: t_float f_float;
run;
Example 2.13. Progress Update and Target Schedules

201
Output 2.12.2. Aligned Schedule
Activity Time Constraints
Aligned Schedule
task adate atype E_START E_FINISH L_START L_FINISH T_FLOAT F_FLOAT
Approve Plan . 01DEC03 05DEC03 25NOV03 01DEC03 -4 -4
Drawings 15DEC03 feq 08DEC03 19DEC03 02DEC03 15DEC03 -4 -4
Anal. Market . 08DEC03 12DEC03 26JAN04 30JAN04 35 0
Write Specs 15DEC03 sge 15DEC03 19DEC03 22DEC03 26DEC03 5 0
Prototype . 22DEC03 09JAN04 29DEC03 16JAN04 5 0
Mkt. Strat. . 15DEC03 26DEC03 02FEB04 13FEB04 35 30
Materials . 12JAN04 23JAN04 19JAN04 30JAN04 5 0
Facility . 12JAN04 23JAN04 19JAN04 30JAN04 5 0
Init. Prod. . 26JAN04 06FEB04 02FEB04 13FEB04 5 0
Evaluate 27FEB04 fle 09FEB04 20FEB04 16FEB04 27FEB04 5 5
Test Market 16FEB04 ms 16FEB04 05MAR04 16FEB04 05MAR04 0 0
Changes . 08MAR04 12MAR04 08MAR04 12MAR04 0 0
Production . 15MAR04 15MAR04 15MAR04 15MAR04 0 0
Marketing . 09FEB04 09FEB04 15MAR04 15MAR04 25 25
Note that the MS and MF constraints are mandatory and override any precedence
constraints; thus, both the late start and early start times for the activity Test Market
coincide with February 16, 2004. However, the other types of constraints are not
mandatory; they are superseded by any constraints imposed by the precedence rela-
tionships. In other words, neither the early start nor the late start schedule violate
precedence constraints. Thus, even though the activity Drawings is required to n-
ish on the 15th of December (by the feq constraint), the early start schedule causes it
to nish on the 19th of December because of its predecessors schedule. This type of
inconsistency is indicated by the presence of negative oats for some of the activities
alerting you to the fact that if some of these deadlines are to be met, these activities
must start earlier than the early start schedule. Such activities are called supercritical.
Example 2.13. Progress Update and Target Schedules
This example shows the use of the ACTUAL and BASELINE statements to track and
compare a projects progress with the original planned schedule. Consider the data
in Example 2.1, for the network in AON format. Suppose that the project has started
as scheduled on December 1, 2003, and that the current date is December 19, 2003.
You may want to enter the actual dates for the activities that are already in progress
or have been completed and use the CPM procedure to determine the schedule for
activities that remain to be done. In addition to computing an updated schedule, you
may want to check the progress of the project by comparing the current schedule with
the planned schedule.
The BASELINE statement enables you to save a target schedule in the Schedule data
set. In this example, suppose that you want to try to schedule the activities according
to the projects early start schedule. As a rst step, schedule the project with PROC
CPM, and use the SET= option in the BASELINE statement to save the early start and
nish times as the baseline start and nish times. The following program saves the
baseline schedule (in the variables B

START and B

FINISH), and Output 2.13.1


displays the resulting output data set.
202

Chapter 2. The CPM Procedure
data holidays;
format holiday holifin date7.;
input holiday & date7. holifin & date7. holidur;
datalines;
24dec03 26dec03 4
01jan04 . .
;
* store early schedule as the baseline schedule;
proc cpm data=widget holidata=holidays
out=widgbase date=1dec03d;
activity task;
succ succ1 succ2 succ3;
duration days;
holiday holiday / holifin=(holifin);
baseline / set=early;
run;
Output 2.13.1. Target Schedule
Progress Update and Target Schedules
Set Baseline Schedule
Obs task succ1 succ2 succ3 days E_START
1 Approve Plan Drawings Anal. Market Write Specs 5 01DEC03
2 Drawings Prototype 10 06DEC03
3 Anal. Market Mkt. Strat. 5 06DEC03
4 Write Specs Prototype 5 06DEC03
5 Prototype Materials Facility 15 16DEC03
6 Mkt. Strat. Test Market Marketing 10 11DEC03
7 Materials Init. Prod. 10 04JAN04
8 Facility Init. Prod. 10 04JAN04
9 Init. Prod. Test Market Marketing Evaluate 10 14JAN04
10 Evaluate Changes 10 24JAN04
11 Test Market Changes 15 24JAN04
12 Changes Production 5 08FEB04
13 Production 0 13FEB04
14 Marketing 0 24JAN04
Obs E_FINISH L_START L_FINISH T_FLOAT F_FLOAT B_START B_FINISH
1 05DEC03 01DEC03 05DEC03 0 0 01DEC03 05DEC03
2 15DEC03 06DEC03 15DEC03 0 0 06DEC03 15DEC03
3 10DEC03 09JAN04 13JAN04 30 0 06DEC03 10DEC03
4 10DEC03 11DEC03 15DEC03 5 5 06DEC03 10DEC03
5 03JAN04 16DEC03 03JAN04 0 0 16DEC03 03JAN04
6 20DEC03 14JAN04 23JAN04 30 30 11DEC03 20DEC03
7 13JAN04 04JAN04 13JAN04 0 0 04JAN04 13JAN04
8 13JAN04 04JAN04 13JAN04 0 0 04JAN04 13JAN04
9 23JAN04 14JAN04 23JAN04 0 0 14JAN04 23JAN04
10 02FEB04 29JAN04 07FEB04 5 5 24JAN04 02FEB04
11 07FEB04 24JAN04 07FEB04 0 0 24JAN04 07FEB04
12 12FEB04 08FEB04 12FEB04 0 0 08FEB04 12FEB04
13 13FEB04 13FEB04 13FEB04 0 0 13FEB04 13FEB04
14 24JAN04 13FEB04 13FEB04 20 20 24JAN04 24JAN04
Example 2.13. Progress Update and Target Schedules

203
As the project progresses, you have to account for the actual progress of the project
and schedule the unnished activities accordingly. You can do so by specifying actual
start or actual nish times (or both) for activities that have already nished or are
in progress. Progress information can also be specied using percent complete or
remaining duration values. Assume that current information has been incorporated
into the ACTUAL data set, shown in Output 2.13.2. The variables sdate and fdate
contain the actual start and nish times of the activities, and rdur species the number
of days of work that are still remaining for the activity to be completed, and pctc
species the percent of work that has been completed for that activity.
Output 2.13.2. Progress Data Set ACTUAL
Progress Update and Target Schedules
Progress Data
Obs task sdate fdate pctc rdur
1 Approve Plan 01DEC2003 05DEC2003 . .
2 Drawings 06DEC2003 16DEC2003 . .
3 Anal. Market 05DEC2003 . 100 .
4 Write Specs 07DEC2003 12DEC2003 . .
5 Prototype . . . .
6 Mkt. Strat. 10DEC2003 . . 3
7 Materials . . . .
8 Facility . . . .
9 Init. Prod. . . . .
10 Evaluate . . . .
11 Test Market . . . .
12 Changes . . . .
13 Production . . . .
14 Marketing . . . .
The following statements invoke PROC CPM after merging the progress data with the
Schedule data set. The NOAUTOUPDT option is specied so that only those activi-
ties that have explicit progress information are assumed to have started. The resulting
Schedule data set contains the new variables A

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

VAR variables show


the amount of slippage in the start and nish times (predicted on the basis of the
current schedule) as compared to the baseline schedule.
* merge the baseline information with progress update;
data widgact;
merge actual widgbase;
run;
proc cpm data=widgact holidata=holidays
out=widgnupd date=1dec03d;
activity task;
succ succ1 succ2 succ3;
duration days;
holiday holiday / holifin=(holifin);
baseline / compare=early;
actual / a_start=sdate a_finish=fdate timenow=19dec03d
204

Chapter 2. The CPM Procedure
remdur=rdur pctcomp=pctc noautoupdt;
run;
Output 2.13.3. Comparison of Schedules: NOAUTOUPDT
Progress Update and Target Schedules
Updated Schedule vs. Target Schedule: NOAUTOUPDT
Obs task succ1 succ2 succ3 days STATUS
1 Approve Plan Drawings Anal. Market Write Specs 5 Completed
2 Drawings Prototype 10 Completed
3 Anal. Market Mkt. Strat. 5 Completed
4 Write Specs Prototype 5 Completed
5 Prototype Materials Facility 15 Pending
6 Mkt. Strat. Test Market Marketing 10 In Progress
7 Materials Init. Prod. 10 Pending
8 Facility Init. Prod. 10 Pending
9 Init. Prod. Test Market Marketing Evaluate 10 Pending
10 Evaluate Changes 10 Pending
11 Test Market Changes 15 Pending
12 Changes Production 5 Pending
13 Production 0 Pending
14 Marketing 0 Pending
Obs A_DUR A_START A_FINISH E_START E_FINISH L_START L_FINISH
1 5 01DEC03 05DEC03 01DEC03 05DEC03 01DEC03 05DEC03
2 11 06DEC03 16DEC03 06DEC03 16DEC03 06DEC03 16DEC03
3 5 05DEC03 09DEC03 05DEC03 09DEC03 05DEC03 09DEC03
4 6 07DEC03 12DEC03 07DEC03 12DEC03 07DEC03 12DEC03
5 . . . 19DEC03 06JAN04 19DEC03 06JAN04
6 . 10DEC03 . 10DEC03 21DEC03 10DEC03 21DEC03
7 . . . 07JAN04 16JAN04 07JAN04 16JAN04
8 . . . 07JAN04 16JAN04 07JAN04 16JAN04
9 . . . 17JAN04 26JAN04 17JAN04 26JAN04
10 . . . 27JAN04 05FEB04 01FEB04 10FEB04
11 . . . 27JAN04 10FEB04 27JAN04 10FEB04
12 . . . 11FEB04 15FEB04 11FEB04 15FEB04
13 . . . 16FEB04 16FEB04 16FEB04 16FEB04
14 . . . 27JAN04 27JAN04 16FEB04 16FEB04
Obs T_FLOAT F_FLOAT B_START B_FINISH S_VAR F_VAR
1 0 0 01DEC03 05DEC03 0 0
2 0 0 06DEC03 15DEC03 0 1
3 0 0 06DEC03 10DEC03 -1 -1
4 0 0 06DEC03 10DEC03 1 2
5 0 0 16DEC03 03JAN04 3 3
6 0 0 11DEC03 20DEC03 -1 1
7 0 0 04JAN04 13JAN04 3 3
8 0 0 04JAN04 13JAN04 3 3
9 0 0 14JAN04 23JAN04 3 3
10 5 5 24JAN04 02FEB04 3 3
11 0 0 24JAN04 07FEB04 3 3
12 0 0 08FEB04 12FEB04 3 3
13 0 0 13FEB04 13FEB04 3 3
14 20 20 24JAN04 24JAN04 3 3
Example 2.13. Progress Update and Target Schedules

205
In order for you to see the effect of the AUTOUPDT option, the same project informa-
tion is used with the AUTOUPDT option in the ACTUAL statement. Output 2.13.4
displays the resulting schedule. With the AUTOUPDT option (which is, in fact, the
default option), PROC CPM uses the progress information and the precedence infor-
mation to automatically ll in the actual start and nish information for activities that
should have nished or started before TIMENOW. Note that the activity Prototype
has no progress information in WIDGACT, but it is assumed to have an actual start
date of December 17, 2003. This option is useful when there are several activities
that take place according to the plan and only a few occur out of sequence; then it is
sufcient to enter progress information only for the activities that did not follow the
plan. The SHOWFLOAT option, also used in this invocation of PROC CPM, enables
activities that are completed or in progress to have oat; in other words, the late start
schedule for activities in progress is not xed by the progress information. Thus, the
activity Anal. Market has L

START=08JAN04 instead of 05DEC03, as in the


earlier invocation of PROC CPM (without the SHOWFLOAT option).
The following invocation of PROC CPM produces Output 2.13.4:
proc cpm data=widgact holidata=holidays
out=widgupdt date=1dec03d;
activity task;
succ succ1 succ2 succ3;
duration days;
holiday holiday / holifin=(holifin);
baseline / compare=early;
actual / as=sdate af=fdate timenow=19dec03d
remdur=rdur pctcomp=pctc
autoupdt showfloat;
run;
206

Chapter 2. The CPM Procedure
Output 2.13.4. Comparison of Schedules: AUTOUPDT
Progress Update and Target Schedules
Updated Schedule vs. Target Schedule: AUTOUPDT
Obs task succ1 succ2 succ3 days STATUS
1 Approve Plan Drawings Anal. Market Write Specs 5 Completed
2 Drawings Prototype 10 Completed
3 Anal. Market Mkt. Strat. 5 Completed
4 Write Specs Prototype 5 Completed
5 Prototype Materials Facility 15 In Progress
6 Mkt. Strat. Test Market Marketing 10 In Progress
7 Materials Init. Prod. 10 Pending
8 Facility Init. Prod. 10 Pending
9 Init. Prod. Test Market Marketing Evaluate 10 Pending
10 Evaluate Changes 10 Pending
11 Test Market Changes 15 Pending
12 Changes Production 5 Pending
13 Production 0 Pending
14 Marketing 0 Pending
Obs A_DUR A_START A_FINISH E_START E_FINISH L_START L_FINISH
1 5 01DEC03 05DEC03 01DEC03 05DEC03 01DEC03 05DEC03
2 11 06DEC03 16DEC03 06DEC03 16DEC03 06DEC03 16DEC03
3 5 05DEC03 09DEC03 05DEC03 09DEC03 08JAN04 12JAN04
4 6 07DEC03 12DEC03 07DEC03 12DEC03 11DEC03 16DEC03
5 . 17DEC03 . 17DEC03 04JAN04 17DEC03 04JAN04
6 . 10DEC03 . 10DEC03 21DEC03 13JAN04 24JAN04
7 . . . 05JAN04 14JAN04 05JAN04 14JAN04
8 . . . 05JAN04 14JAN04 05JAN04 14JAN04
9 . . . 15JAN04 24JAN04 15JAN04 24JAN04
10 . . . 25JAN04 03FEB04 30JAN04 08FEB04
11 . . . 25JAN04 08FEB04 25JAN04 08FEB04
12 . . . 09FEB04 13FEB04 09FEB04 13FEB04
13 . . . 14FEB04 14FEB04 14FEB04 14FEB04
14 . . . 25JAN04 25JAN04 14FEB04 14FEB04
Obs T_FLOAT F_FLOAT B_START B_FINISH S_VAR F_VAR
1 0 -1 01DEC03 05DEC03 0 0
2 0 0 06DEC03 15DEC03 0 1
3 30 0 06DEC03 10DEC03 -1 -1
4 4 4 06DEC03 10DEC03 1 2
5 0 0 16DEC03 03JAN04 1 1
6 30 30 11DEC03 20DEC03 -1 1
7 0 0 04JAN04 13JAN04 1 1
8 0 0 04JAN04 13JAN04 1 1
9 0 0 14JAN04 23JAN04 1 1
10 5 5 24JAN04 02FEB04 1 1
11 0 0 24JAN04 07FEB04 1 1
12 0 0 08FEB04 12FEB04 1 1
13 0 0 13FEB04 13FEB04 1 1
14 20 20 24JAN04 24JAN04 1 1
Example 2.14. Summarizing Resource Utilization

207
Example 2.14. Summarizing Resource Utilization
This example shows how you can use the RESOURCE statement in conjunction with
the RESOURCEOUT= option to summarize resource utilization. The example as-
sumes that Engineer is a resource category and the project network (in AOA format)
along with resource requirements for each activity is in a SAS data set, as displayed
in Output 2.14.1.
Output 2.14.1. Resource Utilization: WIDGRES
Summarizing Resource Utilization
Activity Data Set
Obs task days tail head engineer
1 Approve Plan 5 1 2 2
2 Drawings 10 2 3 1
3 Anal. Market 5 2 4 1
4 Write Specs 5 2 3 2
5 Prototype 15 3 5 4
6 Mkt. Strat. 10 4 6 .
7 Materials 10 5 7 .
8 Facility 10 5 7 2
9 Init. Prod. 10 7 8 4
10 Evaluate 10 8 9 1
11 Test Market 15 6 9 .
12 Changes 5 9 10 2
13 Production 0 10 11 4
14 Marketing 0 6 12 .
15 Dummy 0 8 6 .
Output 2.14.2. Resource Utilization: HOLDATA
Summarizing Resource Utilization
Holidays Data Set HOLDATA
Obs hol name
1 25DEC03 Christmas
2 01JAN04 New Year
In the following program, PROC CPM is invoked with the RESOURCE state-
ment identifying the resource for which usage information is required. The project
is scheduled only on weekdays, and holiday information is included through the
Holiday data set, HOLDATA, which identies two holidays, one for Christmas and
one for New Years Day. Output 2.14.2 shows the Holiday data set.
The program saves the resource usage information in a data set named ROUT, which
is displayed in Output 2.14.3. Two variables, Eengineer and Lengineer, denote the
usage of the resource engineer corresponding to the early and late start schedules,
respectively. Note the naming convention for the variables in the resource usage data
set: A prex (E for Early and L for Late) is followed by the name of the resource vari-
able, engineer. Note also that the data set contains only observations corresponding
to weekdays; by default, the

TIME

variable in the resource usage output data set


increases by one unit interval of the default calendar for every observation. Further,
208

Chapter 2. The CPM Procedure
the MAXDATE= option is used in the RESOURCE statement to get resource usage
information only for the month of December.
proc cpm date=1dec03d interval=weekday
resourceout=rout data=widgres
holidata=holdata;
id task;
tailnode tail;
duration days;
headnode head;
resource engineer / maxdate=31dec03d;
holiday hol;
run;
Output 2.14.3. Resource Utilization: Resource Usage Data Set
Summarizing Resource Utilization
Resource Usage
Obs _TIME_ Eengineer Lengineer
1 01DEC03 2 2
2 02DEC03 2 2
3 03DEC03 2 2
4 04DEC03 2 2
5 05DEC03 2 2
6 08DEC03 4 1
7 09DEC03 4 1
8 10DEC03 4 1
9 11DEC03 4 1
10 12DEC03 4 1
11 15DEC03 1 3
12 16DEC03 1 3
13 17DEC03 1 3
14 18DEC03 1 3
15 19DEC03 1 3
16 22DEC03 4 4
17 23DEC03 4 4
18 24DEC03 4 4
19 26DEC03 4 4
20 29DEC03 4 4
21 30DEC03 4 4
22 31DEC03 4 4
This data set can be used as input for any type of resource utilization report. In this
example, the resource usage for the month of December is presented in two ways: on
a calendar and in a chart. The following program prints the calendar and bar chart:
Example 2.14. Summarizing Resource Utilization

209
/* format the Engineer variables */
proc format;
picture efmt other=9 ESS Eng.;
picture lfmt other=9 LSS Eng.;
proc calendar legend weekdays
data=rout holidata=holdata;
id _time_;
var eengineer lengineer;
format eengineer efmt. lengineer lfmt.;
holiday hol;
holiname name;
proc chart data=rout;
hbar _time_/sumvar=eengineer discrete;
hbar _time_/sumvar=lengineer discrete;
run;
Output 2.14.4. Calendar Showing Resource Usage
Summarizing Resource Utilization
Resource Usage
-------------------------------------------------------------
| |
| December 2003 |
| |
|-----------------------------------------------------------|
| Monday | Tuesday | Wednesday | Thursday | Friday |
|-----------+-----------+-----------+-----------+-----------|
| 1 | 2 | 3 | 4 | 5 |
| | | | | |
| 2 ESS Eng | 2 ESS Eng | 2 ESS Eng | 2 ESS Eng | 2 ESS Eng |
| 2 LSS Eng | 2 LSS Eng | 2 LSS Eng | 2 LSS Eng | 2 LSS Eng |
|-----------+-----------+-----------+-----------+-----------|
| 8 | 9 | 10 | 11 | 12 |
| | | | | |
| 4 ESS Eng | 4 ESS Eng | 4 ESS Eng | 4 ESS Eng | 4 ESS Eng |
| 1 LSS Eng | 1 LSS Eng | 1 LSS Eng | 1 LSS Eng | 1 LSS Eng |
|-----------+-----------+-----------+-----------+-----------|
| 15 | 16 | 17 | 18 | 19 |
| | | | | |
| 1 ESS Eng | 1 ESS Eng | 1 ESS Eng | 1 ESS Eng | 1 ESS Eng |
| 3 LSS Eng | 3 LSS Eng | 3 LSS Eng | 3 LSS Eng | 3 LSS Eng |
|-----------+-----------+-----------+-----------+-----------|
| 22 | 23 | 24 | 25 | 26 |
| | | | Christmas | |
| 4 ESS Eng | 4 ESS Eng | 4 ESS Eng | | 4 ESS Eng |
| 4 LSS Eng | 4 LSS Eng | 4 LSS Eng | | 4 LSS Eng |
|-----------+-----------+-----------+-----------+-----------|
| 29 | 30 | 31 | | |
| | | | | |
| 4 ESS Eng | 4 ESS Eng | 4 ESS Eng | | |
| 4 LSS Eng | 4 LSS Eng | 4 LSS Eng | | |
-------------------------------------------------------------
--------------------------
| Legend |
| |
| ESS Usage of engineer |
| LSS Usage of engineer |
--------------------------
210

Chapter 2. The CPM Procedure
Output 2.14.5. Bar Chart for Early Start Usage
Summarizing Resource Utilization
Resource Usage
Period Identifier ESS Usage of en
Sum
|
01DEC03 |******************** 2.000000
02DEC03 |******************** 2.000000
03DEC03 |******************** 2.000000
04DEC03 |******************** 2.000000
05DEC03 |******************** 2.000000
08DEC03 |**************************************** 4.000000
09DEC03 |**************************************** 4.000000
10DEC03 |**************************************** 4.000000
11DEC03 |**************************************** 4.000000
12DEC03 |**************************************** 4.000000
15DEC03 |********** 1.000000
16DEC03 |********** 1.000000
17DEC03 |********** 1.000000
18DEC03 |********** 1.000000
19DEC03 |********** 1.000000
22DEC03 |**************************************** 4.000000
23DEC03 |**************************************** 4.000000
24DEC03 |**************************************** 4.000000
26DEC03 |**************************************** 4.000000
29DEC03 |**************************************** 4.000000
30DEC03 |**************************************** 4.000000
31DEC03 |**************************************** 4.000000
|
----------+---------+---------+---------+
1 2 3 4
ESS Usage of engineer
Output 2.14.6. Bar Chart for Late Start Usage
Summarizing Resource Utilization
Resource Usage
Period Identifier LSS Usage of en
Sum
|
01DEC03 |******************** 2.000000
02DEC03 |******************** 2.000000
03DEC03 |******************** 2.000000
04DEC03 |******************** 2.000000
05DEC03 |******************** 2.000000
08DEC03 |********** 1.000000
09DEC03 |********** 1.000000
10DEC03 |********** 1.000000
11DEC03 |********** 1.000000
12DEC03 |********** 1.000000
15DEC03 |****************************** 3.000000
16DEC03 |****************************** 3.000000
17DEC03 |****************************** 3.000000
18DEC03 |****************************** 3.000000
19DEC03 |****************************** 3.000000
22DEC03 |**************************************** 4.000000
23DEC03 |**************************************** 4.000000
24DEC03 |**************************************** 4.000000
26DEC03 |**************************************** 4.000000
29DEC03 |**************************************** 4.000000
30DEC03 |**************************************** 4.000000
31DEC03 |**************************************** 4.000000
|
----------+---------+---------+---------+
1 2 3 4
LSS Usage of engineer
Charts such as those shown in Output 2.14.4 through Output 2.14.6 can be used to
compare different schedules with respect to resource usage.
Example 2.15. Resource Allocation

211
Example 2.15. Resource Allocation
In the previous example, a summary of the resource utilization is obtained. Suppose
that you want to schedule the project subject to constraints on the availability of
ENGINEERS. The activity data, as in Example 2.14, are assumed to be in a data
set named WIDGRES. The resource variable, engineer, species the number of
engineers needed per day for each activity in the project. In addition to the resource
engineer, a consumable resource engcost is computed at a daily rate of 200 for each
unit of resource engineer used per day. The following DATA step uses the Activity
data set from Example 2.14 to create a new Activity data set that includes the resource
engcost.
data widgres;
set widgres;
if engineer ^= . then engcost = engineer * 200;
run;
Now suppose that the availability of the resource engineer and the total outlay for
engcost is saved in a data set named WIDGRIN, displayed in Output 2.15.1.
Output 2.15.1. Resource Availability Data Set
Resource Allocation
Data Set WIDGRIN
Obs per otype engineer engcost
1 . restype 1 2
2 . suplevel 1 .
3 01DEC03 reslevel 3 40000
4 26DEC03 reslevel 4 .
In the data set WIDGRIN, the rst observation indicates that engineer is a replen-
ishable resource, while engcost is a consumable resource. The second observation
indicates that an extra engineer is available, if necessary. The remaining observations
indicate the availability prole starting from December 1, 2003. PROC CPM is then
used to schedule the project to start on December 1, 2003, subject to the availability
as specied.
212

Chapter 2. The CPM Procedure
proc cpm date=01dec03d interval=weekday
data=widgres holidata=holdata resin=widgrin
out=widgschd resout=widgrout;
tailnode tail;
duration days;
headnode head;
holiday hol;
resource engineer engcost / period=per obstype=otype
schedrule=shortdur
delayanalysis;
id task;
run;
Output 2.15.2. Resource Constrained Schedule: Rule = SHORTDUR
Resource Allocation
Resource Constrained Schedule: Rule = SHORTDUR
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 15DEC03 29DEC03
3 2 4 5 Anal. Market 1 200 08DEC03 12DEC03
4 2 3 5 Write Specs 2 400 08DEC03 12DEC03
5 3 5 15 Prototype 4 800 30DEC03 20JAN04
6 4 6 10 Mkt. Strat. . . 15DEC03 29DEC03
7 5 7 10 Materials . . 21JAN04 03FEB04
8 5 7 10 Facility 2 400 21JAN04 03FEB04
9 7 8 10 Init. Prod. 4 800 04FEB04 17FEB04
10 8 9 10 Evaluate 1 200 18FEB04 02MAR04
11 6 9 15 Test Market . . 18FEB04 09MAR04
12 9 10 5 Changes 2 400 10MAR04 16MAR04
13 10 11 0 Production 4 800 17MAR04 17MAR04
14 6 12 0 Marketing . . 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
2 08DEC03 19DEC03 08DEC03 19DEC03 5 engineer
3 08DEC03 12DEC03 21JAN04 27JAN04 0
4 08DEC03 12DEC03 15DEC03 19DEC03 0
5 22DEC03 13JAN04 22DEC03 13JAN04 0
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

213
In the rst invocation of PROC CPM, the scheduling rule used for ordering the ac-
tivities to be scheduled at a given time is specied to be SHORTDUR. The data set
WIDGSCHD, displayed in Output 2.15.2, contains the resource constrained start and
nish times in the variables S

START and S

FINISH. On December 8, three activi-


ties can be scheduled, all of which require the resource engineer. Using the schedul-
ing rule specied, PROC CPM schedules the activities with the shortest durations
rst; thus, the activity Drawings is delayed by ve working days, until December
15, 2003.
The DELAYANALYSIS option in the RESOURCE statement helps analyze the cause
of the delay by adding three new variables to the Schedule data set, R

DELAY,
DELAY

R, and SUPPL

R. In this example, the R

DELAY and DELAY

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

. The variable Aengcost denotes the amount


of money available at the beginning of the time specied in the

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

START times for the


activities. In this example, this rule results in a shorter project schedule. The schedule
and the resource usage data sets are displayed in Output 2.15.4 and Output 2.15.5,
respectively. Once again the variables DELAY

R and R

DELAY indicate that the


resource engineer caused the activity Anal. Market (Prototype) to be delayed by
ve days (three days). However, the entire project is delayed only by three working
days because the activity Anal. Market is not a critical activity, and delaying it by
ve days did not affect the project completion time. Note that even with the resource
delay of 5 days, this activity is scheduled earlier (S

START=15DEC03) than its latest


start time (L

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

R variable in the Schedule data set WIDGO16 indi-


cates that the activity, Prototype, is scheduled to start on December 22 by using a
supplementary level of the resource engineer.
Note that the supplementary level is used only if the activity would otherwise get
delayed beyond L

START + DELAY. Thus, the activity Anal. Market is delayed


by ve days (S

START = 15DEC03) and scheduled later than its early start time
(E

START = 08DEC03), even though a supplementary level of the resource could


have been used to start the activity earlier, because the activitys L

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

DELAY=10 for activity Write Specs. This is


due to the fact that there was a oat of ve days present in this activity.
proc cpm date=01dec03d interval=weekday
data=widgr17 holidata=holdata resin=resin17
out=widgo17s;
tailnode tail;
duration days;
headnode head;
holiday hol;
resource deseng / period=per obstype=otype
delayanalysis;
id task;
run;
Example 2.17. INFEASDIAGNOSTIC Option and Aggregate Resource Type

225
Output 2.17.3. Resource-Constrained Schedule: Single Resource
Use of the INFEASDIAGNOSTIC Option
Resource Constrained Schedule: Single Resource
Obs tail head days task deseng S_START S_FINISH E_START
1 1 2 5 Approve Plan 1 01DEC03 05DEC03 01DEC03
2 2 3 10 Drawings 1 08DEC03 19DEC03 08DEC03
3 2 4 5 Anal. Market . 08DEC03 12DEC03 08DEC03
4 2 3 5 Write Specs 1 22DEC03 29DEC03 08DEC03
5 3 5 15 Prototype 1 30DEC03 20JAN04 22DEC03
6 4 6 10 Mkt. Strat. . 15DEC03 29DEC03 15DEC03
7 5 7 10 Materials . 21JAN04 03FEB04 14JAN04
8 5 7 10 Facility . 21JAN04 03FEB04 14JAN04
9 7 8 10 Init. Prod. . 04FEB04 17FEB04 28JAN04
10 8 9 10 Evaluate 1 18FEB04 02MAR04 11FEB04
11 6 9 15 Test Market . 18FEB04 09MAR04 11FEB04
12 9 10 5 Changes 1 10MAR04 16MAR04 03MAR04
13 10 11 0 Production 1 17MAR04 17MAR04 10MAR04
14 6 12 0 Marketing . 18FEB04 18FEB04 11FEB04
15 8 6 0 Dummy . 18FEB04 18FEB04 11FEB04
Obs E_FINISH L_START L_FINISH R_DELAY DELAY_R SUPPL_R
1 05DEC03 01DEC03 05DEC03 0
2 19DEC03 08DEC03 19DEC03 0
3 12DEC03 21JAN04 27JAN04 0
4 12DEC03 15DEC03 19DEC03 10 deseng
5 13JAN04 22DEC03 13JAN04 0
6 29DEC03 28JAN04 10FEB04 0
7 27JAN04 14JAN04 27JAN04 0
8 27JAN04 14JAN04 27JAN04 0
9 10FEB04 28JAN04 10FEB04 0
10 24FEB04 18FEB04 02MAR04 0
11 02MAR04 11FEB04 02MAR04 0
12 09MAR04 03MAR04 09MAR04 0
13 10MAR04 10MAR04 10MAR04 0
14 11FEB04 10MAR04 10MAR04 0
15 11FEB04 11FEB04 11FEB04 0
Now suppose that you have one production engineer available, but you could ob-
tain more if needed. You do not want to delay the project more than ve days (the
delay caused by deseng). The second invocation of PROC CPM sets a maximum
delay of ve days on the activities and species all four resources along with the
INFEASDIAGNOSTIC option. The resource availability data set (printed in Output
2.17.2) has missing values for the resources mktan and money. Further, the resource
money is dened to be a consumable aggregate resource (its value is 4 in the rst
observation). Thus, this resource is used by the CPM procedure only for aggrega-
tion purposes and is not considered as a constraining resource during the scheduling
process. The INFEASDIAGNOSTIC option enables CPM to assume an innite sup-
plementary level for all the constraining resources, and the procedure draws upon this
innite reserve, if necessary, to schedule the project with only ve days of delay. In
other words, PROC CPM assumes that there is an innite supply of supplementary
levels for all the relevant resources. Thus, if at any point in the scheduling process it
nds that an activity does not have enough resources and it cannot be postponed any
further, it schedules the activity ignoring the insufciency of the resources.
226

Chapter 2. The CPM Procedure
proc cpm date=01dec03d interval=weekday
data=widgr17 holidata=holdata resin=resin17
out=widgo17m resout=widgro17;
tailnode tail;
duration days;
headnode head;
holiday hol;
resource deseng prodeng mktan money / period=per obstype=otype
delayanalysis
delay=5
infeasdiagnostic
cumusage
rcprofile avprofile;
id task;
run;
The Schedule data set WIDGO17M (for multiple resources) in Output 2.17.4 shows
the new resource-constrained schedule. With a maximum delay of ve days the pro-
cedure schedules the activity Anal. Market on January 21, 2004, using an extra pro-
duction engineer as indicated by the SUPPL

R variable. Note that the SUPPL

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

START + adelay)=21JAN04. This is


due to the fact that at every time interval, the scheduling algorithm looks ahead in
time to detect any increase in the primary level of the resource; if the future re-
source prole indicates that the procedure will need to use supplementary levels any-
way, the activity will not be forced to wait until (L

START + DELAY). (To force


the activity to wait until its latest allowed start time, use the AWAITDELAY op-
tion). The DELAYANALYSIS variables indicate that a supplementary level of the
resource prodeng is needed to schedule the activity on 14JAN03. Note that the vari-
able SUPPL

R identies only one supplementary resource that is needed for the


activity. In fact, examination of the resource requirements for the activity and the
RESOURCEOUT data set shows that an extra market analyst is also needed between
the 14th and 20th of January to schedule this activity. Likewise, the activities Write
Specs and Drawings require a design engineer and a production engineer; both
these activities start on the 8th of December. The RESOURCEOUT data set indi-
cates that an extra design engineer and an extra production engineer are needed from
the 8th to the 12th of December.
The next invocation of PROC CPM illustrates the use of the ACTDELAY variable to
force the resource-constrained schedule to coincide with the early start schedule. The
following DATA step uses the Schedule data set WIDGO18 to set an activity delay
variable (actdel) to be equal to T

FLOAT. PROC CPM is then invoked with the


ACTDELAY variable equal to actdel and the INFEASDIAGNOSTIC option. This
forces all activities to be scheduled on or before (L

START + actdel), which hap-


pens to be equal to E

START; thus all activities are scheduled to start at their early


start time. The resulting Schedule data set is displayed in Output 2.18.4. Though this
is an extreme case, a similar technique could be used selectively to set the delay value
for each activity (or some of the activities) to depend on the unconstrained schedule
or the T

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

VAR variables are 0 for all the activities, as is to be expected (since


all activities are forced to start as per the early start schedule).
data negdelay;
set widgo18;
actdel=-t_float;
run;
proc cpm date=01dec03d
interval=weekday
data=negdelay
holidata=holdata
resin=resin17
out=widgo18n;
tailnode tail;
duration days;
headnode head;
holiday hol;
resource deseng prodeng mktan money / period=per
obstype=otype
delayanalysis
actdelay=actdel
infeasdiagnostic;
baseline / set=early compare=resource;
id task;
run;
Example 2.18. Variable Activity Delay

235
Output 2.18.4. Resource-Constrained Schedule: Activity Delay = - (T

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 = 10MAR04). Note that the activity


Drawings has been postponed to start after the equipment has been serviced (or
used by the other project), and the activity Prototype (which is actually a critical
activity) cannot start on schedule because the production manager is tied up with the
noncritical activity Mkt. Strat..
proc cpm date=01dec03d
data=widgr19 resin=widgrin
holidata=holdata
out=sched resout=rout
interval=weekday collapse;
activity task;
duration days;
successor succ;
holiday hol;
resource prodman hrdware / period=per obstype=otype
t_float f_float rcs avl;
run;
238

Chapter 2. The CPM Procedure
Output 2.19.3. Project Schedule: Splitting Not Allowed
Activity Splitting
Project Schedule: Splitting not Allowed
Obs task succ days prodman hrdware S_START S_FINISH
1 Approve Plan Drawings 5 1 . 01DEC03 05DEC03
2 Drawings Prototype 10 . 1 12DEC03 26DEC03
3 Anal. Market Mkt. Strat. 5 . . 08DEC03 12DEC03
4 Write Specs Prototype 5 . . 08DEC03 12DEC03
5 Prototype Materials 15 1 . 30DEC03 20JAN04
6 Mkt. Strat. Test Market 10 1 . 15DEC03 29DEC03
7 Materials Init. Prod. 10 . . 21JAN04 03FEB04
8 Facility Init. Prod. 10 . . 21JAN04 03FEB04
9 Init. Prod. Test Market 10 1 . 04FEB04 17FEB04
10 Evaluate Changes 10 1 . 18FEB04 02MAR04
11 Test Market Changes 15 . . 18FEB04 09MAR04
12 Changes Production 5 . . 10MAR04 16MAR04
13 Production 0 1 . 17MAR04 17MAR04
14 Marketing 0 . . 18FEB04 18FEB04
Obs E_START E_FINISH L_START L_FINISH T_FLOAT F_FLOAT
1 01DEC03 05DEC03 01DEC03 05DEC03 0 0
2 08DEC03 19DEC03 08DEC03 19DEC03 0 0
3 08DEC03 12DEC03 21JAN04 27JAN04 30 0
4 08DEC03 12DEC03 15DEC03 19DEC03 5 5
5 22DEC03 13JAN04 22DEC03 13JAN04 0 0
6 15DEC03 29DEC03 28JAN04 10FEB04 30 30
7 14JAN04 27JAN04 14JAN04 27JAN04 0 0
8 14JAN04 27JAN04 14JAN04 27JAN04 0 0
9 28JAN04 10FEB04 28JAN04 10FEB04 0 0
10 11FEB04 24FEB04 18FEB04 02MAR04 5 5
11 11FEB04 02MAR04 11FEB04 02MAR04 0 0
12 03MAR04 09MAR04 03MAR04 09MAR04 0 0
13 10MAR04 10MAR04 10MAR04 10MAR04 0 0
14 11FEB04 11FEB04 10MAR04 10MAR04 20 20
In the second invocation of PROC CPM, the MINSEGMTDUR= option is used in
the RESOURCE statement to identify the variable minseg to the procedure. This
enables the algorithm to split the Drawings activity so that some of it is done be-
fore December 10, 2003, and the rest is scheduled to start on December 12, 2003.
Likewise, the production manager is allocated to the activity Mkt. Strat. on
December 15, 2003. On the 24th of December the activity Prototype demands
the production manager, and since preemption is allowed, the earlier activity Mkt.
Strat., which is less critical than Prototype, is temporarily halted and is resumed on
the 16th of January after the completion of Prototype on the 15th of January. The
Schedule data set, displayed in Output 2.19.4, contains separate observations for each
segment of the split activities as indicated by the variable SEGMT

NO. Note that


the project duration has been reduced by three working days, by allowing appropriate
activities to be split.
proc cpm date=01dec03d
data=widgr19
holidata=holdata resin=widgrin
out=spltschd resout=spltrout
interval=weekday collapse;
Example 2.19. Activity Splitting

239
activity task;
duration days;
successor succ;
holiday hol;
resource prodman hrdware / period=per obstype=otype
minsegmtdur=minseg
rcs avl;
id task;
run;
Output 2.19.4. Project Schedule: Splitting Allowed
Activity Splitting
Project Schedule: Splitting Allowed
Obs task succ SEGMT_NO days prodman hrdware
1 Approve Plan Drawings . 5 1 .
2 Drawings Prototype . 10 . 1
3 Drawings Prototype 1 2 . 1
4 Drawings Prototype 2 8 . 1
5 Anal. Market Mkt. Strat. . 5 . .
6 Write Specs Prototype . 5 . .
7 Prototype Materials . 15 1 .
8 Mkt. Strat. Test Market . 10 1 .
9 Mkt. Strat. Test Market 1 7 1 .
10 Mkt. Strat. Test Market 2 3 1 .
11 Materials Init. Prod. . 10 . .
12 Facility Init. Prod. . 10 . .
13 Init. Prod. Test Market . 10 1 .
14 Evaluate Changes . 10 1 .
15 Test Market Changes . 15 . .
16 Changes Production . 5 . .
17 Production . 0 1 .
18 Marketing . 0 . .
Obs S_START S_FINISH E_START E_FINISH L_START L_FINISH
1 01DEC03 05DEC03 01DEC03 05DEC03 01DEC03 05DEC03
2 08DEC03 23DEC03 08DEC03 19DEC03 08DEC03 19DEC03
3 08DEC03 09DEC03 08DEC03 19DEC03 08DEC03 19DEC03
4 12DEC03 23DEC03 08DEC03 19DEC03 08DEC03 19DEC03
5 08DEC03 12DEC03 08DEC03 12DEC03 21JAN04 27JAN04
6 08DEC03 12DEC03 08DEC03 12DEC03 15DEC03 19DEC03
7 24DEC03 15JAN04 22DEC03 13JAN04 22DEC03 13JAN04
8 15DEC03 20JAN04 15DEC03 29DEC03 28JAN04 10FEB04
9 15DEC03 23DEC03 15DEC03 29DEC03 28JAN04 10FEB04
10 16JAN04 20JAN04 15DEC03 29DEC03 28JAN04 10FEB04
11 16JAN04 29JAN04 14JAN04 27JAN04 14JAN04 27JAN04
12 16JAN04 29JAN04 14JAN04 27JAN04 14JAN04 27JAN04
13 30JAN04 12FEB04 28JAN04 10FEB04 28JAN04 10FEB04
14 13FEB04 26FEB04 11FEB04 24FEB04 18FEB04 02MAR04
15 13FEB04 04MAR04 11FEB04 02MAR04 11FEB04 02MAR04
16 05MAR04 11MAR04 03MAR04 09MAR04 03MAR04 09MAR04
17 12MAR04 12MAR04 10MAR04 10MAR04 10MAR04 10MAR04
18 13FEB04 13FEB04 11FEB04 11FEB04 10MAR04 10MAR04
240

Chapter 2. The CPM Procedure
Example 2.20. Alternate Resources
Some projects may have two or more resource types that are interchangeable; if one
resource is insufcient, the other one can be used in its place. To illustrate the use of
alternate resources, consider the widget manufacturing example with the data in AON
format as shown in Output 2.20.1. As in Example 2.17, suppose there are two types of
engineers, a design engineer and a production engineer. In addition, there is a generic
pool of engineers, denoted by the variable engpool. The resource requirements for
each category are specied in the data set WIDGR20.
Output 2.20.1. Alternate Resources: Activity Data Set
Scheduling with Alternate Resources
Data Set WIDGR20
Obs task days succ deseng prodeng engpool
1 Approve Plan 5 Drawings 1 1 .
2 Approve Plan 5 Anal. Market 1 1 .
3 Approve Plan 5 Write Specs 1 1 .
4 Drawings 10 Prototype 1 1 .
5 Anal. Market 5 Mkt. Strat. . 1 .
6 Write Specs 5 Prototype 1 1 .
7 Prototype 15 Materials 1 1 1
8 Prototype 15 Facility 1 1 1
9 Mkt. Strat. 10 Test Market . . .
10 Mkt. Strat. 10 Marketing . . .
11 Materials 10 Init. Prod. . . .
12 Facility 10 Init. Prod. . 1 2
13 Init. Prod. 10 Test Market . . 2
14 Init. Prod. 10 Marketing . . 2
15 Init. Prod. 10 Evaluate . . 2
16 Evaluate 10 Changes 1 . .
17 Test Market 15 Changes . . .
18 Changes 5 Production 1 1 .
19 Production 0 . . .
20 Marketing 0 . . .
Output 2.20.2. Alternate Resources: RESOURCEIN Data Set
Scheduling with Alternate Resources
Data Set RESIN20
Obs per otype resid deseng prodeng engpool
1 . restype 1 1 1
2 . altprty deseng . 1 2
3 . altprty prodeng . . 1
4 . suplevel 1 1 .
5 01DEC03 reslevel 1 1 4
Example 2.20. Alternate Resources

241
The resource availability data set RESIN20, displayed in Output 2.20.2, identies
all three resources as replenishable resources and indicates a primary as well as a
supplementary level of availability. A new variable resid in the data set is used
to identify resources in observations 2 and 3 that can be substituted for deseng and
prodeng, respectively. These observations have the value altprty for the OBSTYPE
variable and indicate a priority for the substitution. For example, observation number
2 indicates that if deseng is unavailable, the procedure can use prodeng, and if
even that is insufcient, it can draw from the engineering resource pool engpool.
To trigger the substitution of resources, use the RESID= option in the RESOURCE
statement.
Output 2.20.3. Alternate Resources Not Used
Scheduling with Alternate Resources
Alternate Resources not used
Obs task succ days deseng prodeng engpool S_START S_FINISH
1 Approve Plan Drawings 5 1 1 . 01DEC03 05DEC03
2 Drawings Prototype 10 1 1 . 08DEC03 19DEC03
3 Anal. Market Mkt. Strat. 5 . 1 . 04FEB04 10FEB04
4 Write Specs Prototype 5 1 1 . 22DEC03 29DEC03
5 Prototype Materials 15 1 1 1 30DEC03 20JAN04
6 Mkt. Strat. Test Market 10 . . . 11FEB04 24FEB04
7 Materials Init. Prod. 10 . . . 21JAN04 03FEB04
8 Facility Init. Prod. 10 . 1 2 21JAN04 03FEB04
9 Init. Prod. Test Market 10 . . 2 04FEB04 17FEB04
10 Evaluate Changes 10 1 . . 18FEB04 02MAR04
11 Test Market Changes 15 . . . 25FEB04 16MAR04
12 Changes Production 5 1 1 . 17MAR04 23MAR04
13 Production 0 . . . 24MAR04 24MAR04
14 Marketing 0 . . . 25FEB04 25FEB04
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 40 prodeng
4 08DEC03 12DEC03 15DEC03 19DEC03 10 deseng
5 22DEC03 13JAN04 22DEC03 13JAN04 0
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
First, PROC CPM is invoked without reference to the RESID variable. The procedure
ignores observations 2 and 3 in the RESOURCEIN data set (a message is written to
the log), and the project is scheduled using the available resources; the supplemen-
tary level is not used because the project can be scheduled using only the primary
resources by delaying it a few days. The project completion time is March 24, 2004
(see the schedule displayed in Output 2.20.3). The following program shows the
invocation of PROC CPM.
242

Chapter 2. The CPM Procedure
proc cpm date=01dec03d
interval=weekday collapse
data=widgr20 resin=resin20 holidata=holdata
out=widgo20 resout=widgro20;
activity task;
duration days;
successor succ;
holiday hol;
resource deseng prodeng engpool / period=per
obstype=otype
delayanalysis
rcs avl;
run;
Next, PROC CPM is invoked with the RESID= option, and the resulting Schedule
data set is displayed in Output 2.20.4. The new schedule shows that the project com-
pletion time (10MAR04) has been reduced by two weeks as a result of using alternate
resources.
Example 2.20. Alternate Resources

243
Output 2.20.4. Alternate Resources Used
Scheduling with Alternate Resources
Alternate Resources Reduce Project Completion Time
U U
p e U p e S
d r n d r n _
e o g e o g S
t s d s d p s d p T
O a u a e e o e e o A
b s c y n n o n n o R
s k c s g g l g g l T
1 Approve Plan Drawings 5 1 1 . 1 1 . 01DEC03
2 Drawings Prototype 10 1 1 . 1 1 . 08DEC03
3 Anal. Market Mkt. Strat. 5 . 1 . . . 1 08DEC03
4 Write Specs Prototype 5 1 1 . . . 2 08DEC03
5 Prototype Materials 15 1 1 1 1 1 1 22DEC03
6 Mkt. Strat. Test Market 10 . . . . . . 15DEC03
7 Materials Init. Prod. 10 . . . . . . 14JAN04
8 Facility Init. Prod. 10 . 1 2 . 1 2 14JAN04
9 Init. Prod. Test Market 10 . . 2 . . 2 28JAN04
10 Evaluate Changes 10 1 . . 1 . . 11FEB04
11 Test Market Changes 15 . . . . . . 11FEB04
12 Changes Production 5 1 1 . 1 1 . 03MAR04
13 Production 0 . . . . . . 10MAR04
14 Marketing 0 . . . . . . 11FEB04
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 05DEC03 01DEC03 05DEC03 01DEC03 05DEC03 0
2 19DEC03 08DEC03 19DEC03 08DEC03 19DEC03 0
3 12DEC03 08DEC03 12DEC03 21JAN04 27JAN04 0
4 12DEC03 08DEC03 12DEC03 15DEC03 19DEC03 0
5 13JAN04 22DEC03 13JAN04 22DEC03 13JAN04 0
6 29DEC03 15DEC03 29DEC03 28JAN04 10FEB04 0
7 27JAN04 14JAN04 27JAN04 14JAN04 27JAN04 0
8 27JAN04 14JAN04 27JAN04 14JAN04 27JAN04 0
9 10FEB04 28JAN04 10FEB04 28JAN04 10FEB04 0
10 24FEB04 11FEB04 24FEB04 18FEB04 02MAR04 0
11 02MAR04 11FEB04 02MAR04 11FEB04 02MAR04 0
12 09MAR04 03MAR04 09MAR04 03MAR04 09MAR04 0
13 10MAR04 10MAR04 10MAR04 10MAR04 10MAR04 0
14 11FEB04 11FEB04 11FEB04 10MAR04 10MAR04 0
When resource substitution is allowed, the procedure adds a new variable prexed
by a U for each resource variable; this new variable species the actual resources
used for each activity (as opposed to the resource required). Note that the activ-
ity Anal. Market requires one production engineer who is tied up with the ac-
tivity Drawings on the 8th of December. Since resource substitution is allowed,
the procedure uses an engineer from engpool as indicated by a missing value for
Uprodeng and a 1 for Uengpool in the third observation. Likewise, the activity
Write Specs is scheduled by substituting one engineer from engpool for a design
engineer and one for a production engineer to obtain Udeseng=., Uprodeng=.,
244

Chapter 2. The CPM Procedure
and Uengpool=2 in observation number 4. It is evident from the project nish
date (S

FINISH=L

FINISH=10MAR04) that resource substitution has enabled


the project to be completed without any delay. In fact, the DELAYANALYSIS
variables indicate that there is no delay in any of the activities (R

DELAY=0 and
DELAY

R= for all activities). Note also that supplementary levels are not used
(SUPPL

R= ) for any of the resources (recall that use of supplementary levels is


triggered by the specication of a nite value for DELAY).
The following program produced Output 2.20.4:
proc cpm date=01dec03d
interval=weekday collapse
data=widgr20 resin=resin20 holidata=holdata
out=widgalt resout=widralt;
activity task;
duration days;
successor succ;
holiday hol;
resource deseng prodeng engpool / period=per
obstype=otype
delayanalysis
resid=resid
rcs avl;
run;
The next two invocations of PROC CPM illustrate the use of both supplementary as
well as alternate resources. Note from the output data set, displayed in Output 2.20.5,
that once again the project is completed without any delay. Note also that the activity
Write Specs has used a supplementary resource whereas Anal. Market has used
an alternate resource. By default, when the DELAY= option is used, it forces the
procedure to use supplementary resources before alternate resources. To invert this
order so that alternate resources are used before supplementary resources, use the
ALTBEFORESUP option in the RESOURCE statement, as illustrated in the second
invocation of CPM in the following code. The resulting schedule is displayed in
Output 2.20.6; this schedule is, in fact, the same as the schedule displayed in Output
2.20.4, obtained without the DELAY=0 and the ALTBEFORESUP options.
Example 2.20. Alternate Resources

245
/* Invoke CPM with the DELAY=0 option */
proc cpm date=01dec03d
interval=weekday collapse
data=widgr20 resin=resin20 holidata=holdata
out=widgdsup resout=widrdsup;
activity task;
duration days;
successor succ;
holiday hol;
resource deseng prodeng engpool / period=per
obstype=otype
delayanalysis
delay=0
resid=resid
rcs avl;
run;
/* Invoke CPM with the DELAY=0 and ALTBEFORESUP options */
proc cpm date=01dec03d
interval=weekday collapse
data=widgr20 resin=resin20 holidata=holdata
out=widgdsup resout=widrdsup;
activity task;
duration days;
successor succ;
holiday hol;
resource deseng prodeng engpool / period=per
obstype=otype
delayanalysis
delay=0
resid=resid altbeforesup
rcs avl;
run;
246

Chapter 2. The CPM Procedure
Output 2.20.5. Supplementary Resources Used Before Alternate Resources
Scheduling with Alternate Resources
DELAY=0, Supplementary Resources Used instead of Alternate
U U S
p e U p e S _
d r n d r n _ F
e o g e o g S I
t s d s d p s d p T N
O a u a e e o e e o A I
b s c y n n o n n o R S
s k c s g g l g g l T H
1 Approve Plan Drawings 5 1 1 . 1 1 . 01DEC03 05DEC03
2 Drawings Prototype 10 1 1 . 1 1 . 08DEC03 19DEC03
3 Anal. Market Mkt. Strat. 5 . 1 . . . 1 08DEC03 12DEC03
4 Write Specs Prototype 5 1 1 . 1 1 . 08DEC03 12DEC03
5 Prototype Materials 15 1 1 1 1 1 1 22DEC03 13JAN04
6 Mkt. Strat. Test Market 10 . . . . . . 15DEC03 29DEC03
7 Materials Init. Prod. 10 . . . . . . 14JAN04 27JAN04
8 Facility Init. Prod. 10 . 1 2 . 1 2 14JAN04 27JAN04
9 Init. Prod. Test Market 10 . . 2 . . 2 28JAN04 10FEB04
10 Evaluate Changes 10 1 . . 1 . . 11FEB04 24FEB04
11 Test Market Changes 15 . . . . . . 11FEB04 02MAR04
12 Changes Production 5 1 1 . 1 1 . 03MAR04 09MAR04
13 Production 0 . . . . . . 10MAR04 10MAR04
14 Marketing 0 . . . . . . 11FEB04 11FEB04
E L
E _ L _ R D S
_ F _ F _ E U
S I S I D L P
T N T N E A P
O A I A I L Y L
b R S R S A _ _
s T H T H Y R R
1 01DEC03 05DEC03 01DEC03 05DEC03 0
2 08DEC03 19DEC03 08DEC03 19DEC03 0
3 08DEC03 12DEC03 21JAN04 27JAN04 0
4 08DEC03 12DEC03 15DEC03 19DEC03 0 deseng
5 22DEC03 13JAN04 22DEC03 13JAN04 0
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
Example 2.21. PERT Assumptions and Calculations

247
Output 2.20.6. Alternate Resources Used Before Supplementary Resources
Scheduling with Alternate Resources
DELAY=0, Alternate Resources Used instead of Supplementary
U U
p e U p e S
d r n d r n _
e o g e o g S
t s d s d p s d p T
O a u a e e o e e o A
b s c y n n o n n o R
s k c s g g l g g l T
1 Approve Plan Drawings 5 1 1 . 1 1 . 01DEC03
2 Drawings Prototype 10 1 1 . 1 1 . 08DEC03
3 Anal. Market Mkt. Strat. 5 . 1 . . . 1 08DEC03
4 Write Specs Prototype 5 1 1 . . . 2 08DEC03
5 Prototype Materials 15 1 1 1 1 1 1 22DEC03
6 Mkt. Strat. Test Market 10 . . . . . . 15DEC03
7 Materials Init. Prod. 10 . . . . . . 14JAN04
8 Facility Init. Prod. 10 . 1 2 . 1 2 14JAN04
9 Init. Prod. Test Market 10 . . 2 . . 2 28JAN04
10 Evaluate Changes 10 1 . . 1 . . 11FEB04
11 Test Market Changes 15 . . . . . . 11FEB04
12 Changes Production 5 1 1 . 1 1 . 03MAR04
13 Production 0 . . . . . . 10MAR04
14 Marketing 0 . . . . . . 11FEB04
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 05DEC03 01DEC03 05DEC03 01DEC03 05DEC03 0
2 19DEC03 08DEC03 19DEC03 08DEC03 19DEC03 0
3 12DEC03 08DEC03 12DEC03 21JAN04 27JAN04 0
4 12DEC03 08DEC03 12DEC03 15DEC03 19DEC03 0
5 13JAN04 22DEC03 13JAN04 22DEC03 13JAN04 0
6 29DEC03 15DEC03 29DEC03 28JAN04 10FEB04 0
7 27JAN04 14JAN04 27JAN04 14JAN04 27JAN04 0
8 27JAN04 14JAN04 27JAN04 14JAN04 27JAN04 0
9 10FEB04 28JAN04 10FEB04 28JAN04 10FEB04 0
10 24FEB04 11FEB04 24FEB04 18FEB04 02MAR04 0
11 02MAR04 11FEB04 02MAR04 11FEB04 02MAR04 0
12 09MAR04 03MAR04 09MAR04 03MAR04 09MAR04 0
13 10MAR04 10MAR04 10MAR04 10MAR04 10MAR04 0
14 11FEB04 11FEB04 11FEB04 10MAR04 10MAR04 0
Example 2.21. PERT Assumptions and Calculations
This example illustrates the PERT statistical approach. Throughout this chapter, it has
been assumed that the activity duration times are precise values determined uniquely.
In practice, however, each activity is subject to a number of chance sources of vari-
ation and it is impossible to know, a priori, the duration of the activity. The PERT
statistical approach is used to include uncertainty about durations in scheduling. For a
detailed discussion about various assumptions, techniques, and cautions related to the
PERT approach, refer to Moder, Phillips, and Davis (1983) and Elmaghraby (1977).
248

Chapter 2. The CPM Procedure
A simple model is used here to illustrate how PROC CPM can incorporate some of
these ideas. A more detailed example can be found in SAS/OR Software: Project
Management Examples.
Consider the widget manufacturing example. To perform PERT analysis, you need to
provide three estimates of activity duration: a pessimistic estimate (tp), an optimistic
estimate (to), and a modal estimate (tm). These three estimates are used to obtain a
weighted average that is assumed to be a reasonable estimate of the activity duration.
Note that the time estimates for the activities must be independent for the analysis to
be considered valid. Furthermore, the distribution of activity duration times is purely
hypothetical, as no statistical sampling is likely to be feasible on projects of a unique
nature to be accomplished at some indeterminate time in the future. Often, the time
estimates used are based on past experience with similar projects.
To derive the formula for the mean, you must assume some functional form for the
unknown distribution. The well-known Beta distribution is commonly used, as it
has the desirable properties of being contained inside a nite interval and can be
symmetric or skewed, depending on the location of the mode relative to the optimistic
and pessimistic estimates. A linear approximation of the exact formula for the mean
of the beta distribution weights the three time estimates as follows:
(tp + (4*tm) + to) / 6
The following program saves the network (AOA format) from Example 2.2 with three
estimates of activity durations in a SAS data set. The DATA step also calculates
the weighted average duration for each activity. Following the DATA step, PROC
CPM is invoked to produce the schedule plotted on a Gantt chart in Output 2.21.1.
The E

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

LEV variable species the level of


the subtask within the tree dening the project hierarchy, starting with the level 0
for the master project (or the root), Survey. The variable WBS

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, and other project-related variables can be used to dis-


play selected information about specic subprojects, summary information about
subprojects at a given level of the hierarchy, and more. For example, the follow-
ing statements display the summary schedule of the rst level subtasks of the Survey
project (Output 2.23.4).
title Market Survey;
title2 Summary Schedule;
proc print data=survout1;
where proj_lev=1;
id activity;
var proj_dur duration e_start--t_float;
run;
Output 2.23.4. Survey Project Summary
Market Survey
Summary Schedule
activity PROJ_DUR duration E_START E_FINISH L_START L_FINISH T_FLOAT
Plan 7 6 29MAR04 06APR04 29MAR04 07APR04 1
Prepare 8 8 02APR04 14APR04 02APR04 14APR04 0
Implement 16 18 15APR04 06MAY04 15APR04 06MAY04 0
The variable WBS

CODE in the Schedule data set (see Output 2.23.2) contains


the Work Breakdown structure code dened by the CPM procedure. This code is
dened to be 0.1 for the subproject Prepare. Thus, the values of 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

DUR, is used to set


an upper bound on the late nish time of each subproject, while in Output 2.23.8,
the specied project duration is used for the same purpose. Here, only the summary
schedules are displayed; the effect of the two options on the subtasks within each
subproject can be seen by displaying the entire schedule in each case. A Gantt chart
of the entire project is displayed in Output 2.23.9.
262

Chapter 2. The CPM Procedure
Output 2.23.8. Summary Schedule: FBDATE and USEPROJDUR Options
Market Survey
Summary Schedule: FBDATE and USEPROJDUR Options
activity PROJ_DUR duration E_START E_FINISH L_START L_FINISH T_FLOAT
Plan 7 6 29MAR04 06APR04 26MAR04 05APR04 -1
Prepare 8 8 02APR04 14APR04 02APR04 14APR04 0
Implement 16 18 15APR04 06MAY04 16APR04 07MAY04 1
Output 2.23.9. Gantt Chart of Schedule
The project schedule is further affected by the presence of any alignment dates on the
individual activities or subprojects. For example, if the implementation phase of the
project has a deadline of May 5, 2004, you can specify an alignment date and type
variable with the appropriate values for the subproject Implement, as follows, and
invoke PROC CPM with the ALIGNDATE and ALIGNTYPE statements, to obtain
the new schedule, displayed in Output 2.23.10.
data survey2;
format aldate date7.;
set survey;
if activity="Implement" then do;
altype="fle";
aldate=5may04d;
end;
run;
Example 2.24. Resource-Driven Durations and Resource Calendars

263
proc cpm data=survey2 date=29mar04d out=survout5
interval=weekday holidata=holidata
fbdate=10jun04d;
activity activity;
successor succ1-succ3;
duration duration;
id id;
holiday hol;
project project / orderall addwbs sepcrit useprojdur;
aligntype altype;
aligndate aldate;
run;
title Market Survey;
title2 USEPROJDUR option and Alignment date;
proc print;
where proj_lev=1;
id activity;
var proj_dur duration e_start--t_float;
run;
Output 2.23.10. USEPROJDUR option and Alignment Date
Market Survey
Summary Schedule: USEPROJDUR option and Alignment date
activity PROJ_DUR duration E_START E_FINISH L_START L_FINISH T_FLOAT
Plan 7 6 29MAR04 06APR04 26MAR04 05APR04 -1
Prepare 8 8 02APR04 14APR04 01APR04 13APR04 -1
Implement 16 18 15APR04 06MAY04 14APR04 05MAY04 -1
Example 2.24. Resource-Driven Durations and Resource
Calendars
This example illustrates the effect of resource-driven durations and resource calendars
on the schedule of a project involving multiple resources.
In projects that use manpower as a resource, the same activity may require different
amounts of work from different people. Also, the work schedules and vacations may
differ for each individual person. All of these factors may cause the schedules for the
different resources used by the activity to differ from each other.
Consider a software project requiring two resources: a programmer and a tester. A
network diagram displaying the activities and their precedence relationships is shown
in Figure 2.8.
264

Chapter 2. The CPM Procedure
Figure 2.8. Software Project Network
Some of the activities in this project have a xed duration, requiring the same length
of time from both resources; others require a different number of days from the
programmer and the tester. Further, some activities require only a fraction of the
resource; for example, Documentation requires only 20 percent of the program-
mers time for a total of two man-days. The activities in the project, their durations
(if xed) in days, the total work required (if resource-driven) in days, the prece-
dence constraints, and the resource requirements are displayed in Output 2.24.1.
Note that there are two observations for some of the activities (Product Design and
Documentation) which require different amounts of work from each resource.
Example 2.24. Resource-Driven Durations and Resource Calendars

265
Output 2.24.1. Project Data
Software Development
Activity Data Set SOFTWARE
Activity act s1 s2 dur mandays Programmer Tester
Plans & Reqts 1 2 3 2 . 1.0 1.0
Product Design 2 4 5 . 3 1.0 .
Product Design 2 . . . 1 . 1.0
Test Plan 3 6 7 3 . . 1.0
Documentation 4 9 . . 2 0.2 .
Documentation 4 . . . 1 . 0.5
Code 5 8 . 10 . 0.8 .
Test Data 6 8 . 5 . . 0.5
Test Routines 7 8 . 5 . . 0.5
Test Product 8 9 . 6 . 0.5 1.0
Finish 9 . . 0 . . .
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 each resource used by an activity. If the WORK vari-
able 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. Unlike xed-duration scheduling, each re-
source used by an activity could have a different schedule; an activity is assumed to
be nished only when all of its resources have nished working on it.
proc cpm data=software out=sftout ressched=rsftout
date=12apr04d interval=weekday resout=rout;
act act;
succ s1 s2;
dur dur;
res Programmer Tester / work=mandays
rschedid=Activity;
id Activity;
run;
The individual resource schedules, as well as each activitys combined schedule, are
saved in a Resource Schedule data set, RSFTOUT, requested by the RESSCHED=
option on the CPM statement. This output data set (displayed in Output 2.24.2) is
very similar to the Schedule data set and contains the activity variable and all the
relevant schedule variables (E

START, E

FINISH, L

START, and so forth).


266

Chapter 2. The CPM Procedure
Output 2.24.2. Resource Schedule Data Set
Software Development
Resource Schedule Data Set RSFTOUT
A R D E L
c E U m E _ L _
t S R a R _ F _ F
i O _ n _ S I S I
v U T d R T N T N
i a R Y d a A A I A I
t c C P u y T R S R S
y t E E r s E T H T H
Plans & Reqts 1 2 . . 12APR04 13APR04 12APR04 13APR04
Plans & Reqts 1 Programmer FIXED 2 . 1.0 12APR04 13APR04 12APR04 13APR04
Plans & Reqts 1 Tester FIXED 2 . 1.0 12APR04 13APR04 12APR04 13APR04
Product Design 2 3 . . 14APR04 16APR04 14APR04 16APR04
Product Design 2 Programmer RDRIVEN 3 3 1.0 14APR04 16APR04 14APR04 16APR04
Product Design 2 Tester RDRIVEN 1 1 1.0 14APR04 14APR04 16APR04 16APR04
Test Plan 3 3 . . 14APR04 16APR04 21APR04 23APR04
Test Plan 3 Tester FIXED 3 . 1.0 14APR04 16APR04 21APR04 23APR04
Documentation 4 10 . . 19APR04 30APR04 27APR04 10MAY04
Documentation 4 Programmer RDRIVEN 10 2 0.2 19APR04 30APR04 27APR04 10MAY04
Documentation 4 Tester RDRIVEN 2 1 0.5 19APR04 20APR04 07MAY04 10MAY04
Code 5 10 . . 19APR04 30APR04 19APR04 30APR04
Code 5 Programmer FIXED 10 . 0.8 19APR04 30APR04 19APR04 30APR04
Test Data 6 5 . . 19APR04 23APR04 26APR04 30APR04
Test Data 6 Tester FIXED 5 . 0.5 19APR04 23APR04 26APR04 30APR04
Test Routines 7 5 . . 19APR04 23APR04 26APR04 30APR04
Test Routines 7 Tester FIXED 5 . 0.5 19APR04 23APR04 26APR04 30APR04
Test Product 8 6 . . 03MAY04 10MAY04 03MAY04 10MAY04
Test Product 8 Programmer FIXED 6 . 0.5 03MAY04 10MAY04 03MAY04 10MAY04
Test Product 8 Tester FIXED 6 . 1.0 03MAY04 10MAY04 03MAY04 10MAY04
Finish 9 0 . . 11MAY04 11MAY04 11MAY04 11MAY04
For each activity in the project, the Resource Schedule data set contains the schedule
for the entire activity as well as the schedule for each resource used by the activity.
The variable RESOURCE identies the name of the resource to which the observa-
tion refers and has missing values for observations that refer to the entire activitys
schedule. The value of the variable DUR

TYPE indicates whether the resource


drives the activitys duration (RDRIVEN) or not (FIXED).
The DURATION variable, dur, indicates the duration of the activity for the resource
identied in that observation. For resources that are of the driving type, the WORK
variable, mandays, shows the total amount of work (in units of the INTERVAL
parameter) 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 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

TYPE indicates whether the resource drives the activitys duration


(RDRIVEN) or not (FIXED).
Example 2.25. Resource-Driven Durations and Alternate Resources

275
proc cpm data=software
out=sftout1 resout=rout1
rsched=rsftout1
resin=resin
date=12apr04d interval=weekday;
act act;
succ s1 s2;
dur dur;
res Programmer / work=mandays
obstype=otype
period=per
rschedid=Activity;
id Activity;
run;
title Software Development;
title2 Resource Constrained Schedule: Single Programmer;
proc print data=rsftout1;
id Activity;
run;
Output 2.25.2. Resource Schedule
Software Development
Resource Constrained Schedule: Single Programmer
Activity act RESOURCE DUR_TYPE dur mandays R_RATE S_START
Plans & Reqts 1 2 . . 12APR04
Plans & Reqts 1 Programmer FIXED 2 . 1 12APR04
Product Design 2 3 . . 14APR04
Product Design 2 Programmer RDRIVEN 3 3 1 14APR04
Test Plan 3 3 . . 14APR04
Documentation 4 1 . . 11MAY04
Documentation 4 Programmer RDRIVEN 2 2 1 11MAY04
Code 5 1 . . 19APR04
Code 5 Programmer RDRIVEN 10 10 1 19APR04
Test Data 6 5 . . 19APR04
Test Routines 7 5 . . 19APR04
Test Product 8 6 . . 03MAY04
Test Product 8 Programmer FIXED 6 . 1 03MAY04
Finish 9 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
Product Design 16APR04 14APR04 16APR04 14APR04 16APR04
Product Design 16APR04 14APR04 16APR04 14APR04 16APR04
Test Plan 16APR04 14APR04 16APR04 21APR04 23APR04
Documentation 12MAY04 19APR04 20APR04 07MAY04 10MAY04
Documentation 12MAY04 19APR04 20APR04 07MAY04 10MAY04
Code 30APR04 19APR04 30APR04 19APR04 30APR04
Code 30APR04 19APR04 30APR04 19APR04 30APR04
Test Data 23APR04 19APR04 23APR04 26APR04 30APR04
Test Routines 23APR04 19APR04 23APR04 26APR04 30APR04
Test Product 10MAY04 03MAY04 10MAY04 03MAY04 10MAY04
Test Product 10MAY04 03MAY04 10MAY04 03MAY04 10MAY04
Finish 13MAY04 11MAY04 11MAY04 11MAY04 11MAY04
276

Chapter 2. The CPM Procedure
The following statements invoke PROCGANTT to display a Gantt chart of the sched-
ule in Output 2.25.3. Note that the activity, Documentation, is delayed until May
11, 2004, because there is only one programmer available to the project.
title h=2 Software Development;
title2 h=1.5 Resource Constrained Schedule: Single Programmer;
proc gantt graphics data=sftout1;
id Activity Programmer;
chart / pcompress scale=3 increment=4 interval=weekday
height=2.5 nojobnum nolegend between=5
act=act succ=(s1 s2)
;
run;
Output 2.25.3. Resource-Constrained Schedule: Single Programmer
Next, suppose that you have two programmers assigned to your project and you can
use either one of them for a given task, depending on their availability. To model
this scenario, specify Chris and John as alternate resources that can be substituted
for the resource Programmer. The Resource data set, resin2, printed in Output
2.25.4, indicates that Chris and John are alternates for Programmer. Specifying
an availability of 0 for the resource Programmer ensures that the procedure will
assign one of the two programmers, Chris or John, to each task.
The second observation in the data set resin2 indicates two different rates of sub-
stitution for the alternate resources. A value less than 1 indicates that the alternate
Example 2.25. Resource-Driven Durations and Alternate Resources

277
resource is more efcient than the primary resource, while a value greater than 1 in-
dicates that the alternate resource is less efcient. For xed-duration activities, the
use of the alternate resource changes the rate of utilization of the resource, while for
a resource-driven activity, it changes the duration of the resource. The data set resin
species that John is twice as efcient as the primary resource Programmer while
Chris takes one and a half times as long as the generic resource to accomplish a task.
Output 2.25.4. Alternate Programmers
Resource Data Set RESIN2
Obs per otype resid Programmer Chris John
1 . resrcdur 1 1.0 1.0
2 . altrate Programmer . 1.5 0.5
3 12APR04 reslevel . 1.0 1.0
The following statements invoke PROC CPM with the new Resource data set and a
modied Activity data set that includes the newly added resource variables, Chris and
John. You can see the effects of the alternate resource specications in the Resource
Schedule data set, printed in Output 2.25.5. Note that the activity Product Design
that takes 3 days of time from a generic programmer actually takes 4.5 days because
the programmer used is Chris, who is substituted at a rate of 1.5. On the other hand,
the programmer John efciently completes the task, Documentation, in only 1 day,
instead of the planned 2 days for a generic programmer. Note also that the start and
nish times are specied as SAS datetime values because the substitution of alternate
resources results in some of the resource durations being fractional.
data software2;
set software;
Chris = .;
John = .;
run;
proc cpm data=software2 out=sftout2 rsched=rsftout2
resin=resin2
date=12apr04d interval=weekday resout=rout2;
act act;
succ s1 s2;
dur dur;
res Programmer Chris John / work=mandays
obstype=otype
period=per
resid=resid
rschedid=Activity;
id Activity;
run;
278

Chapter 2. The CPM Procedure
Output 2.25.5. Resource Schedule with Alternate Programmers
Software Development
Resource Constrained Schedule
Alternate Resources at Varying Rates
Activity act RESOURCE DUR_TYPE dur mandays R_RATE S_START
Plans & Reqts 1 2.0 . . 12APR04:00:00:00
Plans & Reqts 1 Programmer FIXED 2.0 . 1.0 .
Plans & Reqts 1 John FIXED 2.0 . 0.5 12APR04:00:00:00
Product Design 2 3.0 . . 14APR04:00:00:00
Product Design 2 Programmer RDRIVEN 3.0 3.0 1.0 .
Product Design 2 Chris RDRIVEN 4.5 4.5 1.0 14APR04:00:00:00
Test Plan 3 3.0 . . 14APR04:00:00:00
Documentation 4 1.0 . . 20APR04:12:00:00
Documentation 4 Programmer RDRIVEN 2.0 2.0 1.0 .
Documentation 4 John RDRIVEN 1.0 1.0 1.0 20APR04:12:00:00
Code 5 1.0 . . 20APR04:12:00:00
Code 5 Programmer RDRIVEN 10.0 10.0 1.0 .
Code 5 Chris RDRIVEN 15.0 15.0 1.0 20APR04:12:00:00
Test Data 6 5.0 . . 19APR04:00:00:00
Test Routines 7 5.0 . . 19APR04:00:00:00
Test Product 8 6.0 . . 11MAY04:12:00:00
Test Product 8 Programmer FIXED 6.0 . 1.0 .
Test Product 8 John FIXED 6.0 . 0.5 11MAY04:12:00:00
Finish 9 0.0 . . 19MAY04:12:00:00
Activity S_FINISH E_START E_FINISH
Plans & Reqts 13APR04:23:59:59 12APR04:00:00:00 13APR04:23:59:59
Plans & Reqts . 12APR04:00:00:00 13APR04:23:59:59
Plans & Reqts 13APR04:23:59:59 . .
Product Design 20APR04:11:59:59 14APR04:00:00:00 16APR04:23:59:59
Product Design . 14APR04:00:00:00 16APR04:23:59:59
Product Design 20APR04:11:59:59 . .
Test Plan 16APR04:23:59:59 14APR04:00:00:00 16APR04:23:59:59
Documentation 21APR04:11:59:59 19APR04:00:00:00 20APR04:23:59:59
Documentation . 19APR04:00:00:00 20APR04:23:59:59
Documentation 21APR04:11:59:59 . .
Code 11MAY04:11:59:59 19APR04:00:00:00 30APR04:23:59:59
Code . 19APR04:00:00:00 30APR04:23:59:59
Code 11MAY04:11:59:59 . .
Test Data 23APR04:23:59:59 19APR04:00:00:00 23APR04:23:59:59
Test Routines 23APR04:23:59:59 19APR04:00:00:00 23APR04:23:59:59
Test Product 19MAY04:11:59:59 03MAY04:00:00:00 10MAY04:23:59:59
Test Product . 03MAY04:00:00:00 10MAY04:23:59:59
Test Product 19MAY04:11:59:59 . .
Finish 19MAY04:12:00:00 11MAY04:00:00:00 11MAY04:00:00:00
Example 2.26. Multiple Alternate Resources

279
Example 2.26. Multiple Alternate Resources
Output 2.26.1. Multiple Alternates
Software Development
Use of Multiple Alternate Resources
Activity Data Set
Obs Activity dur mandays act s1 s2 Programmer Chris John
1 Plans & Reqts 2 . 1 2 3 2 . .
2 Product Design . 3 2 4 5 1 . .
3 Test Plan 3 . 3 6 7 . . .
4 Documentation 1 2 4 9 . 1 . .
5 Code 1 10 5 8 . 1 . .
6 Test Data 5 . 6 8 . . . .
7 Test Routines 5 . 7 8 . . . .
8 Test Product 6 . 8 9 . 1 . .
9 Finish 0 . 9 . . . . .
Software Development
Use of Multiple Alternate Resources
Resource Data Set
Obs per otype resid Programmer Chris John
1 . resrcdur 1 1 1
2 . altrate Programmer . 1 1
3 12APR04 reslevel . 1 1
This example illustrates the use of the MULTIPLEALTERNATES option. The
Activity data set printed in Output 2.26.1 is a slightly modied version of the data
set in Example 2.25. The difference is in the resource requirement for the rst activ-
ity in the project. The Plans and Requirements task requires 2 programmers. By
default, when alternate resources are used, the CPM procedures cannot use multiple
alternate resources to substitute for any given resource. In this example, however, you
would like the procedure to use both Chris and John for the rst task. The Resource
data set resmult is also printed in Output 2.26.1, showing that both Chris and John
are alternates that can be substituted at the same rate as the primary resource.
To enable PROC CPM to use multiple alternates, use the MULTIPLEALTERNATES
option, as shown in the following invocation:
proc cpm data=softmult out=sftmult rsched=rsftmult
resin=resmult
date=12apr04d interval=weekday resout=routmult;
act act;
succ s1 s2;
dur dur;
res Programmer Chris John / work=mandays
obstype=otype
period=per resid=resid
multiplealternates
rschedid=Activity;
id Activity;
run;
280

Chapter 2. The CPM Procedure
The resulting schedule is printed in Output 2.26.2. Note that both programmers are
used for the activity Plans and Reqts.
Output 2.26.2. Multiple Alternates: Resource Schedule Data Set
Software Development
Use of Multiple Alternate Resources
Resource Constrained Schedule
Activity act RESOURCE DUR_TYPE dur mandays R_RATE S_START
Plans & Reqts 1 2 . . 12APR04
Plans & Reqts 1 Programmer FIXED 2 . 2 .
Plans & Reqts 1 John FIXED 2 . 1 12APR04
Plans & Reqts 1 Chris FIXED 2 . 1 12APR04
Product Design 2 3 . . 14APR04
Product Design 2 Programmer RDRIVEN 3 3 1 .
Product Design 2 Chris RDRIVEN 3 3 1 14APR04
Test Plan 3 3 . . 14APR04
Documentation 4 1 . . 19APR04
Documentation 4 Programmer RDRIVEN 2 2 1 .
Documentation 4 John RDRIVEN 2 2 1 19APR04
Code 5 1 . . 19APR04
Code 5 Programmer RDRIVEN 10 10 1 .
Code 5 Chris RDRIVEN 10 10 1 19APR04
Test Data 6 5 . . 19APR04
Test Routines 7 5 . . 19APR04
Test Product 8 6 . . 03MAY04
Test Product 8 Programmer FIXED 6 . 1 .
Test Product 8 Chris FIXED 6 . 1 03MAY04
Finish 9 0 . . 11MAY04
Activity S_FINISH E_START E_FINISH L_START L_FINISH
Plans & Reqts 13APR04 12APR04 13APR04 12APR04 13APR04
Plans & Reqts . 12APR04 13APR04 12APR04 13APR04
Plans & Reqts 13APR04 . . . .
Plans & Reqts 13APR04 . . . .
Product Design 16APR04 14APR04 16APR04 14APR04 16APR04
Product Design . 14APR04 16APR04 14APR04 16APR04
Product Design 16APR04 . . . .
Test Plan 16APR04 14APR04 16APR04 21APR04 23APR04
Documentation 20APR04 19APR04 20APR04 07MAY04 10MAY04
Documentation . 19APR04 20APR04 07MAY04 10MAY04
Documentation 20APR04 . . . .
Code 30APR04 19APR04 30APR04 19APR04 30APR04
Code . 19APR04 30APR04 19APR04 30APR04
Code 30APR04 . . . .
Test Data 23APR04 19APR04 23APR04 26APR04 30APR04
Test Routines 23APR04 19APR04 23APR04 26APR04 30APR04
Test Product 10MAY04 03MAY04 10MAY04 03MAY04 10MAY04
Test Product . 03MAY04 10MAY04 03MAY04 10MAY04
Test Product 10MAY04 . . . .
Finish 11MAY04 11MAY04 11MAY04 11MAY04 11MAY04
Example 2.27. Auxiliary Resources and Alternate Resources

281
Example 2.27. Auxiliary Resources and Alternate Resources
This example illustrates the use of Auxiliary resources. In the earlier examples, the
use of alternate resources enabled the allocation of either John or Chris to the pro-
gramming tasks. Now, suppose that each of the programmers has a different tester,
and whenever a particular programmer is scheduled for a given task, his tester also
needs to allocate some part of his or her time, say 50 percent, to the same task. To
model such a scenario, specify Tester1 and Tester2 as auxiliary resources for Chris
and John, respectively. The Activity and Resource data sets are printed in Output
2.27.1. Unlike the earlier examples, all the activities are of xed-duration.
Output 2.27.1. Auxiliary Resources: Input Data Sets
Software Development
Alternate and Auxiliary Resources
Activity Data Set
Obs Activity dur act s1 s2 Programmer Chris John Tester1 Tester2
1 Plans & Reqts 2 1 2 3 1 . . . .
2 Product Design 3 2 4 5 1 . . . .
3 Test Plan 3 3 6 7 . . . . .
4 Documentation 3 4 9 . 1 . . . .
5 Code 10 5 8 . 1 . . . .
6 Test Data 5 6 8 . . . . . .
7 Test Routines 5 7 8 . . . . . .
8 Test Product 6 8 9 . 1 . . . .
9 Finish 0 9 . . . . . . .
Software Development
Alternate and Auxiliary Resources
Resource Data Set
Obs per otype resid Programmer Chris John Tester1 Tester2
1 . altrate Programmer . 1 1 . .
2 . auxres Chris . . . 0.5 .
3 . auxres John . . . . 0.5
4 12APR04 reslevel . 1 1 1.0 1.0
The following statements invoke PROC CPM with the appropriate data sets and re-
source variables. The resulting schedule is printed in Output 2.27.2. Note the auxil-
iary resources that have been included in the schedule corresponding to each primary
resource: Tester1 whenever Chris is used, and Tester2 whenever John is allocated.
proc cpm data=softaux out=sftaux rsched=rsftaux resin=resaux
date=12apr04d interval=weekday resout=raux;
act act;
succ s1 s2;
dur dur;
res Programmer Chris John Tester1 Tester2 /
obstype=otype
period=per resid=resid
multalt rschedid=Activity;
id Activity;
run;
282

Chapter 2. The CPM Procedure
Output 2.27.2. Auxiliary Resources: Resource Schedule Data Set
Software Development: Alternate and Auxiliary Resources
Resource Schedule Data Set
Activity act RESOURCE DUR_TYPE dur _WORK_ R_RATE S_START
Plans & Reqts 1 2 . . 12APR04
Plans & Reqts 1 Programmer FIXED 2 . 1.0 .
Plans & Reqts 1 Tester1 FIXED 2 . 0.5 12APR04
Plans & Reqts 1 Chris FIXED 2 . 1.0 12APR04
Product Design 2 3 . . 14APR04
Product Design 2 Programmer FIXED 3 . 1.0 .
Product Design 2 Tester1 FIXED 3 . 0.5 14APR04
Product Design 2 Chris FIXED 3 . 1.0 14APR04
Test Plan 3 3 . . 14APR04
Documentation 4 3 . . 19APR04
Documentation 4 Programmer FIXED 3 . 1.0 .
Documentation 4 Tester2 FIXED 3 . 0.5 19APR04
Documentation 4 John FIXED 3 . 1.0 19APR04
Code 5 10 . . 19APR04
Code 5 Programmer FIXED 10 . 1.0 .
Code 5 Tester1 FIXED 10 . 0.5 19APR04
Code 5 Chris FIXED 10 . 1.0 19APR04
Test Data 6 5 . . 19APR04
Test Routines 7 5 . . 19APR04
Test Product 8 6 . . 03MAY04
Test Product 8 Programmer FIXED 6 . 1.0 .
Test Product 8 Tester1 FIXED 6 . 0.5 03MAY04
Test Product 8 Chris FIXED 6 . 1.0 03MAY04
Finish 9 0 . . 11MAY04
Activity S_FINISH E_START E_FINISH L_START L_FINISH
Plans & Reqts 13APR04 12APR04 13APR04 12APR04 13APR04
Plans & Reqts . 12APR04 13APR04 12APR04 13APR04
Plans & Reqts 13APR04 . . . .
Plans & Reqts 13APR04 . . . .
Product Design 16APR04 14APR04 16APR04 14APR04 16APR04
Product Design . 14APR04 16APR04 14APR04 16APR04
Product Design 16APR04 . . . .
Product Design 16APR04 . . . .
Test Plan 16APR04 14APR04 16APR04 21APR04 23APR04
Documentation 21APR04 19APR04 21APR04 06MAY04 10MAY04
Documentation . 19APR04 21APR04 06MAY04 10MAY04
Documentation 21APR04 . . . .
Documentation 21APR04 . . . .
Code 30APR04 19APR04 30APR04 19APR04 30APR04
Code . 19APR04 30APR04 19APR04 30APR04
Code 30APR04 . . . .
Code 30APR04 . . . .
Test Data 23APR04 19APR04 23APR04 26APR04 30APR04
Test Routines 23APR04 19APR04 23APR04 26APR04 30APR04
Test Product 10MAY04 03MAY04 10MAY04 03MAY04 10MAY04
Test Product . 03MAY04 10MAY04 03MAY04 10MAY04
Test Product 10MAY04 . . . .
Test Product 10MAY04 . . . .
Finish 11MAY04 11MAY04 11MAY04 11MAY04 11MAY04
Example 2.28. Use of the SETFINISHMILESTONE Option

283
Example 2.28. Use of the SETFINISHMILESTONE Option
A simple activity network is used to illustrate the use of the
SETFINISHMILESTONE option in a couple of different scenarios.
The following DATA step reads the project network in AON format into a SAS data
set named tasks. The data set (printed in Output 2.28.1) contains an Activity vari-
able (act), a Successor variable (succ), a Lag variable (lag), and a Duration variable
(dur). Note that there are several milestones linked to other activities through dif-
ferent types of precedence constraints. The data set also contains some alignment
constraints as specied by the variables target and trgttype. Note that the treatment
of the milestones will vary depending on the presence or absence of the alignment
constraints. The data set also contains two variables that indicate the expected early
schedule dates for the milestones corresponding to two different invocations of PROC
CPM: the variable notrgtmd corresponds to the non-aligned schedule and the vari-
able miledate corresponds to an invocation with the ALIGNDATE statement (the
values for these variables are explained later).
data tasks;
format act $7. succ $7. lag $4. target date7.
trgttype $3. miledate date7. notrgtmd date7. ;
input act & succ & lag $ dur target & date7.
trgttype $ miledate & date7. notrgtmd & date7. ;
datalines;
Task 0 Mile 1 ss_0 1 26Jan04 SGE . .
Mile 1 Task 2 . 0 . . 26Jan04 26Jan04
Task 2 . . 1 . . . .
Task 3 Mile 4 . 1 . . . .
Mile 4 . . 0 . . 26Jan04 26Jan04
Task 5 Mile 6 . 1 . . . .
Mile 6 Mile 7 FS_1 0 . . 26Jan04 26Jan04
Mile 7 . . 0 . . 27Jan04 27Jan04
Task 8 Mile 9 SS_3 1 . . . .
Mile 9 Mile 10 . 0 . . 29Jan04 29Jan04
Mile 10 . . 0 . . 29Jan04 29Jan04
Task 11 Mile 12 . 2 . . . .
Mile 12 Mile 13 FS_1 0 28Jan04 SGE 28Jan04 27Jan04
Mile 13 . . 0 . . 29Jan04 28Jan04
;
284

Chapter 2. The CPM Procedure
Output 2.28.1. Input Data Set
Input Data Set
Obs act succ lag dur target trgttype miledate notrgtmd
1 Task 0 Mile 1 ss_0 1 26JAN04 SGE . .
2 Mile 1 Task 2 0 . 26JAN04 26JAN04
3 Task 2 1 . . .
4 Task 3 Mile 4 1 . . .
5 Mile 4 0 . 26JAN04 26JAN04
6 Task 5 Mile 6 1 . . .
7 Mile 6 Mile 7 FS_1 0 . 26JAN04 26JAN04
8 Mile 7 0 . 27JAN04 27JAN04
9 Task 8 Mile 9 SS_3 1 . . .
10 Mile 9 Mile 10 0 . 29JAN04 29JAN04
11 Mile 10 0 . 29JAN04 29JAN04
12 Task 11 Mile 12 2 . . .
13 Mile 12 Mile 13 FS_1 0 28JAN04 SGE 28JAN04 27JAN04
14 Mile 13 0 . 29JAN04 28JAN04
Output 2.28.2. Default Schedule
Default Schedule
n E L
o E _ L _ T F
t _ F _ F _ _
r S I S I F F
s g T N T N L L
O a u d l t A I A I O O
b c c u a m R S R S A A
s t c r g d T H T H T T
1 Task 0 Mile 1 1 ss_0 . 26JAN04 26JAN04 28JAN04 28JAN04 2 0
2 Mile 1 Task 2 0 26JAN04 26JAN04 26JAN04 28JAN04 28JAN04 2 0
3 Task 2 1 . 26JAN04 26JAN04 28JAN04 28JAN04 2 2
4 Task 3 Mile 4 1 . 26JAN04 26JAN04 28JAN04 28JAN04 2 0
5 Mile 4 0 26JAN04 27JAN04 27JAN04 29JAN04 29JAN04 2 2
6 Task 5 Mile 6 1 . 26JAN04 26JAN04 27JAN04 27JAN04 1 0
7 Mile 6 Mile 7 0 FS_1 26JAN04 27JAN04 27JAN04 28JAN04 28JAN04 1 0
8 Mile 7 0 27JAN04 28JAN04 28JAN04 29JAN04 29JAN04 1 1
9 Task 8 Mile 9 1 SS_3 . 26JAN04 26JAN04 26JAN04 26JAN04 0 0
10 Mile 9 Mile 10 0 29JAN04 29JAN04 29JAN04 29JAN04 29JAN04 0 0
11 Mile 10 0 29JAN04 29JAN04 29JAN04 29JAN04 29JAN04 0 0
12 Task 11 Mile 12 2 . 26JAN04 27JAN04 26JAN04 27JAN04 0 0
13 Mile 12 Mile 13 0 FS_1 27JAN04 28JAN04 28JAN04 28JAN04 28JAN04 0 0
14 Mile 13 0 28JAN04 29JAN04 29JAN04 29JAN04 29JAN04 0 0
First, the CPM procedure is invoked with the default treatment of milestones. The
resulting schedule is printed in Output 2.28.2. Note the dates for the milestones.
Compare these dates with the values of the early nish dates of the immediate prede-
cessors.
The default behavior of the CPM procedure denes the start times for milestones
to be at the beginning of the day after the predecessor task (with a standard FS

0
relationship) ends. Thus, for example, the activity, Mile 4 has E

START=27JAN04
because its predecessor, Task 3, has E

FINISH=26JAN04. The interpretation for


these dates are that the early nish corresponds to the end of the day, while the early
start of the milestone Mile 4 corresponds to the beginning of the day. However, in
some situations you may want the milestone to be scheduled at the same time as the
end of the predecessor activity. In other words, you may wish the early start time of
the milestone Mile 4 to be displayed as 26JAN04, with the interpretation that this
time actually denotes the end of the day, rather than the beginning. See the Finish
Milestones section on page 111 for details about the treatment of milestones. In the
Example 2.28. Use of the SETFINISHMILESTONE Option

285
current example, the variable notrgtmd contains the desired milestone schedule dates
corresponding to this special treatment of milestones. To obtain these desired dates,
you must use the SETFINISHMILESTONE option.
/* Schedule the project */
proc cpm data=tasks out=out0
collapse interval=day
date=26jan04d;
activity act;
successor succ /lag=(lag);
duration dur;
id lag notrgtmd;
run;
title Default Schedule;
proc print; run;
Next, the CPM procedure is invoked with the option SETFINISHMILESTONE and
the resulting schedule is printed in Output 2.28.3. Note that not all milestones are
dened to denote the end of the displayed date; such milestones are referred to as
nish milestone. The variables EFINMILE and LFINMILE indicate if the milestone
is a nish milestone or not, corresponding the the early or late schedule, respectively.
For example, the milestone Mile 12 has E

FINISH = 27JAN04 and the value of


EFINMILE is 1, indicating that the activity nishes at the end of the day on January
27, 2004. The milestone Mile 13 (with a nish-to-start lag of 1 day) nishes at the
end of the day on January 28, 2004. In fact, as the late nish schedule indicates, the
value of L

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

variable are treated as _ENDST_


(the default name of the end stage) unless the associated outcome variable
(

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

SUCCESSOR= as STAGE= Immediate successors Variables with prex



SUCC
TYPE= C/N Stage type

STTYPE

WEB= C HTML page for the stage


PROBIN= EVENT= as OUTCOME= Event names Variables with prex

EVEN
GIVEN= as OUTCOME= Names of given outcomes Variables with prex

GIVE
PROB= N Conditional probabilities Variables with prex

PROB
PAYOFFS= ACTION= as OUTCOME= Action names of nal decision Variables with prex

ACT
STATE= as OUTCOME= Outcome names Variables with prex

STAT
VALUE= N Values of the scenario Variables with prex

VALU
4
C denotes character, N denotes numeric, C/N denotes character or numeric, and as X denotes
the same as variable X.
Variables in STAGEIN= Data Set
The following options specify the variables or variable lists in the STAGEIN= input
data set that identify the stage name, its type, its outcomes, and the reward; and the
immediate successor of each outcome for each stage in the decision model:
OUTCOME=(variables)
identies all variables in the STAGEIN= data set that contain the outcome names
of the stage specied by the STAGE= variable. If the OUTCOME= option is not
specied, PROC DTREE looks for the default variable names that have the prex

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

in the data set. The STAGE= variable must be specied if the


data set does not contain a variable named

STNAME

. The STAGE= variable can


be either character or numeric.
VARIABLES Statement

341
SUCCESSOR=(variables)
SUCC=(variables)
identies all variables in the STAGEIN= data set that contain the names of immediate
successors (another stage) of each outcome specied by the OUTCOME= variables.
These variables must be of the same type and length as those dened in the STAGE=
option. If the SUCCESSOR= option is not specied, PROC DTREE looks for the
default variable names that have the prex

SUCC in the data set. The number of
SUCCESSOR= variables must be equal to the number of OUTCOME= variables.
The values of SUCCESSOR= variables must be stage names (values of STAGE=
variables in the same data set).
TYPE=variable
identies the variable in the STAGEIN= data set that contains the type identier
of the stage specied by the STAGE= variable. If the TYPE= option is omitted,
PROC DTREE looks for the default variable named

STTYPE

in the data set. The


TYPE= variable must be specied if the data set does not contain a variable named

STTYPE

. The STAGE= variable can be either character or numeric.


The following are valid values for the TYPE= variable.
Value Description
DECISION or D or 1 identies the stage as a decision stage
CHANCE or C or 2 identies the stage as an uncertain stage
END or E or 3 identies the stage as an end stage
It is not necessary to specify an end stage in the STAGEIN= data set.
WEB=variable
HTML=variable
species the character variable in the STAGEIN= data set that identies an HTML
page for each stage. The procedure generates an HTML image map using this infor-
mation for all the decision tree nodes corresponding to a stage.
Variables in PROBIN= Data Set
The following options specify the variables or variable lists in the PROBIN= input
data set that identify the given outcome names, the event (outcome) name, and the
conditional probability for each outcome of a chance stage.
EVENT=(variables)
identies all variables in the PROBIN= data set that contain the names of events
(outcomes) that probabilities depend on the outcomes specied by the GIVEN= vari-
ables. If the EVENT= option is not specied, PROC DTREE looks for the default
variable names that have the prex

EVEN in the data set. You must have at least
one EVENT= variable in the PROB= data set. The values of EVENT= variables must
be outcome names that are specied in the STAGEIN= data set.
342

Chapter 3. The DTREE Procedure
GIVEN=(variables)
identies all variables in the PROBIN= data set that contain the given condition (a
list of outcome names) of a chance stage on which the probabilities of the outcome
depend. If the GIVEN= option is not specied, PROC DTREE looks for the default
variable names that have the prex

GIVE in the data set. It is not necessary to have
GIVEN= variables in the data set but if there are any, their values must be outcome
names that are specied in the STAGEIN= data set.
PROB=(variables)
identies all variables in the PROBIN= data set that contain the values of the con-
ditional probability of each event specied by the EVENT= variables, given that the
outcomes specied by the GIVEN= variables have occurred. If the PROB= option is
not specied, PROC DTREE looks for the default variable names that have the prex

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

is used. A value of 0 for this


variable indicates that if the start and nish times of the activity with respect to a
given schedule are identical (a schedule taken to mean early, late, actual, resource-
constrained or baseline), then the activity is represented by a milestone with respect
to the given schedule. A nonzero value treats identical start and nish times in the
default manner by implicitly padding the nish times as specied by the PADDING=
option. The milestone symbol is dened by the MILECHAR= option in line-printer
and full-screen modes and by the CMILE= , FMILE= , HMILE= , and VMILE=
options in graphics mode; these four options represent the color, font, height, and
428

Chapter 4. The GANTT Procedure
value of the symbol, respectively. See the descriptions of these options for their
default values. To illustrate, suppose that the observations for activities A and B from
the Schedule data set are as follows:
ACTIVITY E_START E_FINISH A_START A_FINISH _DUR_
A 27JUL04 27JUL04 31JUL04 31JUL04 1
B 31JUL04 31JUL04 01AUG04 02AUG04 0
In this example, the actual schedule for activity A begins on 31JUL04 and nishes
at the end of the day, as explained in the Schedule Data Set section on page 451.
PROC GANTT uses the

DUR

variable to recognize that activity A has nonzero


duration, pads the nish time by a PADDING= unit, and displays a bar represent-
ing one day. In contrast, the value of 0 for

DUR

in activity A alerts PROC


GANTT that padding be ignored for any schedule with identical start and nish times.
Consequently, the early schedule for activity B is represented on the chart by the mile-
stone symbol at 31JUL04. The actual schedule, however, not having identical start
and nish times, is padded as usual and plotted as starting on 01AUG04 and nish-
ing at the end of 02AUG04.
E

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

FINISH=. This format is also used for labeling any


reference lines and the timenow line.
Full-Screen and Line-Printer Options
The following options can appear in the CHART statement and are specically for
the purpose of producing Gantt charts in line-printer and full-screen modes.
CHART Statement

433
FORMCHAR[ index list ]=string
denes the characters to be used for constructing the chart outlines and dividers. The
value is a string 11 characters long dening the two bar characters, vertical and hor-
izontal, and the nine corner characters: upper left, upper middle, upper right, middle
left, middle middle (cross), middle right, lower left, lower middle, and lower right.
The default value of the FORMCHAR= option is |----|+|---. Any character
or hexadecimal string can be substituted to customize the chart appearance. Use an
index list to specify which default form character each supplied character replaces, or
replace the entire default string by specifying the full 11 character replacement string
with no index list. For example, change the four corners to asterisks by using
formchar(3 5 9 11)= **** .
Specifying the following produces charts with no outlines or dividers.
formchar= (11 blanks)
If you have your output routed to an IBM 6670 printer using an extended font (type-
style 27 or 225) with input character set 216, it is recommended that you specify
formchar=FABFACCCBCEB8FECABCBBBX .
If you are using a printer with a TN (text) print train, it is recommended that you
specify the following:
formchar=4FBFACBFBC4F8F4FABBFBBX .
HCONCHAR=character
species the symbol to be used for drawing the connecting line described in the
HCONNECT option. The default character is - . This is a line-printer option and
is not valid in conjunction with the GRAPHICS option. For corresponding graphics
options, see the LHCON= and CHCON= options described later in this section under
Graphics Options.
HOLICHAR=character
indicates the character to display for holidays. Note that PROC GANTT displays
only those holidays that fall within the duration or the slack time of an activity. The
default character used for representing holidays is ! .
JOINCHAR=string
denes a string eight characters long that identies nonblank characters to be used
for drawing the schedule. The rst two symbols are used to plot the schedule of an
activity with positive total oat. The rst symbol denotes the duration of such an
activity while the second symbol denotes the slack present in the activitys schedule.
The third symbol is used to plot the duration of a critical activity (with zero total
oat). The next two symbols are used to plot the schedule of a supercritical activity
434

Chapter 4. The GANTT Procedure
(one with negative oat). Thus, the fourth symbol is used to plot the negative slack
of such an activity starting from the late start time (to early start time), and the fth
symbol is used to plot the duration of the activity (from early start to early nish). The
sixth symbol is used to plot the actual schedule of an activity if the A

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

FINISH variables are


specied. The eighth symbol is used to plot the baseline schedule of an activity
if the B

START and B

FINISH variables are specied. The default value of the


JOINCHAR= option is -.=-*-*_ .
MILECHAR=character
indicates the character to display for the milestone symbol. If this option is not used,
the letter M is used. In the event that another milestone or a character representing
a start or nish time is to be plotted in this column, the OVERLAPCH= character is
used.
OVERLAPCH=character
OVLPCHAR=character
indicates the overprint character to be displayed when more than one of the sym-
bols in SYMCHAR=string or MILECHAR=character are to be plotted in the same
column. The default character is * .
OVPCHAR=character
indicates the character to be displayed if one of the variables specied in the CHART
statement is to be plotted in the same column as one of the start or nish times. If
no OVPCHAR= option is given, the at symbol (@) is used. Note that if one of the
E

START, E

FINISH, L

START, L

FINISH, A

START, A

FINISH, S

START,
S

FINISH, B

START, or B

FINISH times coincides with another, the overprint


character to be displayed can be specied separately using the OVERLAPCH= op-
tion.
REFCHAR=character
indicates the character to display for reference lines. If no REFCHAR= option is
given, the vertical bar (|) is used. If a time variable value is to be displayed in the
column where a REF= value goes, the plotting symbol for the time variable is dis-
played instead of the REFCHAR= value. Similarly, the HOLICHAR= symbol has
precedence over the REFCHAR= value.
SYMCHAR=string
denes the symbols to be used for plotting the early start, late start, early nish, late
nish, actual start and nish, resource-constrained start and nish, and baseline start
and nish times, in that order. The default value is <<>>**<>[]. If any of
the preceding symbols coincide with one another or with the milestone symbol, the
symbol plotted is the one specied in the OVERLAPCH= option (or *, if none is
specied). If the actual, resource-constrained, and baseline schedules are not plotted
on the chart, you can specify only the rst four symbols. If fewer than the required
number of symbols are specied, nonspecied symbols are obtained from the default
string.
CHART Statement

435
TNCHAR=character
indicates the character to display for the timenow line. If this option is not used, the
letter T is used.
Graphics Options
The following describes the interpretation of the CHART specication in graphics
mode. Note that the GANTT procedure is not supported with the ActiveX or Java
series of devices on the GOPTIONS statement.
As before, the CHART statement controls the format of the Gantt chart and speci-
es additional variables (other than the early, late, actual, resource-constrained, and
baseline start and nish times) to be plotted on the chart. The same forms for the
specication of CHART variables (as in the line-printer and full-screen version) are
allowed, although the interpretation is somewhat different. Each form of specica-
tion is repeated here with a corresponding description of the interpretation. Note that
the symbols for any activity are plotted on a line above the one corresponding to that
activity. In addition to plotting the required symbol, PROC GANTT draws a vertical
line below the symbol in the same color as the symbol. The length of the line is
the same as the height of the bars (referred to as bar height) that represent the dura-
tions of the activities on the Gantt chart. This line helps identify the exact position of
the plotted value. See also the Special Fonts for Project Management and Decision
Analysis section on page 471 for information on a special set of symbols that are
suitable for representing CHART variables on a Gantt chart.
variable1 . . . variablen
indicates that each variable is to be plotted using symbols specied in SYMBOL
statements. The ith variable in the list is plotted using the plot symbol, color, and
font specied in the ith SYMBOL statement. The height specied in the SYMBOL
statement is multiplied by the bar height to obtain the height of the symbol that is
plotted. Thus, if H=0.5 in the rst SYMBOL statement, and the bar height is 5% of
the screen area, then the rst symbol is plotted with a height of 2.5%. For example,
suppose the following two SYMBOL statements are in effect:
SYMBOL1 V=STAR C=RED H=1;
SYMBOL2 V=V C=GREEN H=0.5 F=GREEK;
Then, the following statement
CHART SDATE FDATE;
causes values of SDATE to be plotted with a red star that is as high as each bar and the
values of FDATE with an inverted green triangle that is half as high as the bar height.
See the Using SYMBOL Statements section on page 468 for further information
on using the SYMBOL statement.
variable1=symbol1 . . . variablen=symboln
indicates that each variable is to be plotted using the symbol specied. The symbol
436

Chapter 4. The GANTT Procedure
must be a single character enclosed in quotes. The font used for the symbol is the
same as the font used for the text.
(variables)=symbol1 . . . (variables)=symboln
indicates that each variable in 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 variables in the rst group using an asterisk (*) and the values of
variables in the second group using a plus sign (+).
A single CHART statement can contain requests in more than one of these forms.
Note: It is not necessary to specify a CHART statement if only default values are
used to draw the Gantt chart.
The following options can appear in the CHART statement specically for the pro-
duction of high-resolution graphics quality Gantt charts.
ABARHT=h
species that the height of the actual 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 will override a BARHT= specication. In the event that the actual
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.
ABAROFF=d
species that the actual 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 will override a BAROFF= specication. In the event
that the actual 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.
ACTIVITY=variable
ACT=variable
species the variable identifying the names of the nodes representing activities in
the Schedule data set. This option is required when the precedence information is
specied using the AON format. The variable can be either numeric or character in
type. If the PRECDATA= option is specied, then this variable must also exist in the
Precedence data set and have identical type and length.
CHART Statement

437
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 ANNOTATE= data set specied in a CHART statement is used only for the
Gantt chart created by that particular CHART statement. You can also specify an
ANNOTATE= data set in the PROC GANTT statement, which provides global
Annotate information to be used for all Gantt charts created by the procedure.
AOA
causes PROC GANTT to use the specication for the AOA format for produc-
ing a Logic Gantt chart when the precedence information has been specied in
both AOA format (TAIL= and HEAD= options) and AON format (ACTIVITY=,
SUCCESSOR=, and, optionally, LAG= options). The default behavior is to use the
AON format.
BARHT=h
species that the height of all the schedule bars be h cellheights. The value of h
is restricted to be a positive real number. The default value is one cellheight. This
specication can be overridden for each schedule type by specifying the bar height
option appropriate for that schedule type. If a Logic Gantt chart is produced, the
specied bar height is ignored for the logic bar (specied using the LEVEL= option)
and the default bar height of one cellheight is used for it instead. All non-working
days corresponding to a schedule bar are drawn using the height of the schedule bar
unless the HBARHT= option is specied.
BAROFF=d
species that all the schedule bars be offset d cellheights from their default positions.
A value of zero corresponds to the default positions. The direction of increase is
from top to bottom. This specication can be overridden for each schedule type by
specifying the bar offset option that is appropriate for that schedule type. If a Logic
Gantt chart is produced, the specied bar offset is ignored for the logic bar (specied
using the LEVEL= option) and the default bar offset of zero used instead.
BBARHT=h
species that the height of the baseline 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 baseline
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.
BBAROFF=d
species that the baseline schedule bar be offset d cellheights from its default posi-
tion. A value of zero corresponds to the default position. The direction of increase
is from top to bottom. This specication overrides a BAROFF= specication. In the
438

Chapter 4. The GANTT Procedure
event that the baseline 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.
BOTTOM
BJUST
positions the bottom of the Gantt chart at the bottom of the page, just above the
footnotes. This option is ignored if you specify the TOP or TJUST option.
CAXIS=color
CAXES=color
CA=color
species the color to use for displaying axes for the Gantt chart. If the CAXIS=
option is omitted, PROC GANTT uses the rst color in the COLORS= list in the
GOPTIONS statement.
CFRAME=color
CFR=color
species the color to use for lling the axis area. By default, the axis is not lled.
This option is ignored if the NOFRAME option is specied.
CHARTWIDTH=p
CHARTPCT=p
species the width of the axis area as a percentage of the total Gantt chart width in
the chart that would be produced if you had a page large enough to contain the entire
chart without compression. The Gantt procedure rescales the chart so the axis area
with is p% of the virtual chart width and the text area width is (100-p)% of the virtual
chart width.
This option gives you the capability to generate Gantt charts that are consistent in
their appearance. In the event that the chart ts on a single page, it is possible to get a
smaller chart than had the CHARTWIDTH= option not been specied. You can use
the FILL option in this case if you wish to use the entire page.
CHCON=color
species the color to use for drawing the horizontal connecting lines. If the CHCON=
option is not specied, PROC GANTT uses the rst color in the COLORS= list in
the GOPTIONS statement.
CMILE=color
species the color to use for drawing the milestone symbol on the chart. If the
CMILE= option is not specied, the default color of the milestones follows the rules
for coloring the bars of the relevant schedule. For example, the milestone depicting
a critical activity is drawn with the color of the ll pattern used for critical activi-
ties. For an activity with slack, the early start and late start milestone are drawn with
the color of the ll pattern used for the duration and the slack time of a noncritical
activity, respectively. You can also control the color at the activity level by using a
PATTERN variable.
CHART Statement

439
COMPRESS
species that the Gantt chart be drawn on the number of output pages determined by
the HPAGES= and VPAGES= options. If the HPAGES= option is not specied, the
procedure assumes a default of HPAGES=1. If the VPAGES= option is not specied,
the procedure assumes a default of VPAGES=1. The COMPRESS option does not
attempt to maintain the aspect ratio of the Gantt chart. To maintain the aspect ratio of
the Gantt chart, use the PCOMPRESS option instead.
CPREC=color
species the color to use for drawing the precedence connections. If the CPREC=
option is not specied, PROC GANTT uses the rst color in the COLORS= list in
the GOPTIONS statement.
CREF=color
species the color to use for drawing vertical reference lines on the chart. If the
CREF= option is not specied, PROC GANTT uses the rst color in the COLORS=
list in the GOPTIONS statement.
CTEXT=color
CT=color
species the color to use for displaying text that appears on the chart, including vari-
able names or labels, tickmark values, values of ID variables, and so on. The default
color is the value specied for the CTEXT= option in the GOPTIONS statement. If
CTEXT= is not specied in the GOPTIONS statement, PROC GANTT uses the rst
color in the COLORS= list in the GOPTIONS statement.
CTEXTCOLS=name
CTEXTCOLS=(namelist)
CPATTEXT=name
CPATTEXT=(namelist)
CACTTEXT=name
CACTTEXT=(namelist)
names the columns of activity text to be displayed using the color of the PATTERN
variable when one exists or from the ll pattern from a particular schedule bar.
A missing value for a PATTERN variable results in the default text color being used.
The default text color is the value of the CTEXT= option.
In the absence of a PATTERN variable, the activity text color is the color of the ll
pattern indicating the duration of the schedule identied by the PATLEVEL= option.
If PATLEVEL=EARLY or PATLEVEL=LATE, the color depends on the status of
the activity. Colors for critical duration, supercritical duration, and normal duration
are used depending on whether the activity is critical, supercritical, or noncritical,
respectively. If more than one level is specied, the rst in order of appearance on
the Gantt chart is used, that is, in order EARLY, LATE, ACTUAL, RESOURCE,
BASELINE.
Possible values for the CTEXTCOLS= option are shown in the following table.
440

Chapter 4. The GANTT Procedure
Value Interpretation
ZONE ZONE variable column
JOBNUM Job number column
ID ID variable columns
FLAG Status ag column
ALL All of the above (default)
CTNOW=color
species the color to use for drawing the timenow line on the chart. If the CTNOW=
option is not specied, PROC GANTT uses the rst color in the COLORS= list of
the GOPTIONS statement.
CZONE=color
CZLINE=color
species the color to use for drawing the horizontal zone lines that demarcate the
different zones on the chart. If the CZONE= option is not specied, the GANTT
procedure uses the rst color in the COLORS= list in the GOPTIONS statement.
DESCRIPTION=string
DES=string
species a descriptive string, up to 40 characters in length, 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 GANTT.
EBARHT=h
LBARHT=h
species that the height of the early/late 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 early/late
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.
EBAROFF=d
LBAROFF=d
species that the early/late schedule bar be offset d cellheights from its default posi-
tion. A value of zero corresponds to the default position. The direction of increase
is from top to bottom. This specication overrides a BAROFF= specication. In the
event that the early/late 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.
FONT=font
species the font to use for displaying job numbers, ID variables, legend, labels on
the time axis, and so forth. The default font is the value specied for the FTEXT=
option in the GOPTIONS statement. If FTEXT= is not specied in the GOPTIONS
statement, the hardware character set for your device is used to display the text.
CHART Statement

441
FMILE=font
species the font to use for drawing the milestone symbol on the chart. To select a
symbol from the special symbol table, set FMILE=NONE or leave it unspecied. If
the FMILE= option is specied without a corresponding VMILE= option, the value
of the FMILE= option is ignored, and the default milestone symbol, a lled diamond,
is used instead. A warning is issued to the log in this instance.
See also the Special Fonts for Project Management and Decision Analysis section
on page 471 for information on a special set of symbols that are suitable for repre-
senting milestones on a Gantt chart.
HBARHT=h
species that all non-working days be displayed with a bar which is h cellheights
high. The default behavior is to use the same height as that of the schedule bar.
HBAROFF=d
species that the bars which represent non-working days be offset d cellheights from
their default positions. The default behavior is to use the same offset as that of the
schedule bar.
HEAD=variable
HEADNODE=variable
species the variable (either character or numeric) in the Schedule data set that con-
tains the name of the node that represents the nish of the activity. This option is
required when the precedence information is specied using the AOA format.
HEIGHT=h
species that the height for all text in PROC GANTT, excluding TITLE and
FOOTNOTE statements, be h times the value of HTEXT=, the default text height
specied in the GOPTIONS statement of SAS/GRAPH. The value of h is a positive
real number; the default value is 1.0.
To illustrate, suppose you have the specication HEIGHT=0.6 in the CHART state-
ment and the following GOPTIONS statement:
GOPTIONS htext = 2 in;
Then the height for all text in PROC GANTT is 0.6 x 2 in = 1.2 in.
For each activity, all text corresponding to the JOB, FLAG, and ID variables is dis-
played at a depth of d cells from the top of the rst bar corresponding to the ac-
tivity, where d is the value of the HTOFF= option. The default value of d is 1.0.
Furthermore, the text strings do not overwrite one another and skip, the value of the
SKIP= option, is not increased to accommodate a large text height. Subject to the
preceding restrictions, PROC GANTT calculates the maximum allowable value for
text height as the height occupied by (skip + the number of different schedule bars
drawn per activity) blank lines. Specically, this is the height between like bars cor-
responding to consecutive activities. If the specied text height exceeds this value,
the height is truncated to the maximum allowable value and a warning is issued to
the log. This option enables you to enlarge the text to at least the height occupied
by all of the schedule bars, making it easier to read. This is especially useful when
442

Chapter 4. The GANTT Procedure
the value of the VPOS= option is very large, and several schedule bars are plotted for
each activity. It also provides easier identication of the activity corresponding to a
given schedule bar.
HMILE=height
species the height in cells of the milestone symbol. The height is a positive real
number; the default value is 1.0.
HPAGES=h
species that the Gantt chart is to be produced using h horizontal pages. This, how-
ever, may not be possible due to intrinsic constraints on the output. For example, the
GANTT procedure requires that every horizontal page represent at least one activity.
Thus, the number of horizontal pages can never exceed the number of activities in
the project. Subject to such inherent constraints, the GANTT procedure attempts to
use the specied value for the HPAGES= option; if this fails, it uses h as an upper
bound. The exact number of horizontal pages used by the Gantt chart is given 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 HPAGES= option is also inuenced
by the presence of other related procedure options. The HPAGES= option performs
the task of determining the number of vertical pages in the absence of the VPAGES=
option. If the COMPRESS or PCOMPRESS option is specied in this scenario, the
chart uses one vertical page; if neither option is specied, the number of vertical pages
is computed to display as much of the chart as possible in a proportional manner.
HTOFF=d
species that the line upon which all activity text rests, also referred to as the font
baseline, is positioned at a depth of d cells below the top of the rst bar. The default
value of d is 1.0. The value of the HTOFF= option can be any nonnegative real
number less than the (skip + the number of different schedule bars per activity - 1). A
value of 0 positions text on the line corresponding to the top of the rst bar. Assigning
the maximumvalue corresponds to positioning text directly above the bar reserved for
CHART variables of the next activity on the page. If a value larger than the maximum
is specied, PROCGANTT truncates this value to the maximumand issues a warning
to the log. Furthermore, if the HEIGHT= and HTOFF= values cause activity text to
overwrite the text headings, PROC GANTT reduces the HTOFF= value accordingly
and issues a warning to the log.
LABVAR=variable
species the variable that links observations in the Label data set (label denitions)
to observations in the Schedule data set (activities). This variable must exist in both
the Schedule data set and the Label data set and be identical in type and length. The
variable can be either numeric or character in type. The linking can be a 1-1, 1-many,
many-1, or many-many relationship. The linking can be used to extract positional
information as well as the text string information from the Schedule data set for an
observation in the Label data set when such information cannot be retrieved from the
relevant variables in the Label data set.
If the

Y variable does not exist or its value is missing, the vertical coordinate for
CHART Statement

443
a labels placement position is determined from the activities that are linked to it
and their relative positions on the activity axis of the Gantt chart. A value of -1 for

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

calendar specication used by PROC CPM although


PROC GANTT uses only the keyword information 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 GANTT interprets the lag as a Finish-to-Start type. If
444

Chapter 4. The GANTT Procedure
the PRECDATA= option is specied, the LAG variables are assumed to exist in the
Precedence data set; otherwise, they are assumed to exist in the Schedule data set.
LEFT
LJUST
displays the Gantt chart left-justied with the left edge of the page. This option has
priority over the RIGHT or RJUST option. Note that when displaying a Gantt chart
in graphics mode, the chart is centered in both horizontal and vertical directions in the
space available after accounting for titles, footnotes, and notes. The chart justication
feature enables you to justify the chart in the horizontal and vertical directions with
the page boundaries.
LEVEL=number
species the schedule bar to use for drawing the precedence connections. The default
value of LEVEL= is 1, which corresponds to the topmost bar.
LHCON=linetype
species the line style (1 46) to be used for drawing the horizontal connecting line
produced by the HCONNECT option described earlier in this section. Possible values
for linetype are
1 solid line (the default value when LHCON= is omitted)
2 46 various dashed lines. See Figure 4.5.
For the corresponding line-printer option, see the HCONCHAR= option described
earlier in this section.
LPREC=linetype
species the line style (1 46) to use for drawing the precedence connections. The
default line style is 1, a solid line. See Figure 4.5 for examples of the various line
styles available.
LREF=linetype
species the line style (1 46) to use for drawing the reference lines. The default line
style is 1, a solid line. See Figure 4.5 for examples of the various line styles avail-
able. For the corresponding line-printer option, see the REFCHAR= option described
earlier.
LTNOW=linetype
species the line style (1 46) to use for drawing the timenow line. The default line
style is 1, a solid line. See Figure 4.5 for examples of the various line styles available.
LWIDTH=linewidth
species the line width to be used for drawing lines, other than the timenow line and
precedence connection lines, used in the Gantt chart. The default width is 1.
LZONE=linetype
LZLINE=linetype
species the line style (1 46) to use for drawing the horizontal zone lines which
demarcate the different zones on the chart. The default line style is 1, a solid line.
CHART Statement

445
Figure 4.5. Valid Line Styles
MAXDISLV=columns
species the maximum allowable distance, in number of columns, that a local vertical
can be positioned fromits minimumoffset to avoid overlap with a global vertical. The
value of the MAXDISLV= option must be greater than or equal to 0.1; the default
value is 1. For the denitions of global and local verticals, see the Specifying the
Logic Options section on page 473.
MININTGV=columns
species the minimum inter-distance, in number of columns, of any two global ver-
ticals to prevent overlap. The value of the MININTGV= option must be greater than
or equal to 0.1; the default value is 0.75.
MINOFFGV=columns
species the minimum offset, in number of columns, of a global vertical from the end
of the bar with which it is associated. The value of the MINOFFGV= option must be
greater than or equal to 0.1; the default value is 1.
446

Chapter 4. The GANTT Procedure
MINOFFLV=columns
species the minimum offset, in number of columns, of a local vertical from the end
of the bar with which it is associated. The value of the MINOFFLV= option must be
greater than or equal to 0.1; the default value is 1.
NAME=string
where string species a descriptive string, up to eight characters long, that appears
in the name eld of the master menu of the GREPLAY procedure. If you omit the
NAME= option, the name eld of the master menu contains the name of the proce-
dure.
NJOBS=number
NACTS=number
species the number of jobs that should be displayed on a single page. This option
overrides the VPAGES= option.
NOARROWHEAD
NOARRHD
suppresses the arrowhead when drawing the precedence connections.
NOEXTRANGE
NOXTRNG
suppresses the automatic extension of the chart axis range when drawing a Logic
Gantt chart and neither the MINDATE= nor MAXDATE= option is specied.
NOFRAME
NOFR
suppresses drawing the vertical boundaries to the left and right of the Gantt chart;
only the top axis and a parallel line at the bottom are drawn. If this option is not
specied, the entire chart area is framed.
NOPAGENUM
suppresses numbering the pages of a multipage Gantt chart. This is the default behav-
ior. To number the pages of a multipage Gantt chart on the upper right-hand corner
of each page, use the PAGENUM option.
NOPATBAR
suppresses the use of the PATTERN variable for lling the schedule bars. The default
ll patterns are used instead. Typically, this option is used when you want to color
the activity text using the CTEXTCOLS= option but leave the bars unaffected by the
PATTERN variable.
NOTMTIME
suppresses the display of the time portion of the axis tickmark label when the value
of MININTERVAL is DTDAY. When MININTERVAL=DTDAY, the time axis tick-
marks are labeled with three lines, the rst indicating the month, the second indicating
the day, and the third indicating the time. This option effectively lowers the rst two
lines by a line and drops the third line altogether.
CHART Statement

447
NOZONECOL
suppresses displaying the ZONE variable column that is automatically done in the
presence of a zone variable.
NTICKS=number
NINCRS=number
species the number of tickmarks that should be displayed on the rst horizontal
page of the Gantt chart. The number of tickmarks on the remaining horizontal pages
is determined by the page width and the columns of text that are to be displayed
(ZONE, IDs, ag, and so forth). The page width is determined to be the minimum
width necessary to t the rst page. If the IDPAGES option is specied, the number of
tickmarks is the same as that specied by the NTICKS= option. This option overrides
the HPAGES= option.
ONEZONEVAL
displays the value of the ZONE variable in the ZONE variable column only for activ-
ities that begin a new zone. A blank string is displayed for all other activities.
PAGENUM
numbers the pages of the Gantt chart on the top right-hand corner of the page if the
chart exceeds one page. The numbering scheme is from left to right, top to bottom.
PATLEVEL=name
PATLEVEL=(namelist)
species the different schedule bar levels to ll using the pattern variable. By default,
all of the schedule bar levels for an activity are lled using the pattern dened by the
PATTERN variable. Note that holiday and non-working days are not lled with this
pattern.
Possible values for the PATLEVEL= option and their actions are shown in the fol-
lowing table.
Value Interpretation
EARLY Early/Late schedule durations
LATE Early/Late schedule durations
ACTUAL Actual schedule durations
RESOURCE Resource schedule duration
BASELINE Baseline schedule duration
ALL All of the above (default)
In the absence of a PATTERN variable, this option denes the schedule type that
determines the color for the activity text columns (ZONE variable, ID variable, Job
number, Critical Flag), which are identied with the CTEXTCOLS= option. In this
case, only one schedule type is used, namely the rst one appearing in the order
EARLY, LATE, ACTUAL, RESOURCE, BASELINE.
448

Chapter 4. The GANTT Procedure
PATTERN=variable
PATVAR=variable
species an integer variable in the Schedule data set that identies the pattern for
lling the schedule bars and coloring the milestones. The default PATTERN variable
name is

PATTERN. If the value of the PATTERN variable is missing for a par-
ticular activity, or if there is no PATTERN variable, the different schedule bars and
milestones for the activity are drawn using the corresponding default patterns given
in Table 4.24. The procedure uses the dened or default pattern to ll all the sched-
ule bars and color all the milestones associated with the activity, except for holidays
and non-working days. Use the PATLEVEL= option to restrict the application of the
dened pattern to selected schedule bar levels.
When plotting split activities, you have the additional capability of overriding the
dened pattern at the segment level by specifying a value for the PATTERN variable
for the schedule data set observation representing the segment. Setting it to missing
results in inheriting the PATTERN variable value from the observation for the same
activity with a missing SEGMT

NO. For example, setting PATTERN=SEGMT

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

FINISH variables) of activi-


ties that have been completed or are in progress for projects that are in progress
or completed
the resource-constrained start and nish times of the activities (S

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

FINISH on the second line, the resource-constrained schedule using S

START
and S

FINISH on the third line, and the baseline schedule using B

START and
B

FINISH on the fourth line.


The SEGMT

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

FINISH variables are equal to the start and nish times,


respectively, of the entire activity. Following this observation, there are as many ob-
servations as the number of disjoint segments in the activity. All values for these
segments are the same as the rst observation for this activity except SEGMT

NO,
S

START, S

FINISH, and the duration. SEGMT

NO is the index of the segment,


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

FINISH) denote the last day of work


when the variables are formatted as SAS date values; if they are formatted as SAS
time or datetime values, they denote the last second of work. For instance, if an
activity has E

START=2JUN04 and E

FINISH=4JUN04, then the earliest start


time for the activity is the beginning of June 2, 2004, and the earliest nish time is
the end of June 4, 2004. Thus, PROC GANTT assumes that the early, late, actual,
resource-constrained, or baseline nish time of an activity is at the end of the time
interval specied for the respective variable. The exceptions to this type of default
behavior occur when either the DURATION= option or the PADDING= option is in
Missing Values in Input Data Sets

453
effect. See the Specifying the PADDING= Option section on page 454 for further
details.
All start and nish times, and additional variables specied in the CHART statement
must be numeric and have the same formats. The ID and BY variables can be either
numeric or character. Although the data set does not have to be sorted, the output may
be more meaningful if the data are in order of increasing early start time. Further, if
the data set contains segments of split activities, the data should also be sorted by
SEGMT

NO for each activity.


A family of options, available only in graphics mode, enables you to display the
precedence relationships between activities on the Gantt chart. The precedence re-
lationships are established by specifying a set of variables in the CHART statement;
this can be done in one of two ways. These variables must lie in the Schedule data set
and, optionally, in the Precedence data set dened by the PRECDATA= option in the
PROC GANTT statement. See the Specifying the Logic Options section on page
473 for more details on producing a Logic Gantt chart.
Also available in graphics mode is an automatic text annotation facility that enables
you to annotate labels on the Gantt chart independently of the SAS/GRAPH Annotate
facility. A useful property of this facility is the ability to link label coordinates and
text strings to variables in the Schedule data set. You can create links of two types.
An implicit link automatically links an observation in the Label data set to every
observation in the Schedule data set. An explicit link uses a variable that must exist
on both data sets and be identical in type and length. For more information on the
linking variable in the automatic text annotation facility, see the Automatic Text
Annotation section on page 481.
Missing Values in Input Data Sets
Table 4.19 summarizes the treatment of missing values for variables in the input data
sets used by PROC GANTT.
Table 4.19. Treatment of Missing Values in PROC GANTT
Data Set Variable Action
CALEDATA CALID default calendar (0 or DEFAULT)

SUN

, . . . ,

SAT

corresponding shift for default calendar


D

LENGTH DAYLENGTH, if available; else, 8:00, if


INTERVAL=WORKDAY or DTWRKDAY;
24:00, otherwise
DATA A

FINISH value ignored


A

START value ignored


ACTIVITY input error: logic options are ignored
B

FINISH value ignored


B

START value ignored


CALID default calendar (0 or DEFAULT)
CHART value ignored
DUR nonzero
E

FINISH value ignored


E

START value ignored


454

Chapter 4. The GANTT Procedure
Table 4.19. (continued)
Data Set Variable Action
HEADNODE input error: logic options are ignored
ID missing
L

FINISH value ignored


L

START value ignored


LAG FS
S

FINISH value ignored


S

START value ignored


SEGMT

NO See the Displayed Output section on page 487


SUCCESSOR value ignored
TAILNODE input error: logic options are ignored
ZONE zone value
HOLIDATA CALID holiday applies to all calendars dened
HOLIDAY observation ignored
HOLIDUR ignored, if HOLIFIN is not missing; else, 1.0
HOLIFIN ignored, if HOLIDUR is not missing; else,
HOLIDAY + (1 unit of INTERVAL)
LABDATA

ALABEL 0

CLABEL CTEXT=

FLABEL FONT=

HLABEL 1

JLABEL L

LABEL use

LVAR

LVAR value ignored

PAGEBRK 0

RLABEL 0

X use

XVAR

XOFFSET 0

XVAR value ignored

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

). Each of the three data sets used


to dene calendars is described in greater detail in the Multiple Calendars section
in the PROC CPM chapter.
Each new value for the CALID variable in either the Calendar or the Holiday data
set denes a new calendar. If a calendar value appears in the Calendar data set and
not in the Holiday data set, it is assumed to have the same holidays as the default
calendar (the default calendar is dened in the PROC CPM chapter). If a calendar
value appears in the Holiday data set and not in the Calendar data set, it is assumed
to have the same work pattern structures (for each week and within each day) as the
default calendar. In the Schedule data set, valid values for the CALID variable are
those that are dened in either the Calendar or the Holiday data set.
458

Chapter 4. The GANTT Procedure
All the holiday, workday and workweek information is used by PROC GANTT for
display only; in particular, the weekend and shift information is used only if the
MARKWKND or MARKBREAK option is in effect. The value of the INTERVAL=
option, which has a greater scope in PROC CPM, is used here only to determine
the end of holiday periods appropriately. Further, the Workday, Calendar, and
Holiday data sets and the processing of holidays and different calendars are supported
only when interval is DAY, WEEKDAY, WORKDAY, DTSECOND, DTMINUTE,
DTHOUR, DTDAY, or DTRKDAY.
Specifying the INTERVAL= Option
The INTERVAL= option is needed only if you want holidays or breaks or both during
a week or day to be indicated on the Gantt chart. The value of INTERVAL= is used to
compute the start and end of holiday periods to be compatible with the way they were
computed and used by PROC CPM. Further, if the MARKWKND or MARKBREAK
option is in effect, the INTERVAL= option, in conjunction with the DAYSTART= and
DAYLENGTH= options and the Workday, Calendar, and Holiday data sets, helps
identify the breaks during a standard week or day as well as the holidays that are to
be marked on the chart. Valid values of interval are DAY, WEEKDAY, WORKDAY,
DTSECOND, DTMINUTE, DTHOUR, DTDAY, and DTWRKDAY. If interval is
WEEKDAY, WORKDAY, or DTWRKDAY, the MARKWKND option is in effect;
otherwise, breaks during a week are indicated only if MARKWKND is specied and
breaks within a day are marked only if MARKBREAK is specied.
Full-Screen Version
You can invoke PROC GANTT in full-screen mode by specifying FS (or
FULLSCREEN) in the PROC GANTT statement. The full-screen mode offers you a
convenient way to browse the Gantt chart for the project. For large projects, where
the chart could span several pages, the full-screen mode is especially convenient
because you can scroll around the output using commands on the command line,
pull-down menus, or function keys. You can scroll vertically to a given job on the
task axis by specifying a job number or scroll horizontally to a given point in time
along the time axis by specifying a date. You can optionally display the title and the
legend.
The specications for the full-screen version of PROC GANTT and the output format
are the same as those for the line-printer version. The following is a list of the few
minor differences:
The FILL option is not relevant in this case because all of the activities are
plotted on one logical page.
The NOLEGEND option is not effective. The screen always displays only the
body of the chart along with the ID columns. To see what the symbols mean,
you can use the SHOW LEGEND command, which causes the legend to be
displayed at the bottom of the chart. To delete the legend, use the DELETE
LEGEND command.
The SUMMARY option is not supported in full-screen mode.
Full-Screen Version

459
The SCALE= option works the same way as in the line-printer version, except
for its default behavior. The default value is always 1, unlike in the line-printer
case where, if the time axis ts on less than one page, the default value is
chosen so that the time axis lls as much of the page as possible.
Output Format
The output format is similar to the line-printer version of PROC GANTT. When
PROC GANTT is invoked with the FS option, the screen is lled with a display
of the Gantt chart. The display consists of column headings at the top and ID values
(if an ID statement is used to specify ID variables) at the left. The body of the chart
occupies the bottom right portion of the display. The column headings can be scrolled
left or right, the ID values can be scrolled up or down, and the body of the chart can
scroll along both directions. The display does not include the TITLES or LEGEND.
In addition to using the symbols and join characters as described for the line-printer
version of PROC GANTT, the full-screen version also uses different colors to distin-
guish the types of activities and their associated bars.
You can use the FIND command to locate a particular job (by job number) or a
particular time along the time axis. The format of the FIND command is FIND JOB n
or FIND TIME t . All the commands that are specic to PROC GANTT are described
as follows.
Local Commands
Table 4.23 lists the commands that can be used in the full-screen version of PROC
GANTT.
Table 4.23. Full-Screen Commands and Their Purpose
Scrolling Controlling Display Exiting
BACKWARD SHOW END
FORWARD DELETE CANCEL
LEFT FIND
RIGHT
TOP
BOTTOM
VSCROLL
HSCROLL
BACKWARD
scrolls towards the top of the Gantt chart by the VSCROLL amount. A specication
of BACKWARD MAX scrolls to the top of the chart. You can also specify the vertical
scroll amount for the current command as BACKWARD PAGE | HALF | n. Note that
during vertical scrolling, the column headings are not scrolled.
460

Chapter 4. The GANTT Procedure
BOTTOM
scrolls to the bottom of the Gantt chart.
DELETE LEGEND | TITLE
deletes the legend or the title from the screen. A specication of DELETE LEGEND
deletes the legend from the current display; DELETE TITLE deletes the current title
(titles) from the current display.
END
ends the current invocation of the procedure.
FIND
scrolls to the specied position on the chart. The format of the command is FIND
JOB n or FIND TIME t .
A specication of FIND JOB n scrolls backward or forward, as necessary, in order
to position the activity with job number n on the screen. The specied activity is
positioned at the top of the screen, unless this would result in blank space at the
bottom of the screen. In this instance, the chart is scrolled down to t as many jobs
as space permits.
A specication of FIND TIME t scrolls left or right, as necessary, in order to position
the time t on the time axis to appear on the screen. The specied time is positioned at
the left boundary of the displayed chart area unless this would result in blank space at
the right of the screen. In this instance, the chart is scrolled to the right to t as much
of the time axis as space permits.
FORWARD
scrolls towards the bottom of the Gantt chart by the VSCROLL amount. A speci-
cation of FORWARD MAX scrolls to the bottom of the chart. You can also specify
the vertical scroll amount for the current command as FORWARD PAGE | HALF | n.
Note that during vertical scrolling, the column headings are not scrolled.
HELP
displays a HELP screen listing all the full-screen commands specic to PROC
GANTT.
HOME
moves the cursor to the command line.
HSCROLL
sets the amount of information that 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 columns. A specication of HSCROLL PAGE sets
the scroll amount to be the number of columns in the part of the screen displaying
the plot of the schedules. A specication of HSCROLL HALF is half that amount;
HSCROLL n sets the horizontal scroll amount to n columns. The default setting is
PAGE.
Full-Screen Version

461
KEYS
displays current function key settings.
LEFT
scrolls towards the left boundary of the Gantt chart by the HSCROLL amount. A
specication of LEFT MAX scrolls to the left boundary. You can also specify the
horizontal scroll amount for the current command as LEFT PAGE | HALF | n. Note
that during horizontal scrolling, the ID columns are not scrolled.
RIGHT
scrolls towards the right boundary of the Gantt chart by the HSCROLL amount. A
specication of RIGHT MAX scrolls to the right boundary. You can also specify the
horizontal scroll amount for the current command as RIGHT PAGE | HALF | n. Note
that during horizontal scrolling, the ID columns are not scrolled.
SHOW LEGEND | TITLE
displays the legend or the title on the screen. A specication of SHOW LEGEND dis-
plays the legend in the bottom portion of the current display; SHOW TITLE displays
the current title (titles) in the top portion of the current display.
TOP
scrolls to the top of the Gantt chart.
VSCROLL
sets the amount of information that scrolls vertically when you execute the
BACKWARD or FORWARD command. The format is VSCROLL PAGE | HALF
| n. The specication is assumed to be in number of rows. A specication of
VSCROLL PAGE sets the scroll amount to be the number of rows in the part of the
screen displaying the plot of the schedules. A specication of VSCROLL HALF is
half that amount; VSCROLL n sets the vertical scroll amount to n rows. The default
setting is PAGE.
Global Commands
Most of the global commands used in SAS/FSP software are also valid with PROC
GANTT. Some of the commands used for printing screens are described below.
SAS/FSP software provides you with a set of printing commands that enable you to
take pictures of windows and to route those pictures to a printer or a le. Whether you
choose to route these items directly to a printer queue or to a print le, SAS/FSP soft-
ware provides you with a means of specifying printing instructions. The following is
an overview of these related commands and their functions:
FREE
releases all items in the print queue to the printer. This includes pictures taken with
the SPRINTcommand as well as items sent to the print queue with the SEND com-
mand. All items in the print queue are also automatically sent to the printer when you
exit the procedure, send an item that uses a different form, or send an item to a print
le. Items are also sent automatically when internal buffers have been lled.
Items sent to a le: If you have routed pictures taken with the SPRINT command
to a le rather than to a printer, the le is closed when you execute a FREE
462

Chapter 4. The GANTT Procedure
command. It is also closed when you send an item that uses a different form,
send items to a different print le or to the print queue, or exit the procedure.
Note: Any items sent to the same print le after it has been closed will replace
the current contents.
PRTFILE lename
PRTFILE leref
PRTFILE CLEAR
species a le to which the procedure sends pictures taken with the SPRINT com-
mand instead of sending them to the default printer. You can specify an actual le-
name or a previously assigned leref.
Using a lename: To specify a le named destination-le, execute
prtfile destination-le
where destination-le follows your systems conventions. Note that quotes are
required when you specify a lename rather than a leref.
Using a leref: You can also specify a previously assigned leref.
Using the default: Specify PRTFILE CLEAR to prompt the procedure to route in-
formation once again to the queue for the default printer.
Identify the current print le: Specify PRTFILE to prompt the procedure to iden-
tify the current print le.
SPRINT [NOBORDER][NOCMD]
takes a picture of the current window exactly as you see it, including window con-
tents, border, and command line. By default, the picture is sent to the queue for the
default printer.
Border and command line: By default, both the window border and command line
are included in the picture you take with the SPRINT command. You can cap-
ture a picture of the window contents that excludes either the window border,
the command line, or both. Specify the NOBORDER option to exclude the
border and the NOCMD option to exclude the command line. Taking a picture
of the window contents without the border and command line is a convenient
way to print text for a report.
Destination: The destination of the picture captured with the SPRINT command is
determined by the PRTFILE command. By default, the picture goes to the
default printer. Use the PRTFILE command if you want it sent to a le instead.
Each time you execute the SPRINT command, the picture you take is appended
to the current print le; it does not write over the current le. See the PRTFILE
command for further explanation.
Graphics Version

463
Graphics Version
Formatting the Chart
If necessary, PROC GANTT divides the Gantt chart into several pages. You can
force the Gantt chart to t on one page by specifying the COMPRESS option in
the CHART statement. You can achieve a similar result using the PCOMPRESS
option, which maintains the aspect ratio as well. In addition, you can t the chart
into a prescribed number of horizontal and vertical pages by using the HPAGES=
and VPAGES= options in the CHART statement.
The amount of information contained on each page is determined by the values of
the graphics options HPOS= and VPOS= specied in a GOPTIONS statement. If
any compression of the Gantt chart is performed, the values of HPOS and VPOS
are increased, as necessary, to the number of rows and columns respectively, that the
entire chart occupies in uncompressed mode. The default height of each row of the
Gantt chart is computed as (100/v)% of the screen height where VPOS=v. Thus,
the larger the value of VPOS, the narrower the row. You can control the default bar
height and default bar offset by using the BARHT= option and the BAROFF= option,
respectively. You can further override these at the schedule level. For example, the
ABARHT= option affects only the height of the actual schedule bars. The screen is
assumed to be divided into h columns where HPOS=h; thus, each column is assumed
to be as wide as (100/h)% of the screen width. Hence, the specications SCALE=10
and MININTERVAL=WEEK imply that a duration of one week is denoted by a bar
of length (1000/h)% of the screen width.
The height of the text characters is controlled by both the HEIGHT= option in the
CHART statement and the HTEXT= option specied in a GOPTIONS statement.
The text height is set equal to the product of the HEIGHT= and HTEXT= values.
The units in which the text height is measured are those of the HTEXT= option.
By default, the value of HEIGHT= is 1, which sets the text height to be equal to
the HTEXT= value. The default value of HTEXT= is 1 unit, where a unit is de-
ned by the GUNIT= option in a GOPTIONS statement. Thus, in the absence of the
HEIGHT=, HTEXT=, and GUNIT= options, the text height is the same as the bar
height, namely one cell height. Increasing the value of HEIGHT= is useful when you
use the COMPRESS option, particularly when you have a very large chart. Since
the chart is scaled as appropriate to t on one page, the text can be very hard to dis-
cern, or even illegible, and would benet from enlargement. Relative positioning of
the font baseline for activity text is controlled by the HTOFF= option in the CHART
statement. By default, the font baseline for an activity is at the bottom of the rst bar
corresponding to the activity.
The color of the text characters is specied using the CTEXT= option in the CHART
statement. If CTEXT= is not specied, PROCGANTT uses the value of the CTEXT=
option specied in a GOPTIONS statement that has a default value of the rst color
in the current COLORS= list in the GOPTIONS statement. You can override the text
colors for selected columns of activity text at the activity level by using a PATTERN
variable in the Schedule data set and specifying the CTEXTCOLS= option in the
CHART statement.
464

Chapter 4. The GANTT Procedure
The font used for the text characters is specied with the FONT= option in the
CHART statement. If FONT= is not specied, PROC GANTT uses the value of
the FTEXT= option specied in a GOPTIONS statement that has a default value of
the hardware font for your output device. If the hardware font cannot be used, the
SIMULATE font is used instead. The default value of the SIMULATE font is the
SIMPLEX font.
Global PATTERN statements are used to specify the ll pattern for the different types
of bars drawn on the Gantt chart. Each ll pattern can be associated with a color.
Patterns can be be used to reect the status of an activity (normal, critical, supercrit-
ical) in the predicted early/late schedule, to indicate the different schedule types (ac-
tual, resource-constrained, baseline), and to represent weekends, holidays and breaks
on the Gantt chart. See the Using PATTERN Statements section on page 465 for
details. In addition, you can override these ll patterns for selected schedules at an
activity level by using a PATTERN variable in the Schedule data set and specifying
the PATLEVEL= option in the CHART statement.
You can use global SYMBOL statements to dene the symbols that represent CHART
variables in the Gantt chart. The SYMBOL statement enables you to select symbols
from different fonts and modify their appearance to suit your requirements. You can
specify a color and a height for the symbol in addition to a variety of other options.
See the Using SYMBOL Statements section on page 468 for details.
Annotate Processing
The Annotate facility enables you to enhance graphics output produced by PROC
GANTT. However, if the only items being annotated are symbols and text strings,
it is recommended that you use the Automatic Text Annotation facility that is built
into the Gantt procedure instead. This facility was developed specically for labeling
Gantt charts; it has some very useful features and requires a minimum of effort.
To use the SAS/GRAPH Annotate facility, you must create an Annotate data set that
contains a set of graphics commands that can be superimposed on the Gantt chart.
This data set has a specic format and must contain key variables. Each observation
in the Annotate data set represents a command to draw a graphics element or perform
an action. The values of the variables in the observation determine what is done and
how it is done. The observations in an Annotate data set can be created by explicitly
assigning values to the Annotate variables through a DATA step or SAS/FSP pro-
cedure or by implicitly assigning values with Annotate macros within a SAS DATA
step. The process of creating Annotate observations is greatly simplied through the
use of Annotate macros.
Coordinates specify where graphic elements are to be positioned. A coordinate sys-
tem, in turn, determines how coordinates are interpreted. There are several different
coordinate systems that are used by the Annotate facility. Typically, one of three ma-
jor drawing areas can be associated with any coordinate system: data area, procedure
output area, and graphics output area. This chapter explains the coordinate system
that is based on the data area of PROC GANTT.
When annotating a graph produced by any of the graphics procedures, you may nd
it helpful to use data coordinates that refer to the data values corresponding to the
Graphics Version

465
graph that is being annotated. For example, if you want to label a particular activity
of a Gantt chart with additional text, you can position the text accurately if you use
data coordinates instead of screen coordinates. With respect to PROC GANTT, the
Annotate facility uses the time axis and the activity axis of the Gantt chart as the basis
for the data coordinate system. To use this feature, create a Annotate data set based
on the Schedule data set that is input to the procedure, utilizing Annotate macros
whenever possible to simplify the process.
Note: The data coordinate system enables you to annotate the graph even if it spans
multiple pages. However, each annotation must be entirely contained within a given
page. For example, you cannot annotate a line on the Gantt chart that runs from one
page of the chart to another.
In addition to a coordinate system based on the data, you can select a coordinate
system based on either the procedure output area or the Graphics output area. You
would typically need to use one of these systems, for example, if you want to annotate
text outside the chart area.
Using PATTERN Statements
PROC GANTT uses those patterns that are available with the GCHART procedure.
PROC GANTT uses a maximum of nine different patterns to denote various phases in
an activitys duration and the various types of schedules that are plotted. Patterns are
specied in PATTERN statements that can be used anywhere in your SAS program.
Table 4.24 lists the function of each of the rst nine PATTERN statements that are
used by PROC GANTT.
Any PATTERN statements that you specify are used. If more are needed, default
PATTERN statements are used.
You can override any of these patterns at the activity level by using a PATTERN
variable in the schedule data set. A PATTERN variable is identied by specifying
the PATTERN= option in the CHART statement or by the presence of the default

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 greater than E

FINISH) while the second observation is incomplete


(missing 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

YOFFSET are used).


Automatic Text Annotation

483
Determining the Horizontal Position
The procedure attempts to determine the horizontal position using the

X variable.
You specify the coordinate system for the value of

X with the optional

XSYS
variable. A value of DATA or DATAVAL for the

XSYS variable indicates that the
unit of measurement is data values. This is also the default coordinate system for

X.
A value of PCT or PCTVAL indicates that the unit of measurement is percentage of
the procedure output area.
If the

X variable does not exist or its value is missing, the procedure ignores the
Label data set 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 variable
or a value of -1 for

Y, as described previously), the procedure extracts the horizontal
position using the

XVAR variable in the Label data set. The

XVAR variable values
are names of numeric variables in the Schedule data set. If the

XVAR value is not
missing, the horizontal position 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 its value is missing, no label is displayed for this particular (activity, label) link.
As with the

X variable, the

XSYS variable names the unit of measurement for the
associated Schedule data set variable.
Coordinate Systems
Coordinates can be specied in data values and percentages. It is important to note
a signicant difference between these two systems when using multiple pages. A
data coordinate value is a point along either the time or activity axis, and it can be
related to a page number and to a position on that page in the relevant direction. A
percentage value, on the other hand, cannot be related to a particular page and, as
such, is treated as applicable to every single page. It is possible to mix data and
percentage coordinates. That is, the horizontal position can be in data values and the
vertical position can be in percentage values, and vice versa. By mixing coordinate
systems, you can get as exible as you want in labeling Gantt charts.
If both coordinates are in data values, the label is displayed at a specic coor-
dinate on a specic page.
If the horizontal coordinate is a percentage, the label is displayed at this
horizontal position for every page that corresponds to the vertical position.
Likewise, if the vertical position is a percentage, the label is displayed at this
vertical position for every page that corresponds to the horizontal position. For
example, you can display certain headings at the top of the Gantt chart or at the
bottom of the Gantt chart by using a data value for the vertical position and a
percentage value for the horizontal position.
If the horizontal and vertical coordinates are both percentages, the label is dis-
played on every page at the specied coordinate. This feature can be used
to display text that appears on every page, much like titles and footnotes, for
example.
484

Chapter 4. The GANTT Procedure
Determining the Label String
The technique for determining the label string is similar to that of determining the
horizontal position.
As far as possible, the procedure attempts to use the

LABEL variable. If the

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 variables, respectively. The values for the



CLABEL variable are any
valid SAS/GRAPH color names. If the

CLABEL variable does not exist or its value
is missing, the value of the CTEXT= option in the CHART statement is used. The
values for the

FLABEL variable are any valid SAS/GRAPH font names. If the

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

LABEL C/N label string

XVAR C name of numeric SAS var in DATA= ds


for x position

LVAR C name of SAS var in DATA= ds for label


string

XSYS C coordinate system for



X,

XVAR DATA, DATAVAL, PCT,
PCTVAL
DATA

YSYS C coordinate system for



Y DATA, DATAVAL, PCT,
PCTVAL
DATA

PAGEBRK N resolve pagebreak referenced display 0, 1, 2 0

XOFFSET N horizontal offset in minintervals 0

YOFFSET N vertical offset in bar heights 0

ALABEL N baseline angle in degrees 0

CLABEL C SAS/GRAPH color name CTEXT=

FLABEL C SAS/GRAPH font name FONT=

HLABEL N height in barheights 1

JLABEL C justify text L, LEFT, R, RIGHT, C,


CENTER
L

RLABEL N character rotation in degrees 0


LABVAR= C/N variable linking activities to labels
Web-Enabled Gantt Charts
The WEB variable enables you to dene an HTML reference for each activity. This
HTML reference is currently associated with all the schedule bars, milestones, and
ID variables that correspond to the activity. 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
GANTT statement. By processing this SAS data set using a DATA step, you can
generate customized HTML pages for your Gantt chart.
Mode-Specic Differences
All the options that are valid for line-printer, full-screen, and graphics mode Gantt
charts are explained in detail in the Syntax section on page 416. With few excep-
tions, the options listed in the section General Options on page 424 have the same
interpretation in all three modes.
Table 4.27 lists those line-printer options that have a different interpretation for the
graphics version of PROC GANTT. Table 4.28 lists options specic for graphics
charts and the equivalent line-printer/full-screen option. Table 4.29 lists options spe-
cic for line-printer and full-screen charts and the equivalent graphics option.
Displayed Output

487
Table 4.27. Line-Printer Options and Corresponding Graphics Interpretation
Line-Printer Option Graphics Mode Interpretation
SCALE=scale one column is denoted by (1/h)% of the screen width,
where HPOS=h.
SKIP=skip skip number of bar heights are skipped between the bars
for two consecutive activities. The value 0 is not valid in
the graphics case.
Table 4.28. Graphics Mode Options and Line-Printer/Full-Screen Equivalent
Graphics Option/Statement Line-Printer/Full-Screen Equivalent
LHCON=linetype HCONCHAR=character
LREF=linetype REFCHAR=character
LTNOW=linetype TNCHAR=character
NOFRAME FORMCHAR=string
PATTERN statement JOINCHAR=string and SYMCHAR=string
SYMBOL statement rst character of variable name is plotted (See CHART
specications)
VMILE=value MILECHAR=character
WTNOW=width TNCHAR=character
Table 4.29. Line-Printer/Full-Screen Mode Specic Options
Line-Printer/Full-Screen Option Graphics Equivalent
FORMCHAR=string NOFRAME
HCONCHAR=character LHCON=linetype, CHCON=color
HOLICHAR=character PATTERN statement 7
JOINCHAR=string PATTERN statements 1-6, 8, and 9
MILECHAR=character VMILE=value, FMILE=font, HMILE=height,
CMILE=color
REFCHAR=character LREF=linetype, CREF=color
SYMCHAR=string PATTERN statements 1-6, 8, and 9
TNCHAR=character LTNOW=linetype, WTNOW=width, CTNOW=color
Displayed Output
The GANTT procedure produces one or more pages of displayed values and a plot
of the schedule. If the SUMMARY option is specied, the chart is preceded by a
detailed description of the symbols used. A legend is displayed at the foot of the
chart on each page unless suppressed by the NOLEGEND option. The main body of
the output consists of columns of the ID values and the Gantt chart of the schedule.
For each activity in the project, PROC GANTT displays the values of the ID vari-
ables in the ID columns and plots any combination of the following schedules: the
predicted schedule as specied by the early and late start and nish times, the actual
schedule as specied by the actual start and nish times, the resource-constrained
schedule as specied by the resource-constrained start and nish times, and the base-
line schedule as specied by the baseline start and nish times. The procedure
looks for default variable names for each of these times (E

START for early start,


E

FINISH for early nish, S

START for resource-constrained start times, and so


488

Chapter 4. The GANTT Procedure
on), or you can explicitly specify the names of the appropriate variables using the
ES=, EF=, LS=, . . . options.
By specifying the COMBINE option in the CHART statement, you can request PROC
GANTT to represent early, late, and actual schedule information on a single bar rather
than use two separate bars (one for the early and late schedules and the other for
the actual schedule.) PROC GANTT automatically draws a timenow line when the
COMBINE option is specied with the property that all times to the left of the line
represent the actual schedule times (that is, times that have already taken place) and
all times to the right of the line represent the predicted early/late schedule times (times
that have not yet taken place.)
Normally, each observation in the Schedule data set is assumed to denote a new ac-
tivity, and a new set of ID values are displayed and the schedules corresponding to
this activity are plotted on the chart. There are two exceptions to this rule:
If the ID values for two or more consecutive observations are identical, only
the rst such observation is used.
If there is a variable named SEGMT

NO in the Schedule data set, PROC


GANTT assumes that the data set contains observations for segments of activi-
ties that were split during resource-constrained scheduling. In accordance with
the conventions used by PROC CPM, only observations with a missing value
for SEGMT

NO are assumed to denote a new activity. Further, the data are as-
sumed to be sorted by SEGMT

NO for each activity. For each activity, PROC


GANTT plots the schedules corresponding to the ES, EF, LS, LF, AS, and AF
variables on the basis of the rst observation for this activity, namely the ob-
servation with a missing value for the SEGMT

NO variable. This observation


is also the one used for displaying values for the ID variables for this activity.
If the activity is not split, this same observation is also the one used to plot the
resource-constrained schedule as well as the baseline schedule. However, if the
activity is split, then all the observations for this activity with integer values for
the variable SEGMT

NO are used to plot the resource-constrained schedule as


disjoint segments on the line used for plotting the S

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

START is 2JUN04, MININTERVAL=DAY, and SCALE=5, then the early start


time is plotted in column 20.
Displayed Output

489
Each activity is identied by a job number (unless the NOJOBNUM option is used),
which appears as the rst column of activity text. The next column of activity text
identies the values of the ZONE= variable, if specied. This column can be sup-
pressed by specifying the NOZONECOL option in the CHART statement. Next to
appear are the ID variables in the order in which they are specied in the CHART
statement. If the time axis of the chart is very wide, causing it to be divided across
more than one page, the ID variables, by default, do not appear on continuation pages.
You need to specify the IDPAGES option to produce the ID variable columns on ev-
ery page. By default, if the ID variables occupy too much space, leaving no room
for the chart to be started on the rst page, they are omitted and a warning message
is printed to the log. You can override this behavior by using the MAXIDS option.
Column headings for the ZONE and ID variables consist of either variable labels (if
they are present and if space permits) or variable names. To suppress variable labels
in column headings, use the NOLABEL system option. If a ZONE or ID variable is
formatted, the value is displayed using that format. If the CRITFLAG option is spec-
ied, a ag is displayed to the right of the ID values that indicates how critical the
activity is. This ag is also repeated on continuation pages if the time axis occupies
more than one page. The body of the chart starts to the right of this ag.
By default, the GANTT procedure is invoked in graphics mode. In graphics mode,
you can t the Gantt chart entirely on one page by specifying the COMPRESS option
in the CHART statement. The HPAGES= and VPAGES= options take this one step
further by enabling you to control the number of pages that you want the Gantt chart
to be compressed into. The PCOMPRESS option behaves much like the COMPRESS
option except that all compression is performed in a proportional manner, that is, by
maintaining the aspect ratio of the Gantt chart.
PROC GANTT can display the precedence relationships (including nonstandard
types) between activities on the Gantt chart by means of directed links between ac-
tivities. Each link is drawn so as to convey the type of precedence relationship it
represents. See the Specifying the Logic Options section on page 473 for a de-
tailed description on how this can be done.
In addition, graphics mode provides you with the easy-to-use automatic text anno-
tation facility to generate labels on the Gantt chart. You can link labels and their
coordinates to variables in the schedule data set and also have complete control over
all attributes such as font, color, angle, rotation, and so forth. You also have the addi-
tional capability of annotating text and graphics independently on the Gantt chart by
using the SAS/GRAPH Annotate facility.
The GANTT procedure offers you a wide variety of options in addition to text, bar,
symbol, and line formatting controls to customize your Gantt chart. These features
enable you to create a wide variety of charts such as Logic Gantt charts, zoned Gantt
charts, multiproject Gantt charts, Web-enabled Gantt charts, and multiprocess Gantt
charts, to name but a few.
490

Chapter 4. The GANTT Procedure
Macro Variable

ORGANTT
The GANTT procedure denes a macro variable named

ORGANTT, which is set
at procedure termination. This variable contains a character string that indicates the
status of the procedure and also provides chart specic information with respect to
each Gantt chart produced by invocation of the GANTT procedure. This includes
charts resulting from multiple CHART statements and BY groups.
The format of the

ORGANTT string for a GANTT procedure invocation with n
CHART statements is as follows:
STATUS= REASON= CHART1 chart1info # . . . CHARTn chartninfo #
where the value of STATUS= is either SUCCESSFUL or ERROR

EXIT, and the


value of REASON= is one of the following:
BADDATA

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

NO variable and the


PATTERN variable to produce a versatile multisegment Gantt chart. In Example
4.25 the ZONE= option is used to produce a zoned Gantt chart. Example 4.26 shows
you how to produce a Web-enabled Gantt chart that you can use to drill-down your
project. Finally, Example 4.27 uses the CHARTWIDTH= option to product Gantt
charts that are consistent in appearance.
In all the examples presented, the early and late schedules are specied in the data set
by means of the variables E

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

START is shown in Output 4.6.1.


Because MININTERVAL=WEEK and SCALE=10, PROC GANTT uses (1000/h)%
of the screen width to denote one week, where h is the value of HPOS. Note that
this choice also causes the chart to become too wide to t on one page. Thus, PROC
GANTT splits the chart into two pages. The rst page contains the ID variable as well
as the job number while the second page contains only the job number. The chart is
split so that the displayed area on each page is approximately equal. The SWISS
font is used for all Gantt chart text by specifying the FONT= option in the CHART
statement. The milestone color is changed to green using the CMILE= option. The
resulting Gantt chart is shown in Output 4.6.2.
Output 4.6.1. Schedule Data Set SAVE
Gantt Example 6
Using the MININTERVAL= and SCALE= Options
descrpt dept E_START E_FINISH L_START L_FINISH T_FLOAT F_FLOAT
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
options ps=60 ls=100;
title f=swiss Gantt Example 6;
title2 f=swiss Using the MININTERVAL= and SCALE= Options;
Example 4.6. Using the MININTERVAL= and SCALE= Options

509
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
;
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;
510

Chapter 4. The GANTT Procedure
* schedule the project;
proc cpm data=widgeta date=1dec03d out=save;
tailnode tail;
headnode head;
duration days;
id task dept descrpt;
run;
* sort the schedule by the early start date ;
proc sort;
by e_start;
run;
goptions vpos=42 hpos=80;
* plot the schedule;
proc gantt;
chart / mininterval=week scale=10
dur=days cmile=green
ref=1dec03d to 1feb04d by month
font=swiss
nolegend;
id descrpt;
run;
Output 4.6.2. Using the MININTERVAL= and SCALE= Options in Graphics Mode
Example 4.7. Using the MINDATE= and MAXDATE= Options

511
Example 4.7. Using the MINDATE= and MAXDATE= Options
In this example, the SAVE data set from Example 4.6 is used to display the schedule
of the project over a limited time period. The start date and end date are specied by
the MINDATE= and MAXDATE= options, respectively, in the CHART statement.
As in Example 4.5, the COMPRESS option is used to ensure that the region of the
Gantt chart lying between January 1, 2004, and February 2, 2004, ts on a single
page. The specication REF=5JAN04D TO 2FEB04D BY WEEK causes PROC
GANTT to draw reference lines at the start of every week. Further, the reference
lines are labeled using the REFLABEL option. The CREF= and LREF= options are
specied in the CHART statement to indicate the color and line style, respectively, of
the reference lines. The CFRAME= option is used to specify the color of the frame
ll. The resulting Gantt chart is shown in Output 4.7.1.
title f=swiss Gantt Example 7;
title2 f=swiss Using the MINDATE= and MAXDATE= Options;
goptions vpos=40 hpos=100;
* plot the schedule;
proc gantt data=save;
chart / mindate=1jan04d maxdate=2feb04d
ref=5jan04d to 2feb04d by week
reflabel cref=black lref=2
cframe=cyan
512

Chapter 4. The GANTT Procedure
dur=days font=swiss nojobnum
compress;
id task;
run;
Output 4.7.1. Using the MINDATE= and MAXDATE= Options in Graphics Mode
Example 4.8. Variable Length Holidays
This example shows how you can mark vacation periods that last longer than one
day on the Gantt chart. This can be done by using the HOLIDUR= option in the
CHART statement. Recall that holiday duration is assumed to be in interval units
where interval is the value specied for the INTERVAL= option. The project data for
this example are the same as the data used in the previous example. Suppose that in
your scheduling plans you want to assign work on all days of the week, allowing for
a Christmas vacation of four days starting from December 24, 2003, and a day off
on January 1, 2004 for the New Year. The data set HOLIDAYS contains the holiday
information for the project. First, the project is scheduled with INTERVAL=DAY so
that the holidays are on December 24, 25, 26, and 27, 2003, and on January 1, 2004.
PROC GANTT is invoked with INTERVAL=DAY to correspond to the invocation of
PROC CPM. The resulting Gantt chart is shown in Output 4.8.1.
Example 4.8. Variable Length Holidays

513
title f=swiss Gantt Example 8;
data holidays;
format holiday holifin date7.;
input holiday & date7. holifin & date7. holidur;
datalines;
24dec03 27dec03 4
01jan04 . .
;
* schedule the project subject to holidays;
proc cpm data=widgeta holidata=holidays out=sched1
date=1dec03d interval=day;
tailnode tail;
headnode head;
duration days;
id task dept descrpt;
holiday holiday / holidur=(holidur);
run;
* sort the schedule by the early start date ;
proc sort;
by e_start;
run;
* plot the schedule;
title2 Variable Length Holidays: INTERVAL=DAY;
proc gantt holidata=holidays data=sched1;
chart / holiday=(holiday) holidur=(holidur)
interval=day
dur=days
pcompress;
id task;
run;
514

Chapter 4. The GANTT Procedure
Output 4.8.1. Variable Length Holidays: INTERVAL=DAY
Next, consider the same project and Holiday data set, but invoke PROC CPM with
INTERVAL=WEEKDAY. Then, the value 4 specied for the variable HOLIDUR is
interpreted as 4 weekdays. The holidays are on December 24, 25, 26, and 29, 2003,
and on January 1, 2004, because December 27 and 28 (Saturday and Sunday) are
non-working days. The same steps are used as previously, except that INTERVAL is
set to WEEKDAY instead of DAY in both PROC CPM and PROC GANTT. Suppose
that the resulting data set is saved as SCHED2. The following invocation of PROC
GANTT produces Output 4.8.2. Note that the use of INTERVAL=WEEKDAY causes
weekends to be also marked on the chart.
title2 Variable Length Holidays: INTERVAL=WEEKDAY;
proc gantt holidata=holidays data=sched2;
chart / holiday=(holiday) holidur=(holidur)
interval=weekday
dur=days
pcompress;
id task;
run;
Example 4.8. Variable Length Holidays

515
Output 4.8.2. Variable Length Holidays: INTERVAL=WEEKDAY
Finally, when the INTERVAL= option is specied as WORKDAY, the work-
day is assumed to be from 9:00 a.m. to 5:00 p.m., and the Christmas holiday
period begins at 5:00 p.m. on December 23, 2003, and ends at 9:00 a.m. on
December 30, 2004. PROC GANTT is invoked with the MARKBREAK option and
MININTERVAL=DTHOUR so that all breaks during a day can be seen. Because
the SCALE= option is not specied, each column denotes one hour of the schedule.
Since the project duration is several days long, the entire Gantt chart would be spread
across many pages. Simply specifying the COMPRESS or PCOMPRESS option will
not be of much help since the text would be barely legible owing to the extent of the
scaling. Hence, only a portion of the Gantt chart is shown in Output 4.8.3 using the
MINDATE= and MAXDATE= options. Note that the Gantt chart is labeled with the
date as well as the time values on the time axis.
title2 Variable Length Holidays: INTERVAL=WORKDAY;
proc gantt holidata=holidays data=sched3;
chart / holiday=(holiday) holidur=(holidur)
interval=workday
dur=days
mininterval=dthour markbreak
mindate=29dec03:09:00:00dt
maxdate=03jan04:00:00:00dt
pcompress;
id task;
run;
516

Chapter 4. The GANTT Procedure
Output 4.8.3. Variable Length Holidays: INTERVAL=WORKDAY
Example 4.9. Multiple Calendars
This example illustrates the use of multiple calendars within a project. The data for
this example are the same as the data used in Example 2.10 to illustrate the CPM
Procedure. The input data sets to PROC CPM are displayed in Output 4.9.1. The
WORKDATA data set denes several shift patterns, which in turn are identied with
four different calendars in the CALEDATA data set:
The DEFAULT calendar has ve 8-hour workdays (8 a.m. - 4 p.m.) on
Monday through Friday and holidays on Saturday and Sunday.
The OVT

CAL calendar denes the overtime calendar that is followed by


the Engineering department to build the prototype. The OVT

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 calendar denes the production calendar that is used for


full-scale production of the widget. The PROD

CAL calendar consists of


continuous work from Monday 8 a.m. through Saturday 6 p.m. except for two
2-hour breaks per day from 6 a.m. to 8 a.m. and from 6 p.m. to 8 p.m. Thus,
PROD

CAL is made up of eleven 8-hour shifts per week; six day shifts and
ve night shifts.
The Eng

cal calendar denes the calendar followed by the Engineering de-


partment for writing the specications for the prototype. 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

FINISH= options in the CHART statement are


used to specify the variables containing the actual start and nish times for each activ-
ity. The actual schedule is plotted with the ll pattern specied in the sixth PATTERN
statement. This example also illustrates the drawing of holidays in graphics mode.
PROC GANTT uses the ll pattern specied in the seventh PATTERN statement to
represent the holidays dened by the HOLIDATA= data set. The holidays are identi-
ed to PROC GANTT by specifying the HOLIDAY= and HOLIFIN= options in the
CHART statement.
The HCONNECT option causes a connecting line to be drawn from the left boundary
of the chart to the early start time for each activity. The CHCON= option species the
color for drawing the connect lines. You can use the LHCON= option in the CHART
statement to specify a line style other than the default style for the connect lines. The
Gantt chart is shown in Output 4.10.1.
520

Chapter 4. The GANTT Procedure
data complete;
format activity $12. sdate date7. fdate date7.;
input activity & sdate & date7. fdate & date7.;
datalines;
Approve Plan 01dec03 05dec03
Drawings 06dec03 16dec03
Anal. Market 05dec03 09dec03
Write Specs 07dec03 12dec03
Prototype 17dec03 03jan04
Mkt. Strat. 10dec03 19dec03
Materials 02jan04 11jan04
Facility 01jan04 13jan04
Init. Prod. 13jan04 21jan04
Evaluate 22jan04 01feb04
Test Market 23jan04 08feb04
Changes 05feb04 11feb04
Production 12feb04 12feb04
Marketing 26jan04 26jan04
;
* merge the computed schedule with the actual schedule;
data widgela;
merge saveh complete;
run;
* sort the data;
proc sort;
by e_start;
run;
title f=swiss Gantt Example 10;
title2 f=swiss
Plotting Actual Start and Finish Times on the Chart;
* set vpos to 40 and hpos to 100;
goptions vpos=40 hpos=100;
* plot the computed and actual schedules using proc gantt;
proc gantt data=widgela holidata=holidays;
chart / holiday=(holiday) holifin=(holifin)
a_start=sdate a_finish=fdate
dur=days cmile=blue
font=swiss ctext=blue
caxis=black hconnect
compress;
id task;
run;
Example 4.11. Comparing Progress Against a Baseline Schedule

521
Output 4.10.1. Plotting the Actual Schedule on the Gantt Chart
Example 4.11. Comparing Progress Against a Baseline
Schedule
Suppose that the widget manufacturing project is currently in progress and you want
to measure its performance by comparing it with a baseline schedule. For example,
the baseline schedule may be the originally planned schedule, a target schedule that
you would like to achieve, or an existing schedule that you intend to improve on.
The data for this example come from Example 2.13, which was used to illustrate the
options available in PROC CPM. Prior to the beginning of the project, the predicted
early schedule is saved by PROC CPM as the baseline schedule. Progress infor-
mation for the project as of December 19, 2003, is saved in the ACTUAL data set.
The variables SDATE and FDATE represent the actual start and actual nish times,
respectively. The variables PCTC and RDUR represent the percent of work com-
pleted and the remaining days of work for each activity, respectively. PROC CPM
is then invoked using the baseline and project progress information with TIMENOW
set to December 19, 2003. The scheduling is carried out with the AUTOPUPDT
option in order to automatically update progress information. The Schedule data
set WIDGUPDT produced by PROC CPM is shown in Output 4.11.1. Notice that
the development of a marketing strategy (activity 5: Mkt. Strategy) and the build-
ing of the prototype (activity 6: Prototype) have a specied value for A

START
and a missing value for A

FINISH, indicating that they are currently in progress at


TIMENOW.
PROC GANTT is next invoked with the data set WIDGUPDT. This data set contains
the actual schedule variables A

START and A

FINISH and the baseline schedule


522

Chapter 4. The GANTT Procedure
variables B

START and B

FINISH. The Gantt chart is drawn with three schedule


bars per activity. The rst bar represents the predicted early/late schedule based on the
actual data specied, the second bar represents the actual schedule, and the third bar
represents the baseline schedule. The TIMENOW= option is specied in the CHART
statement to draw a timenow line on December 19, 2003. Actual schedule bars for
Mkt. Strategy and Prototype are drawn up to TIMENOW to indicate that they are
currently in progress. You can use the CTNOW=, LTNOW=, and WTNOW= options
to change the color, style, and width of the timenow line, respectively. To suppress
the timenow label displayed at the bottom of the axis, specify the NOTNLABEL in
the CHART statement.
* estimate schedule based on actual data;
proc cpm data=widgact holidata=holidays
out=widgupdt date=1dec03d;
activity task;
succ succ1 succ2 succ3;
duration days;
holiday holiday / holifin=(holifin);
baseline / compare=early;
actual / as=sdate af=fdate timenow=19dec03d
remdur=rdur pctcomp=pctc
autoupdt;
run;
* sort the data;
proc sort;
by e_start;
run;
title Gantt Example 11;
title2 Progress Data;
* print the data;
proc print;
var task e_: l_: a_start a_finish b_: ;
run;
* set up required pattern statements;
pattern1 c=black v=r1; /* duration of a noncritical act. */
pattern2 c=black v=e; /* slack time for a noncrit. act. */
pattern3 c=black v=s; /* duration of a critical act. */
pattern4 c=black v=e; /* slack time for a supercrit. act. */
pattern5 c=black v=r2; /* duration of a supercrit. act. */
pattern6 c=black v=l1; /* actual duration of an activity */
pattern7 c=black v=x1; /* break due to a holiday */
pattern8 c=black v=l1; /* resource schedule of activity */
pattern9 c=black v=e; /* baseline schedule of activity */
title f=swiss Gantt Example 11;
title2 f=swiss Comparing Project Progress against a Baseline
Schedule;
Example 4.11. Comparing Progress Against a Baseline Schedule

523
* plot the actual and baseline schedules using proc gantt;
proc gantt data=widgupdt holidata=holidays;
chart / holiday=(holiday) holifin=(holifin)
timenow=19dec03d dur=days
scale=2 height=1.25 font=swiss
pcompress;
id task;
run;
Output 4.11.1. Schedule Data Set WIDGUPDT
Gantt Example 11
Progress Data
Obs task E_START E_FINISH L_START L_FINISH A_START A_FINISH B_START B_FINISH
1 Approve Plan 01DEC03 05DEC03 01DEC03 05DEC03 01DEC03 05DEC03 01DEC03 05DEC03
2 Anal. Market 05DEC03 09DEC03 05DEC03 09DEC03 05DEC03 09DEC03 06DEC03 10DEC03
3 Drawings 06DEC03 16DEC03 06DEC03 16DEC03 06DEC03 16DEC03 06DEC03 15DEC03
4 Write Specs 07DEC03 12DEC03 07DEC03 12DEC03 07DEC03 12DEC03 06DEC03 10DEC03
5 Mkt. Strat. 10DEC03 21DEC03 10DEC03 21DEC03 10DEC03 . 11DEC03 20DEC03
6 Prototype 17DEC03 04JAN04 17DEC03 04JAN04 17DEC03 . 16DEC03 03JAN04
7 Materials 05JAN04 14JAN04 05JAN04 14JAN04 . . 04JAN04 13JAN04
8 Facility 05JAN04 14JAN04 05JAN04 14JAN04 . . 04JAN04 13JAN04
9 Init. Prod. 15JAN04 24JAN04 15JAN04 24JAN04 . . 14JAN04 23JAN04
10 Evaluate 25JAN04 03FEB04 30JAN04 08FEB04 . . 24JAN04 02FEB04
11 Test Market 25JAN04 08FEB04 25JAN04 08FEB04 . . 24JAN04 07FEB04
12 Marketing 25JAN04 25JAN04 14FEB04 14FEB04 . . 24JAN04 24JAN04
13 Changes 09FEB04 13FEB04 09FEB04 13FEB04 . . 08FEB04 12FEB04
14 Production 14FEB04 14FEB04 14FEB04 14FEB04 . . 13FEB04 13FEB04
524

Chapter 4. The GANTT Procedure
Output 4.11.2. Comparing Project Progress Against a Baseline Schedule
Example 4.12. Using the COMBINE Option
When you monitor a project in progress, as in the previous example, it is evident that
there are no actual dates beyond TIMENOW and that PROC CPM sets the early times
to the corresponding actual times for activities that are completed or in progress (see
Output 4.11.1). For example, activities 1 through 4 have their early schedule equal to
the actual schedule. Activities 5 and 6 have their early start equal to the actual start;
however the actual nish for these two activities is missing since they are in progress
at TIMENOW. Finally, activities 7 through 14 have no actual information.
The COMBINE option in PROC GANTT exploits the fact that the early times are
made consistent with the actual times to strip away a lot of the redundancy and pro-
duce a more compact Gantt chart while retaining all of the essential schedule infor-
mation. Specifying the COMBINE option in the CHART statement of the previous
example produces the Gantt chart in Output 4.12.1. Instead of using two separate bars
to draw the early/late schedule and the actual schedule, the COMBINE option causes
PROC GANTT to use one bar to represent all three schedules and draws a timenow
line. The actual schedule is shown to the left of TIMENOW and the early/late sched-
ule is shown to the right of TIMENOW. Thus, for activities 1 through 4, the actual
schedule is drawn on the rst bar to the left of the timenow line. Activities 5 and 6
are in progress at TIMENOW, which is indicated by the actual start positioned to the
left of TIMENOW and the predicted early/late schedule, based on the progress made
up to TIMENOW, drawn to the right of TIMENOW. Activities 7 through 14 have not
yet started, and this is reected in their predicted early/late schedules drawn to the
right of TIMENOW.
Example 4.12. Using the COMBINE Option

525
The COMBINE option draws a timenow line by default, and if the TIMENOW=
option is not specied, the procedure computes the value of TIMENOW based on
the schedule data as explained in the Syntax section. In this example, specifying
the COMBINE option without the TIMENOW= option causes a timenow line to be
drawn on December 18, 2003, since this is the rst day following the largest actual
value. The CTNOW= option is used to specify the color of the timenow line. You can
change the line style and line width of the timenow line by specifying the LTNOW=
and WTNOW= options, respectively, in the CHART statement.
title f=swiss Gantt Example 12;
title2 f=swiss Using the COMBINE Option;
* set vpos to 50 and hpos to 100;
goptions vpos=50 hpos=100;
* plot the combined and baseline schedules using proc gantt;
proc gantt graphics data=widgupdt holidata=holidays;
chart / holiday=(holiday) holifin=(holifin)
timenow=19dec03d ctnow=red
combine
dur=days
font=swiss
compress;
id task;
run;
526

Chapter 4. The GANTT Procedure
Output 4.12.1. Using the COMBINE Option in Graphics Mode
Example 4.13. Plotting the Resource-Constrained Schedule
This example illustrates plotting the resource-constrained schedules on a Gantt chart.
The schedule used is the one produced in Example 2.19 using the CPM procedure.
The output data set from PROC CPM is displayed in Output 4.13.1. Notice that the
activities Drawings and Mkt. Strat. have been split to produce a shorter project
duration than if they had not been split.
PROC GANTT is invoked with all default options and an ID statement. The early/late
schedule is drawn on the rst bar, and the resource-constrained schedule is drawn on
the second bar of each activity. The observations corresponding to the split segments
of each activity have been combined to produce the plot of the resource-constrained
schedule for that activity. Thus, even though the Schedule data set input to PROC
GANTT contains 18 observations, the Gantt chart shows each of the 14 activities
only once.
Example 4.13. Plotting the Resource-Constrained Schedule

527
title f=swiss Gantt Example 13;
title2 f=swiss Resource Constrained Schedule;
* plot the resource-constrained schedule using proc gantt;
proc gantt data=spltschd holidata=holdata;
chart / holiday=(hol) dur=days
font=swiss pcompress;
id task;
run;
Output 4.13.1. Schedule Data Set SPLTSCHD
Gantt Example 13
Project Schedule: Splitting Allowed
S S E L
E p h S _ E _ L _
G r r _ F _ F _ F
M o d S I S I S I
T s T d d w T N T N T N
O a u _ a m a A I A I A I
b s c N y a r R S R S R S
s k c O s n e T H T H T H
1 Approve Plan Drawings . 5 1 . 01DEC03 05DEC03 01DEC03 05DEC03 01DEC03 05DEC03
2 Drawings Prototype . 10 . 1 08DEC03 23DEC03 08DEC03 19DEC03 08DEC03 19DEC03
3 Drawings Prototype 1 2 . 1 08DEC03 09DEC03 08DEC03 19DEC03 08DEC03 19DEC03
4 Drawings Prototype 2 8 . 1 12DEC03 23DEC03 08DEC03 19DEC03 08DEC03 19DEC03
5 Anal. Market Mkt. Strat. . 5 . . 08DEC03 12DEC03 08DEC03 12DEC03 21JAN04 27JAN04
6 Write Specs Prototype . 5 . . 08DEC03 12DEC03 08DEC03 12DEC03 15DEC03 19DEC03
7 Prototype Materials . 15 1 . 24DEC03 15JAN04 22DEC03 13JAN04 22DEC03 13JAN04
8 Mkt. Strat. Test Market . 10 1 . 15DEC03 20JAN04 15DEC03 29DEC03 28JAN04 10FEB04
9 Mkt. Strat. Test Market 1 7 1 . 15DEC03 23DEC03 15DEC03 29DEC03 28JAN04 10FEB04
10 Mkt. Strat. Test Market 2 3 1 . 16JAN04 20JAN04 15DEC03 29DEC03 28JAN04 10FEB04
11 Materials Init. Prod. . 10 . . 16JAN04 29JAN04 14JAN04 27JAN04 14JAN04 27JAN04
12 Facility Init. Prod. . 10 . . 16JAN04 29JAN04 14JAN04 27JAN04 14JAN04 27JAN04
13 Init. Prod. Test Market . 10 1 . 30JAN04 12FEB04 28JAN04 10FEB04 28JAN04 10FEB04
14 Evaluate Changes . 10 1 . 13FEB04 26FEB04 11FEB04 24FEB04 18FEB04 02MAR04
15 Test Market Changes . 15 . . 13FEB04 04MAR04 11FEB04 02MAR04 11FEB04 02MAR04
16 Changes Production . 5 . . 05MAR04 11MAR04 03MAR04 09MAR04 03MAR04 09MAR04
17 Production . 0 1 . 12MAR04 12MAR04 10MAR04 10MAR04 10MAR04 10MAR04
18 Marketing . 0 . . 13FEB04 13FEB04 11FEB04 11FEB04 10MAR04 10MAR04
528

Chapter 4. The GANTT Procedure
Output 4.13.2. Plotting the Resource-Constrained Schedule
Example 4.14. Specifying the Schedule Data Directly
Although each of the examples shown so far uses PROC CPM to produce the
Schedule data set for PROC GANTT, this is by no means a requirement of the
GANTT procedure. While the CPM procedure is a convenient means for produc-
ing different types of schedules, you can create your own schedule and draw a Gantt
chart of the schedule without any intervention from PROCCPM. This is done by stor-
ing the schedule information in a SAS data set and specifying the data set name using
the DATA= option in the PROC GANTT statement. It is also not necessary for the
variables in the data set to have specic names, although giving the variables certain
names can eliminate the need to explicitly identify them in the CHART statement.
An example of the direct type of input can be seen in Example 4.10 which illus-
trates plotting of the actual schedule. In Example 4.10, PROC CPM was used to
compute the predicted early/late schedule, which was then stored in the SAVEH
data set. However, information about the actual schedule, which was provided in
the COMPLETE data set, was not used by PROC CPM. Instead, this information
was merged with the SAVEH data set to form WIDGELA, the Schedule data set for
PROC GANTT. The variables representing the actual start and nish were identi-
ed to PROC GANTT using the A

START= and A

FINISH= options, respectively,


in the CHART statement. The identication of the variables would not have been
necessary if the start and nish variable names were 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

NO, DUR, RS, RF, E

START, E

FINISH, SDATE, and


FDATE. The variable TASK identies the activity. 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

FINISH= options) in the CHART statement. The variables RS


and RF represent the resource-constrained start and nish times, respectively. As
with the late schedule, these variables need to be identied to PROC GANTT by
specifying the SS= and SF= options (or the S

START= and S

FINISH= options)
in the CHART statement. Further, the SEGMT

NO variable identies the segment


number of the resource constrained schedule that an observation corresponds to since
these are activities that start and stop multiple times before completion. The ZDUR
variable is identied as a zero duration indicator by specifying the DUR= option in
the CHART statement. Since ZDUR is zero for Production and Marketing, these
activities are represented by milestones on the chart. Notice that although all the
other activities have a value of 1 for the ZDUR variable, any nonzero value will
produce the same result. This is due to the fact that PROC GANTT only uses this
variable as an indicator of whether the activity has zero duration or not, in contrast to
the interpretation of the DURATION variable in PROC CPM.
options ps=60 ls=100;
title f=swiss Gantt Example 14;
/* Activity-on-Node representation of the project */
data widgdir;
format task $12. rs rf e_start e_finish sdate fdate date7.;
input task & segmt_no zdur rs & date7. rf & date7.
e_start & date7. e_finish & date7.
sdate & date7. fdate & date7.;
datalines;
Approve Plan . 1 01DEC03 05DEC03 01DEC03 05DEC03 01DEC03 05DEC03
Drawings . 1 08DEC03 23DEC03 08DEC03 19DEC03 08DEC03 19DEC03
Drawings 1 1 08DEC03 09DEC03 08DEC03 19DEC03 08DEC03 19DEC03
Drawings 2 1 12DEC03 23DEC03 08DEC03 19DEC03 08DEC03 19DEC03
Anal. Market . 1 08DEC03 12DEC03 08DEC03 12DEC03 21JAN04 27JAN04
Write Specs . 1 08DEC03 12DEC03 08DEC03 12DEC03 15DEC03 19DEC03
Prototype . 1 24DEC03 15JAN04 22DEC03 13JAN04 22DEC03 13JAN04
Mkt. Strat. . 1 15DEC03 20JAN04 15DEC03 29DEC03 28JAN04 10FEB04
Mkt. Strat. 1 1 15DEC03 23DEC03 15DEC03 29DEC03 28JAN04 10FEB04
Mkt. Strat. 2 1 16JAN04 20JAN04 15DEC03 29DEC03 28JAN04 10FEB04
Materials . 1 16JAN04 29JAN04 14JAN04 27JAN04 14JAN04 27JAN04
Facility . 1 16JAN04 29JAN04 14JAN04 27JAN04 14JAN04 27JAN04
Init. Prod. . 1 30JAN04 12FEB04 28JAN04 10FEB04 28JAN04 10FEB04
Evaluate . 1 13FEB04 26FEB04 11FEB04 24FEB04 18FEB04 02MAR04
Test Market . 1 13FEB04 04MAR04 11FEB04 02MAR04 11FEB04 02MAR04
Changes . 1 05MAR04 11MAR04 03MAR04 09MAR04 03MAR04 09MAR04
Production . 0 12MAR04 12MAR04 10MAR04 10MAR04 10MAR04 10MAR04
Marketing . 0 13FEB04 13FEB04 11FEB04 11FEB04 10MAR04 10MAR04
;
530

Chapter 4. The GANTT Procedure
data holdata;
format hol date7.;
input hol & date7.;
datalines;
25dec03
01jan04
;
* set up required pattern statements;
pattern1 c=black v=r1; /* duration of a non-critical activity */
pattern2 c=black v=e; /* slack time for a noncrit. activity */
pattern3 c=black v=s; /* duration of a critical activity */
pattern4 c=black v=e; /* slack time for a supercrit. activity */
pattern5 c=black v=r2; /* duration of a supercrit. activity */
pattern6 c=black v=l1; /* actual duration of an activity */
pattern7 c=black v=x1; /* break due to a holiday */
pattern8 c=black v=l1; /* resource schedule of activity */
pattern9 c=black v=e; /* baseline schedule of activity */
title2 f=swiss Specifying the Schedule Data Directly;
proc gantt data=widgdir holidata=holdata;
chart / holiday=(hol) dur=zdur
ss=rs sf=rf ls=sdate lf=fdate
font=swiss pcompress;
id task;
run;
Example 4.15. BY Processing

531
Output 4.14.1. Specifying the Schedule Data Directly
Example 4.15. BY Processing
Every activity in the widget manufacturing project is carried out by one of ve
departments: Planning, Engineering, Marketing, Manufacturing, and Testing. The
DETAILS data set in Example 4.6 identies the department responsible for each ac-
tivity. Thus, the project can be thought of as made up of ve smaller subprojects,
a subproject being the work carried out by a department. A foreseeable need of the
project manager and every department is a separate Gantt chart for each subproject.
This example uses the WIDGETN data set from Example 2.1, which is formed by
merging the WIDGET data set with the DETAILS data set. After scheduling the
master project using PROC CPM with DEPT as an ID variable, the Schedule data
set is sorted by department name and early start time. The GANTT procedure is then
invoked with the variable DEPT specied in the BY statement to obtain individual
Gantt charts for each subproject. The Gantt charts for the ve different subprojects
are shown in Output 4.15.1. The MINDATE= and MAXDATE= options have been
specied to ensure a consistent date range across projects. Notice that the TITLE2
statement uses the text substitution option #BYVARn, which substitutes the name of
the nth BY variable. The BY-LINE that appears below the titles identies the current
values of the BY variables. You can suppress this using the NOBYLINE option in an
OPTION statement or the HBY option in a GOPTIONS statement. The SPLIT= op-
tion is specied to prevent the TASK variable label from being split on the embedded
blank.
532

Chapter 4. The GANTT Procedure
title f=swiss Gantt Example 15;
data widgetn;
label task = "Activity Name";
merge widget details;
run;
proc cpm date=01dec03d data=widgetn;
activity task;
duration days;
successor succ1 succ2 succ3;
id dept;
run;
proc sort;
by dept e_start;
run;
title2 f=swiss Project Schedules by #BYVAR1;
proc gantt split=/;;
chart / pcompress scale=1 dur=days
mindate=01dec03d maxdate=11feb04d
font=swiss ;
by dept;
id task;
run;
Example 4.15. BY Processing

533
Output 4.15.1. Using BY Processing for Separate Gantt Charts
534

Chapter 4. The GANTT Procedure
Example 4.16. Gantt Charts by Persons

535
Example 4.16. Gantt Charts by Persons
Now suppose that you want to obtain individual Gantt charts for two people
(Thomas and William) working on the widget manufacturing project. The data set
WIDGBYGP, displayed in Output 4.16.1, contains two new variables, THOMAS
and WILLIAM. Each variable has a value 1 for activities in which the person is in-
volved and a missing value otherwise. Thus, a value of 1 for the variable THOMAS
in observation number 2 indicates that Thomas is working on the activity Drawings.
PROC CPM is used to schedule the project to start on December 1, 2003. A data
set named PERSONS is created containing one observation per activity per person
working on that activity and a new variable named PERSON containing the name of
the person to which the observation pertains. For example, this new data set contains
two observations for the activity Write Specs, one with PERSON=Thomas and
the other with PERSON=William, and no observation for the activity Approve
Plan. This data set is sorted by PERSON and E

START, and displayed in Output


4.16.2. PROC GANTT is next invoked with a BY statement to obtain individual
charts for each person. The resulting Gantt charts are shown in Output 4.16.3. The
BY-LINE is suppressed by specifying the NOBYLINE option in an OPTIONS state-
ment and the name of the person corresponding to the chart is displayed in the subtitle
by using the #BYVAL substitution in the TITLE2 statement.
536

Chapter 4. The GANTT Procedure
Output 4.16.1. Data Set WIDGBYGP
Gantt Example 16
Data widgbyp
Obs task days tail head thomas william
1 Approve Plan 5 1 2 . .
2 Drawings 10 2 3 1 .
3 Anal. Market 5 2 4 . .
4 Write Specs 5 2 3 1 1
5 Prototype 15 3 5 1 1
6 Mkt. Strat. 10 4 6 . .
7 Materials 10 5 7 . 1
8 Facility 10 5 7 . 1
9 Init. Prod. 10 7 8 1 .
10 Evaluate 10 8 9 1 1
11 Test Market 15 6 9 . .
12 Changes 5 9 10 1 .
13 Production 0 10 11 . 1
14 Marketing 0 6 12 . .
15 Dummy 0 8 6 . .
title f=swiss Gantt Example 16;
proc cpm data=widgbyp date=1dec03d;
tailnode tail;
duration days;
headnode head;
id task thomas william;
run;
data persons;
set _last_;
if william^=. then do;
person=William;
output;
end;
if thomas^=. then do;
person=Thomas;
output;
end;
drop thomas william;
run;
proc sort data=persons;
by person e_start;
run;
Example 4.16. Gantt Charts by Persons

537
title2 Data PERSONS;
proc print data=persons;
run;
/* suppress byline */
options nobyline;
title2 f=swiss Personalized Gantt Chart for #BYVAL(person);
proc gantt data=persons;
chart / pcompress font=swiss;
by person;
id task;
run;
Output 4.16.2. Data Set PERSONS
Data PERSONS
Obs tail head days task E_START E_FINISH L_START L_FINISH T_FLOAT F_FLOAT person
1 2 3 10 Drawings 06DEC03 15DEC03 06DEC03 15DEC03 0 0 Thomas
2 2 3 5 Write Specs 06DEC03 10DEC03 11DEC03 15DEC03 5 5 Thomas
3 3 5 15 Prototype 16DEC03 30DEC03 16DEC03 30DEC03 0 0 Thomas
4 7 8 10 Init. Prod. 10JAN04 19JAN04 10JAN04 19JAN04 0 0 Thomas
5 8 9 10 Evaluate 20JAN04 29JAN04 25JAN04 03FEB04 5 5 Thomas
6 9 10 5 Changes 04FEB04 08FEB04 04FEB04 08FEB04 0 0 Thomas
7 2 3 5 Write Specs 06DEC03 10DEC03 11DEC03 15DEC03 5 5 William
8 3 5 15 Prototype 16DEC03 30DEC03 16DEC03 30DEC03 0 0 William
9 5 7 10 Materials 31DEC03 09JAN04 31DEC03 09JAN04 0 0 William
10 5 7 10 Facility 31DEC03 09JAN04 31DEC03 09JAN04 0 0 William
11 8 9 10 Evaluate 20JAN04 29JAN04 25JAN04 03FEB04 5 5 William
12 10 11 0 Production 09FEB04 09FEB04 09FEB04 09FEB04 0 0 William
538

Chapter 4. The GANTT Procedure
Output 4.16.3. Gantt Charts by Person
Example 4.17. Using the HEIGHT= and HTOFF= Options

539
Example 4.17. Using the HEIGHT= and HTOFF= Options
The following example illustrates two options that control the height and position-
ing of all text produced by PROC GANTT. The data used for this example come
from Example 4.13, which illustrates plotting of the resource-constrained schedule.
PATTERN statements are specied in order to identify the ll patterns for the differ-
ent schedule types and holidays. The resource-constrained schedule is drawn using
the ll pattern from the eighth PATTERN statement. The HEIGHT= option is set
to 2, indicating that the height of all text produced by PROC GANTT be equal to
the height of two activity bars. This text includes activity text, legend text, and axis
labeling text. The HTOFF= option is also set to 2, which drops the font baseline of
the activity text by the height of one schedule bar causing the font baseline to be po-
sitioned at the bottom of the resource-constrained schedule bar. The resulting Gantt
chart is displayed in Output 4.17.1.
title f=swiss Gantt Example 17;
title2 f=swiss Using the HEIGHT= and HTOFF= options;
* set vpos to 50 and hpos to 100;
goptions vpos=50 hpos=100;
* set up required pattern statements;
pattern1 c=black v=r1; /* duration of a noncrit. activity */
pattern2 c=black v=e; /* slack time for a noncrit. act. */
pattern3 c=black v=s; /* duration of a critical activity */
pattern4 c=black v=e; /* slack time for a supercrit. act. */
pattern5 c=black v=r2; /* duration of a supercrit. act. */
pattern6 c=black v=l1; /* actual duration of an activity */
pattern7 c=black v=x1; /* break due to a holiday */
pattern8 c=black v=l1; /* res. constrained dur of an act. */
pattern9 c=black v=e; /* baseline duration of an activity */
proc sort data=spltschd;
by e_start;
run;
goptions cback=cyan;
* draw Gantt chart using height and htoff equal to 2;
proc gantt data=spltschd holidata=holdata;
chart / holiday=(hol) font=swiss
dur=days cmile=green
height=2
htoff=2
compress;
id task;
run;
540

Chapter 4. The GANTT Procedure
Output 4.17.1. Using the HEIGHT= and HTOFF= options
Example 4.18. Drawing a Logic Gantt Chart Using AON
Representation
This example uses the data of Example 4.10, which illustrates the drawing of the
actual schedule. The ACTIVITY= and SUCCESSOR= options are specied in the
CHART statement to dene the precedence relationships using the AON format to
PROC GANTT. Since no LAG= option is specied, the lag type of each connection
is assumed to be Finish-to-Start (FS). In this case, the precedence dening variables
exist in the WIDGELA data set; however, this is not a requirement. The precedence
dening variables can belong to a different data set as long as the ACTIVITY variable
is common to both data sets and the PRECDATA= option, identifying the Precedence
data set, is specied in the PROC GANTT statement. Setting the LEVEL= option to
2 causes the actual schedule bar to be used as the logic bar; that is, PROC GANTT
draws the precedence connections with respect to the actual schedule. By default,
the precedence connections are drawn with respect to the rst bar. The color of the
precedence connections is specied with the CPREC= option in the CHART state-
ment. You can change the line style and line width of the precedence connections
by specifying the LPREC= and WPREC= options in the CHART statement. The
resulting Gantt chart is shown in Output 4.18.1.
Example 4.18. Drawing a Logic Gantt Chart Using AON Representation

541
title f=swiss Gantt Example 18;
title2 f=swiss
Logic Gantt Chart: AON Representation and LEVEL= Option;
* sort the data;
proc sort;
by e_start;
run;
* set vpos to 50 and hpos to 100;
goptions vpos=50 hpos=100;
* set background to ltgray;
goptions cback=ltgray;
* draw the Logic Gantt chart;
proc gantt data=widgela holidata=holidays;
chart / holiday=(holiday) holifin=(holifin)
a_start=sdate a_finish=fdate
cmile=black dur=days
font=swiss
activity=task successor=(succ1-succ3)
level=2
cprec=blue
compress;
id task;
run;
542

Chapter 4. The GANTT Procedure
Output 4.18.1. Drawing a Logic Gantt Chart Using AON Representation
Example 4.19. Specifying the Logic Control Options
This example illustrates four options that control the routing of a precedence con-
nection from an activity to its successor on the logic Gantt chart. The example also
illustrates the drawing of a Logic Gantt chart using the Activity-on-Arc format.
The Activity data set for PROC CPM is the WIDGETA data set from Example 2.2,
which denes the widget manufacturing project in AOA format. The project is sched-
uled subject to weekends, and the holidays are dened in the HOLDATA data set. The
resulting schedule is stored in the output data set SAVEHP. The GANTT procedure
is next invoked to produce a Logic Gantt chart by specifying the HEAD= and TAIL=
options in the CHART statement. The TRIPLEX font is used for all text except for
the rst TITLE by specifying it globally using the FTEXT= option in a GOPTIONS
statement. The same effect could have been obtained by specifying the TRIPLEX
font using the FONT= option in the CHART statement and the F= option in the
TITLE2 statement. The resulting Logic Gantt chart is shown in Output 4.19.1.
Example 4.19. Specifying the Logic Control Options

543
title f=swiss Gantt Example 19;
data holdata;
format hol date7.;
input hol & date7.;
datalines;
25dec03
01jan04
;
* schedule the project subject to holidays and weekends;
proc cpm data=widgeta holidata=holdata out=savehp
date=1dec03d interval=weekday;
tailnode tail;
headnode head;
duration days;
holiday hol;
id task dept descrpt;
run;
* sort the schedule by the early start date ;
proc sort;
by e_start;
run;
* set background to white, text to black and font to triplex;
goptions cback=white ctext=black ftext=triplex;
* set vpos to 50 and hpos to 100;
goptions vpos=50 hpos=100;
* plot the Logic Gantt chart using AOA representation;
title2 Logic Gantt Chart: AOA Representation;
proc gantt data=savehp holidata=holdata;
chart / holiday=(hol) dur=days increment=7 compress
caxis=black cmile=cyan cprec=blue
head=head tail=tail;
id task;
run;
544

Chapter 4. The GANTT Procedure
Output 4.19.1. Logic Gantt Chart: AOA Representation
The next invocation of PROC GANTT illustrates the effect of the MININTGV= and
MINOFFGV= options, which control placement of the global verticals. The concept
of global verticals is explained in the Specifying the Logic Options section on page
473. The data sets from the previous invocation of the GANTT procedure remain
unchanged. The minimum distance of a global vertical from the end of the bar it
is associated with is increased from its default of 1 cell to 2.5 cells by specifying
MINOFFGV=2.5. Likewise, the minimum distance between any two global verticals
is increased from its default of .75 cells to 2 cells by specifying MININTGV=2.0.
The effects of these changes are visible in the resulting Logic Gantt chart shown in
Output 4.19.2.
* illustrate the minintgv and minoffgv options;
title2 Logic Gantt Chart: AOA Representation, MININTGV=2 and MINOFFGV=2.5;
proc gantt data=savehp holidata=holdata;
chart / holiday=(hol) dur=days increment=7 compress
caxis=black cmile=cyan cprec=blue
head=head tail=tail
minintgv=2.0 minoffgv=2.5;
id task;
run;
Notice that now there is greater distance between vertical segments (corresponding
to global verticals), and the horizontal segments leaving bars are longer.
Example 4.19. Specifying the Logic Control Options

545
Output 4.19.2. Specifying the MININTGV= and MINOFFGV= Options
The MAXDATE= option is specied in the remaining Gantt calls in this example in
order to focus on the schedule bars of the rst few activities in the chart. The next two
outputs illustrate the use of the MAXDISLV= option in the CHART statement. The
MAXDISLV= option is used as a safeguard to limit the feasible region made available
to PROC GANTT for placement of local verticals. The value specied dictates the
maximum allowable displacement of the local vertical from its ideal position, that
is, at a distance of MINOFFLV= from the end of the bar with which it is associated.
However, this ideal position may tend to be positioned too close to a global vertical
or even coincide with one. Depending on the cell width, this can result in visual
misinterpretation of the Logic Gantt chart. In order to avoid this scenario, you should
specify a reasonable value for the MAXDISLV= option to permit a certain amount
of freedom for local vertical placement so as to distinguish between local and global
verticals. Typically, use of this option is desirable when the value of the MININTGV=
option, the minimum distance between global verticals, is relatively much greater
than the value of the MAXDISLV= option.
To illustrate, consider the following Gantt call with a large MININTGV= value (10)
and a relatively smaller MAXDISLV= value (0.3). Thus, for every local vertical,
PROC GANTT has a very small interval that is less than a third of a cell wide in
which to place that local vertical regardless of whether a global vertical runs through
that interval or not. The result of this constraint is illustrated in the chart shown
in Output 4.19.3. The local vertical for Drawings is positioned as far as possible
from the global vertical of Approve Plan, but the value of the MAXDISLV= option
546

Chapter 4. The GANTT Procedure
restricts it from being positioned any further. Visually it is not pleasing, and it is
difcult to distinguish the local and global verticals. A similar situation is evident
with the local vertical of Prototype and the global vertical of Write Specs.
title2
Logic Gantt Chart: AOA Representation and MAXDISLV=.3;
proc gantt data=savehp holidata=holdata;
chart / holiday=(hol) dur=days compress
caxis=black cmile=cyan cprec=blue
head=head tail=tail
maxdislv=.3 minintgv=10
maxdate=01feb04d;
id task;
run;
Output 4.19.3. Specifying the MAXDISLV= Option (I)
By reducing the value of MAXDISLV= even further, you can produce a chart that
gives the appearance of a local vertical overlapping with a global vertical owing to
resolution limitations of the display device. Theoretically, by design, this will never
be the case. Recall that the value of the MAXDISLV= option is strictly positive and
is at least one-tenth of a cell width.
The solution to this problem is to increase the value of the MAXDISLV= option
so that the local vertical can be displaced further away from any adjacent global
verticals. In the next invocation of PROC GANTT, the value of the MAXDISLV=
option is increased to 2, resulting in a Logic Gantt chart in which the local verticals
Example 4.19. Specifying the Logic Control Options

547
are staggered further away from nearby global verticals. This Gantt chart is displayed
in Output 4.19.4.
title2
Logic Gantt Chart: AOA Representation and MAXDISLV=2;
proc gantt data=savehp holidata=holdata;
chart / holiday=(hol) dur=days compress
caxis=black cmile=cyan cprec=blue
head=head tail=tail
maxdislv=2 minintgv=10
maxdate=01feb04d;
id task;
run;
Output 4.19.4. Specifying the MAXDISLV= Option (II)
The nal Gantt chart in this example illustrates the use of the MINOFFLV= option
in the CHART statement. This option species the minimum distance of a local
vertical from the end of the bar with which it is associated. Although the position
corresponding to the MINOFFLV= option is the position of choice for placement of
the local vertical, the actual placement can differ from this position owing to the pres-
ence of nearby global verticals, as illustrated by Output 4.19.3 and Output 4.19.4. The
maximum amount of displacement is determined by the value of the MAXDISLV=
option.
In all of the preceding charts in this example, the connection from the activity,
Approve Plan, to each of its three successors, Drawings, Anal. Market, and
548

Chapter 4. The GANTT Procedure
Write Specs, is a 5-segment connection similar to the type illustrated in Figure
4.13. This is caused by backtracking of the activitys global vertical to the succes-
sors local vertical as described in the Controlling the Layout section on page 477.
To transform this connection into a 3-segment connection as shown in Figure 4.12,
you need to position the local vertical to the right of the global vertical. The follow-
ing invocation of PROC GANTT achieves this by specifying MINOFFLV=0.5, and
the resulting Gantt chart is shown in Output 4.19.5. Notice that this option affects the
positioning of all local verticals on the chart in contrast to the MAXDISLV= option,
which affects only those local verticals that are close to global verticals.
* illustrate the minofflv option;
title2
Logic Gantt Chart: AOA Representation and MINOFFLV=.5;
proc gantt data=savehp holidata=holdata;
chart / holiday=(hol) dur=days compress
caxis=black cmile=cyan cprec=blue
head=head tail=tail
minofflv=.5
maxdate=01feb04d;
id task;
run;
Output 4.19.5. Specifying the MINOFFLV= Option
Example 4.20. Nonstandard Precedence Relationships

549
Example 4.20. Nonstandard Precedence Relationships
This example demonstrates the use of nonstandard precedence relationships and spec-
ication of the PRECDATA= option in the PROC GANTT statement.
The project and nonstandard precedence relationships are dened by the
WIDGLAG2 data set, which is a modication of the WIDGLAG data set that
was used in Example 2.11 to illustrate the CPM procedure. The activity and
successor variables are represented by the TASK and SUCC variables, respectively,
and the lag type of the relationship is dened by the LAGDUR variable. The
LAGDUR variable denes the lag type in keyword

duration

calendar format for


the purpose of passing the information to PROC CPM. Although PROC GANTT
accepts this format for a lag variable, it does not use the duration and calendar
values when drawing the connection since the schedule is already computed at this
time (presumably by PROC CPM).
As in the WIDGLAG data set, the WIDGLAG2 data set species a Start-to-Start
lag of nine days between the activity Prototype and its successors, Materials
and Facility, and a Finish-to-Start lag of two days between Facility and Init.
Prod.. In addition, changes to the widget design are permitted to be made no earlier
than six days after in-house evaluation of the product has begun. Furthermore, the
Engineering department has to ensure that there will be at least three days available
for any changes that need to be carried out after the test market results have come
in. These constraints are incorporated in the WIDGLAG data set by setting the value
of the LAGDUR variable equal to ss

6 for the relationship between Evaluate


and Changes and equal to ff

3 for the relationship between Test Market and


Changes.
The project is scheduled using PROC CPM subject to weekends and the holidays
dened in the HOLIDAYS data set. Specifying the COLLAPSE option in the PROC
CPM statement ensures that there is one observation per activity. The WIDGLAGH
data set is created by deleting the successor variable from the Schedule data set pro-
duced by PROC CPM.
Since there is no precedence information contained in the WIDGLAGH data
set, specifying DATA=WIDGLAGH in the PROC GANTT statement without the
PRECDATA= option produces a nonprecedence Gantt chart. You can produce a
Logic Gantt chart by specifying the precedence information using the PRECDATA=
option in the PROC GANTT statement as long as the activity variable is common to
both the schedule and Precedence data sets.
The Gantt chart shown in Output 4.20.1 is produced by specifying PRECDATA=
WIDGLAG2. The lag type of the precedence connections is indicated to PROC
GANTT using the LAG= option in the CHART statement. The width of the prece-
dence connections is set to 2 with the WPREC= option, and the color of the connec-
tions is set to blue using the CPREC= option. The MININTGV= and MINOFFLV=
options are specied in the CHART statement in an attempt to minimize the num-
ber of 5-segment connections. A reference line with a line style of 2 is drawn at
the beginning of every month by using the REF= and LREF= options in the CHART
statement.
550

Chapter 4. The GANTT Procedure
options ps=60 ls=100;
title f=swiss Gantt Example 20;
/* Activity-on-Node representation of the project with lags */
data widglag2;
format task $12. succ $12. lagdur $4. ;
input task & days succ & lagdur $ ;
datalines;
Approve Plan 5 Drawings .
Approve Plan 5 Anal. Market .
Approve Plan 5 Write Specs .
Drawings 10 Prototype .
Anal. Market 5 Mkt. Strat. .
Write Specs 5 Prototype .
Prototype 15 Materials ss_9
Prototype 15 Facility ss_9
Mkt. Strat. 10 Test Market .
Mkt. Strat. 10 Marketing .
Materials 10 Init. Prod. .
Facility 10 Init. Prod. fs_2
Init. Prod. 10 Test Market .
Init. Prod. 10 Marketing .
Init. Prod. 10 Evaluate .
Evaluate 10 Changes ss_6
Test Market 15 Changes ff_3
Changes 5 Production .
Production 0 . .
Marketing 0 . .
;
data holidays;
format holiday holifin date7.;
input holiday & date7. holifin & date7. holidur;
datalines;
24dec03 26dec03 4
01jan04 . .
;
proc cpm data=widglag2 holidata=holidays date=1dec03d
interval=weekday collapse;
activity task;
succ succ / lag = (lagdur);
duration days;
holiday holiday / holifin=(holifin);
run;
data widglagh;
set _last_;
drop succ;
run;
* set background to light gray
goptions cback=ltgray;
Example 4.20. Nonstandard Precedence Relationships

551
* set vpos to 50 and hpos to 100;
goptions vpos=50 hpos=100;
title2 f=swiss
Non-standard Precedence Relationships and the PRECDATA= Option;
proc gantt data=widglagh precdata=widglag2
holidata=holidays;
chart / compress dur=days
holiday=(holiday) holifin=(holifin)
cframe=ligr cmile=blue font=swiss
ref=01dec03d to 01mar04d by month
cref=black lref=2 reflabel
act=task succ=(succ) lag=(lagdur)
minintgv=2 minofflv=.5
cprec=blue wprec=2;
id task;
run;
Output 4.20.1. Nonstandard Precedence Relationships
552

Chapter 4. The GANTT Procedure
Example 4.21. Using the SAS/GRAPH ANNOTATE= Option
This example illustrates the use of the ANNOTATE= option to add graphics and text
to the body of the Gantt chart. The intent of the rst invocation of PROC GANTT
is to display the resource requirements of each activity on the Gantt chart, while that
of the second invocation is to plot the resource usage bar chart for the replenishable
resource engineers and the resource availability curve for the consumable resource
cost.
The data for this example come from Example 2.15, in which the widget manufac-
turing project is scheduled using PROC CPM subject to resource constraints. The
project network is dened in the WIDGRES data set using AOA format. The number
of engineers needed per day per activity is a replenishable resource and is identied
by the ENGINEER variable in the WIDGRES data set. The cost incurred per day
per activity is a consumable resource and is identied by the ENGCOST variable in
the WIDGRES data set. The WIDGRIN data set species the resource availabilities
for the project. The schedule produced by PROC CPM using the default choice of
LST as a heuristic is shown in Output 4.21.1. The following programs assume that the
schedule is stored in the WIDGSCH2 data set and that the resource usage is stored
in the WIDGROU2 data set.
The Annotate macros are used in this example to simplify the process of creating
Annotate observations. The ANNOMAC macro is rst used to compile the Annotate
macros and make them available for use. The Annotate data set ANNO1 is then
created using the Annotate macros. The DCLANNO macro declares all Annotate
variables except the TEXT variable, and the SYSTEM macro denes the Annotate
reference system. The coordinate system dened here uses date for the horizontal
scale and job number for the vertical scale. The text to be displayed contains the
number of engineers required per day and the total cost over the duration of the ac-
tivity. The LABEL macro is used to annotate the necessary text on the Gantt chart
using the BRUSH font.
The GANTT procedure is invoked with the ANNOTATE=ANNO1 specication in
the PROC GANTT statement. The resulting Gantt chart is shown in Output 4.21.2.
It is important to note that the job number will be used for the vertical scale even if
NOJOBNUM is specied in the CHART statement.
Example 4.21. Using the SAS/GRAPH ANNOTATE= Option

553
Output 4.21.1. Resource Constrained Schedule: Rule = LST
Gantt Example 21
Resource Constrained Schedule: Rule = LST
e S E L
n e S _ E _ L _ R D S
g n _ F _ F _ F _ E U
i g S I S I S I D L P
t h d t n c T N T N T N E A P
O a e a a e o A I A I A I L Y L
b i a y s e s R S R S R S A _ _
s l d s k r t T H T H T H Y R R
1 1 2 5 Approve Plan 2 400 01DEC03 05DEC03 01DEC03 05DEC03 01DEC03 05DEC03 0
2 2 3 10 Drawings 1 200 08DEC03 19DEC03 08DEC03 19DEC03 08DEC03 19DEC03 0
3 2 4 5 Anal. Market 1 200 15DEC03 19DEC03 08DEC03 12DEC03 21JAN04 27JAN04 5 engineer
4 2 3 5 Write Specs 2 400 08DEC03 12DEC03 08DEC03 12DEC03 15DEC03 19DEC03 0
5 3 5 15 Prototype 4 800 26DEC03 16JAN04 22DEC03 13JAN04 22DEC03 13JAN04 3 engineer
6 4 6 10 Mkt. Strat. . . 22DEC03 06JAN04 15DEC03 29DEC03 28JAN04 10FEB04 0
7 5 7 10 Materials . . 19JAN04 30JAN04 14JAN04 27JAN04 14JAN04 27JAN04 0
8 5 7 10 Facility 2 400 19JAN04 30JAN04 14JAN04 27JAN04 14JAN04 27JAN04 0
9 7 8 10 Init. Prod. 4 800 02FEB04 13FEB04 28JAN04 10FEB04 28JAN04 10FEB04 0
10 8 9 10 Evaluate 1 200 16FEB04 27FEB04 11FEB04 24FEB04 18FEB04 02MAR04 0
11 6 9 15 Test Market . . 16FEB04 05MAR04 11FEB04 02MAR04 11FEB04 02MAR04 0
12 9 10 5 Changes 2 400 08MAR04 12MAR04 03MAR04 09MAR04 03MAR04 09MAR04 0
13 10 11 0 Production 4 800 15MAR04 15MAR04 10MAR04 10MAR04 10MAR04 10MAR04 0
14 6 12 0 Marketing . . 16FEB04 16FEB04 11FEB04 11FEB04 10MAR04 10MAR04 0
15 8 6 0 Dummy . . 16FEB04 16FEB04 11FEB04 11FEB04 11FEB04 11FEB04 0
title c=black f=swiss Gantt Example 21;
title2 c=black f=swiss
Displaying Resource Requirements;
* set background to white and text to black;
goptions ctext=black cback=white ftext=swiss border;
* set vpos to 50 and hpos to 100;
goptions vpos=50 hpos=100;
* begin annotate process;
* compile annotate macros;
%annomac;
* create Annotate data set for first chart;
data anno1;
%dclanno; /* set length and type for annotate vars */
%system(2,2,4); /* define annotate reference system */
set widgsch2;
length lab $20;
length text $ 37;
Y1 = _n_;
lab= ;
if _n_=1 then do;
%label(01dec03d,13,
Format: Engineers per day, Total cost,
*,0,0,1.2,brush,6);
end;
554

Chapter 4. The GANTT Procedure
if engineer ^= . then do;
/* create a text label */
lab = put(engineer, 1.) || " Engineer";
if engineer > 1 then lab = trim(lab) || "s";
if days > 0 then lab = trim(lab) || ", " ||
put(engcost*days, dollar7.);
/* position the text label */
if y1 < 10 then do;
x1 = max(l_finish, s_finish) + 2;
%label(x1,y1,lab,black,0,0,1.0,brush, 6);
end;
else do;
x1 = e_start - 2;
%label(x1,y1,lab,black,0,0,1.0,brush, 4);
end;
end;
run;
* annotate the Gantt chart;
proc gantt data=widgsch2 holidata=holdata
annotate=anno1;
chart / holiday=(hol) interval=weekday increment=7
ref=1dec03d to 21mar04d by week
cref=blue lref=2
dur=days cmile=black caxis=black
compress ;
id task;
run;
Example 4.21. Using the SAS/GRAPH ANNOTATE= Option

555
Output 4.21.2. Using the ANNOTATE= Option
The next illustration of the ANNOTATE= option is to plot the resource usage bar
chart for the replenishable resource engineers and the resource availability curve for
the consumable resource cost. A DATA step determines the largest value of the cost
availability throughout the life of the project in order to scale the costs accordingly.
The CSCALE macro variable is required to represent cost availabilities on the Gantt
chart. Since there are no further cash inows after December 1, 2003, and there
are 15 jobs represented on the chart, the value of the macro variable CSCALE is
(15 1)/40000.
An Annotate data set, ANNO2, is created in much the same fashion as ANNO1, but
it employs some additional macros. The BAR macro is used to draw the resource
usage bar chart, and the DRAW and MOVE macros are used to draw the resource
availability curve. The PUSH and POP macros are used as necessary to store and
retrieve the last used coordinates from the stack, respectively. The resulting Gantt
chart is displayed in Output 4.21.3.
556

Chapter 4. The GANTT Procedure
title2 c=black f=swiss
Plotting Resource Usage and Resource Availability;
* calculate scaling factor for cost curve;
data _null_;
set widgrou2 end=final;
retain maxcost;
if aengcost > maxcost then maxcost=aengcost;
if final then call symput(cscale, 14/maxcost);
run;
* create Annotate data set for second chart;
data anno2;
%dclanno; /* set length and type for annotate vars */
%system(2,2,4); /* define annotate reference system */
set widgrou2;
length lab $16;
length text $27;
x1=_time_;
y1=15-aengcost*symget(cscale);
y2=15-rengieer;
lab= ;
if _n_=1 then do;
/* print labels */
do i = 1 to 14 by 1;
lab=put( (15-i) / symget(cscale), dollar7.);
%label(21mar04d,i,lab,black,0,0,1.0,swiss,4);
end;
do i = 0 to 4 by 1;
lab=put(i,1. );
%label(01dec03d,15-i,lab,black,0,0,1.0,swiss,6);
end;
%label(01dec03d,10,Resource Usage: Engineers,
*,0,0,1.2,swiss,6);
%label(02jan04d,4,Resource Availability: Cost,
*,0,0,1.2,swiss,6);
%move(x1,y1);
%push;
end;
else do;
/* draw cost availability curve */
%pop;
when=a;
%draw(x1,y1,black,1,2);
%push;
/* draw engineer usage barchart */
when=b;
if y2 <= 14 then do;
%bar(x1,15,x1+1,y2,blue,0,l1);
end;
end;
run;
Example 4.22. Using the Automatic Text Annotation Feature

557
* annotate the Gantt chart;
proc gantt data=widgsch2 holidata=holdata
annotate=anno2;
chart / holiday=(hol) interval=weekday increment=7
mindate=1dec03d maxdate=21mar04d
ref=1dec03d to 21mar04d by week
cref=blue lref=2
dur=days cmile=black caxis=black
compress;
id task;
run;
Output 4.21.3. Using the ANNOTATE= Option
Example 4.22. Using the Automatic Text Annotation Feature
The following example is a subproject of a larger project involving the the main-
tenance of a pipeline and steam calender (Moder, Phillips, and Davis 1983), and
it illustrates the automatic text annotation feature of the GANTT procedure. The
SHUTDOWN data set is input as the activity data set to PROC CPM, and the project
is scheduled to begin on June 1, 2004. PROC GANTT is used to produce a Gantt
chart of the resulting schedule with the data set LABELS specied as a Label data
set; the output is shown in Output 4.22.1. The LABVAR= option in the CHART state-
ment species the ACT variable as the common linking variable. The LABSPLIT=
option is specied in order to prevent the labels from splitting on embedded blanks.
558

Chapter 4. The GANTT Procedure
The rst observation in the LABELS data set causes the value of the ACT variable
to be displayed at the E

START time for every activity in the project. The value of

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=

PATTERN specication establishes the link between the Schedule


and Label data sets. The ACT= and SUCC= options are used to display the prece-
dence relationships between activities.
pattern1 c=black v=r1; /* Non-critical duration */
pattern2 c=black v=e; /* Slack duration */
pattern3 c=black v=x1; /* Critical duration */
pattern4 c=black v=s; /* Project duration */
data lanact;
format act $30. succ $30. parent $20.;
input act & succ & parent & days;
datalines;
Measure Current Volume Forecast Future Volume NEEDS ASSESSMENT 2
Literature Survey Manufacturer Demos MARKET SURVEY 5
Determine Current Users Forecast Future Needs NEEDS ASSESSMENT 2
Forecast Future Volume Prepare Network Spec NEEDS ASSESSMENT 2
Manufacturer Demos Identify Vendors MARKET SURVEY 5
Forecast Future Needs Prepare Network Spec NEEDS ASSESSMENT 2
Identify Vendors . MARKET SURVEY 2
Prepare Network Spec . NEEDS ASSESSMENT 2
Prepare RFQ Evaluate Vendor Responses VENDOR SELECTION 4
Prepare Cable Plan Procure Cable SITE PREPARATION 4
Evaluate Vendor Responses Notify Final Candidate VENDOR SELECTION 15
Procure Cable Install Cable SITE PREPARATION 22
Notify Final Candidate Negotiate Price/Config VENDOR SELECTION 1
Install Cable . SITE PREPARATION 10
Negotiate Price/Config Prepare Purchase Order VENDOR SELECTION 3
Prepare Purchase Order . VENDOR SELECTION 1
Server Functional Spec Server Detail Design SPECIAL HARDWARE 5
Procure LAN Hardware Receive Network Hardware NETWORK INSTALLATION 25
Server Detail Design Server Coding SPECIAL HARDWARE 10
Example 4.23. Multiproject Gantt Charts

561
Receive Network Hardware Install LAN Hardware NETWORK INSTALLATION 4
Server Coding Test Server Code SPECIAL HARDWARE 10
Install LAN Hardware Test Network NETWORK INSTALLATION 7
Test Server Code Install/Integrate Server SPECIAL HARDWARE 5
Test Network . NETWORK INSTALLATION 5
Install/Integrate Server . SPECIAL HARDWARE 2
BEGIN PROCUREMENT NEEDS ASSESSMENT . .
BEGIN PROCUREMENT MARKET SURVEY . .
NEEDS ASSESSMENT VENDOR SELECTION . .
NEEDS ASSESSMENT SITE PREPARATION . .
MARKET SURVEY Prepare Network Spec . .
VENDOR SELECTION NETWORK INSTALLATION . .
VENDOR SELECTION SPECIAL HARDWARE . .
SITE PREPARATION Install LAN Hardware . .
NETWORK INSTALLATION NETWORK AVAILABLE . .
SPECIAL HARDWARE NETWORK AVAILABLE . .
;
proc sort data=lanact;
by act;
run;
proc cpm data=lanact out=lanout
expand interval=workday date=03nov03d;
parent parent / wbs eso;
activity act;
duration days;
successor succ;
run;
/* create the schedule data set with a pattern variable */
data sched;
label wbs_code= WBS;
label act=Project/Activity;
set lanout;
if proj_lev !0 then do;
if parent= then _pattern=4;
actid=act;
do i=1 to proj_lev-1; /* indent the id values */
actid = " " || actid;
end;
output;
end;
;
proc sort data=sched;
by es_asc wbs_code;
run;
562

Chapter 4. The GANTT Procedure
/* create the label data set */
data labels;
_pattern=4;
_flabel=orfont;
_jlabel=c;
_yoffset=0.925;
_label=Z;
_xvar=e_start ;
output;
_xvar=l_finish;
output;
;
title1 f=swiss Gantt Example 23;
title2 f=swiss Displaying Summary Bars For Each Subproject;
proc gantt data=sched labdata=labels;
id actid wbs_code;
chart / pcompress nojobnum increment=7 scale=1.5
ctext=black caxis=black font=swiss
mindate=01nov03d maxdate=29feb04d
labvar=_pattern
minoffgv=1.5 minofflv=1.5 cprec=black wprec=3
act=act succ=succ;
run;
Output 4.23.1. Using the PATTERN Variable and Labels
Example 4.24. Multisegment Gantt Charts

563
Example 4.24. Multisegment Gantt Charts
The following is a simple example that illustrates the generation of multisegmented
Gantt charts. The SCHED data set identies the city, the arrival time, and the depar-
ture time for each of four traveling salespeople. In addition, a

PATTERN variable
is used to identify the pattern to be used for drawing the bar. The objective is to dis-
play the complete schedule for each sales person on a single row. This would require
displaying several bars on a single row, each bar corresponding to the time spent in
a city. In order to do this, you need rst to sort the SCHED data set by Salesperson
and Arrival Time and then to add a SEGMT

NO variable that identies the number


of the segment that, in this case, is the order in which the salesperson visits the city.
The resulting data set, NEWSCHED, is shown in Output 4.24.1. You next create
the LABELS data set in order to identify the names of the cities above the bars; the
resulting Gantt chart is shown in Output 4.24.2.
Notice that each bar is drawn using the pattern identied by the

PATTERN variable
in the SCHED data set. In the absence of the

PATTERN variable, the pattern
associated with the resource-constrained schedule would have been used for all the
bars. This is the same mechanism that produced the split segments in Example 4.13
although the SEGMT

NO variable in this case was automatically created by the


CPM procedure.
title1 Gantt Example 24;
title2 f=swiss Schedule of Cities Visited by Salesperson;
data sched;
format city $12. from to date7. ;
input person $ city & from & date7. to & date7. _pattern;
datalines;
Clark New York 01May04 03May04 10
Clark Boston 06May04 09May04 11
Clark Wisconsin 12May04 15May04 12
Clark Chicago 18May04 24May04 13
Clark New York 28May04 02Jun04 10
Stevens Charlotte 02May04 04May04 14
Stevens Atlanta 08May04 10May04 15
Stevens Dallas 12May04 15May04 16
Stevens Denver 17May04 20May04 17
Stevens Nashville 27May04 02Jun04 18
Stevens Charlotte 04Jun04 06Jun04 14
Jackson Los Angeles 01May04 08May04 19
Jackson Las Vegas 11May04 18May04 20
Jackson Portland 21May04 23May04 21
Jackson Seattle 25May04 29May04 22
Rogers Miami 02May04 07May04 23
Rogers Tampa 11May04 15May04 24
Rogers New Orleans 18May04 24May04 25
Rogers Houston 28May04 01Jun04 26
;
/* Sort data by person, from */
proc sort data=sched;
by person from;
run;
564

Chapter 4. The GANTT Procedure
/* Add Segmt_no variable */
data newsched;
set sched;
retain segmt_no;
if person ne lag(person) then segmt_no=1;
else segmt_no = segmt_no + 1;
output;
run;
proc print data=sched;
run;
data labels;
_y=-1;
_lvar="city";
_xvar="from";
_flabel="swiss";
_hlabel=0.75;
_yoffset = -.2;
run;
pattern1 v=s r=25;
proc gantt data=newsched labdata=labels;
id person;
chart / ss=from sf=to compress labsplit=. scale=2
nolegend nojobnum skip=3 font=swiss
ref=01may04d to 30jun04d by week;
run;
Output 4.24.1. NEWSCHED Data Set
Data NEWSCHED
Obs person city from to _pattern segmt_no
1 Clark New York 01MAY04 03MAY04 10 1
2 Clark Boston 06MAY04 09MAY04 11 2
3 Clark Wisconsin 12MAY04 15MAY04 12 3
4 Clark Chicago 18MAY04 24MAY04 13 4
5 Clark New York 28MAY04 02JUN04 10 5
6 Jackson Los Angeles 01MAY04 08MAY04 19 1
7 Jackson Las Vegas 11MAY04 18MAY04 20 2
8 Jackson Portland 21MAY04 23MAY04 21 3
9 Jackson Seattle 25MAY04 29MAY04 22 4
10 Rogers Miami 02MAY04 07MAY04 23 1
11 Rogers Tampa 11MAY04 15MAY04 24 2
12 Rogers New Orleans 18MAY04 24MAY04 25 3
13 Rogers Houston 28MAY04 01JUN04 26 4
14 Stevens Charlotte 02MAY04 04MAY04 14 1
15 Stevens Atlanta 08MAY04 10MAY04 15 2
16 Stevens Dallas 12MAY04 15MAY04 16 3
17 Stevens Denver 17MAY04 20MAY04 17 4
18 Stevens Nashville 27MAY04 02JUN04 18 5
19 Stevens Charlotte 04JUN04 06JUN04 14 6
Example 4.25. Zoned Gantt Charts

565
Output 4.24.2. Multisegment Gantt Chart
Example 4.25. Zoned Gantt Charts
Example 4.15 illustrated the use of BY processing with the GANTT procedure to
present separate Gantt charts for each department. Alternatively, you can use a zoned
Gantt chart to display each of the departmental schedules on the same chart with the
different department schedules separated by horizontal zone lines running across the
chart. The ZONE variable divides the Activity axis into distinct zones. Activities with
the same value of the ZONE variable belong to the same zone. This example produces
a zoned Gantt chart using the schedule data from Example 4.15. The ZONE=DEPT
specication in the CHART statement identies the DEPT variable as the ZONE
variable. The ONEZONEVAL option species that the value of the ZONE variable
be displayed only when beginning new zones. The resulting Gantt chart is shown in
Output 4.25.1. You can customize the color, style and width of the zone line by using
the CZONE=, LZONE=, and WZONE= options, respectively. You can also control
the span and offset of the zone line by specifying the ZONESPAN= and ZONEOFF=
options, respectively, in the CHART statement.
title1 Gantt Example 25;
proc cpm date=01dec03d data=widgetn;
activity task;
duration days;
successor succ1 succ2 succ3;
id dept;
run;
566

Chapter 4. The GANTT Procedure
proc sort;
by dept e_start;
run;
title2 f=swiss Zoned Gantt Chart;
proc gantt split=/;
chart / pcompress scale=1 dur=days
mindate=01dec03d maxdate=11feb04d
font=swiss
zone=dept onezoneval;
id task;
run;
Output 4.25.1. Gantt Charts Zoned by Department
Example 4.26. Web-Enabled Gantt Charts
This example illustrates the process of Web-enabling your Gantt charts. This fea-
ture enables you to associate a URL with each activity on a Gantt chart. By using
this feature together with SAS/IntrNet software, you can develop some very power-
ful Project Management applications. SAS/IntrNet software provides you with the
capability to perform data set queries and execute SAS applications in real time and
view the results in HTML format using a Web browser.
This example takes advantage of the Output Delivery System (ODS) HTML state-
ment to create a very simple drill-down Gantt application beginning from a sum-
mary Gantt chart of the top level projects in Example 4.23. The objective is to
Example 4.26. Web-Enabled Gantt Charts

567
display a detailed Gantt chart of the activities in a subproject when you click on the
subproject bar.
In order to be able to click on an activity and invoke an action, you need to add
variables to the schedule data set that associate a URL with each of the activities that
you want linked. The following code adds the WEBVAR and WEBVAR2 variables
to the LANOUT data set in Example 4.23 to create the LANWEB data set. The
WEBVAR variable uses the ALT= portion to identify information about an activitys
schedule that is to be displayed when the mouse hovers over the schedule bar. In
addition, it uses the HREF= portion to associate the URL with the linked activity.
The WEBVAR2 variable uses only the ALT= portion, so information in the detailed
Gantt chart can still be displayed by hovering over the schedule bars.
The LANWEB data set is then sorted by the WBS

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

CODE=0.2, you link to an anchor labeled 0.2 in the body le


Gantt

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

Sum.html#0.4, which is shown in Output 4.26.2.


Example 4.26. Web-Enabled Gantt Charts

571
Output 4.26.2. Detail Gantt Chart for SITE PREPARATION
Similarly, the detail Gantt chart that is displayed when you click on the SPECIAL
HARDWARE summary bar is shown in Output 4.26.3.
572

Chapter 4. The GANTT Procedure
Output 4.26.3. Detail Gantt Chart for SPECIAL HARDWARE
Example 4.27. Using the CHARTWIDTH= Option

573
Example 4.27. Using the CHARTWIDTH= Option
This example illustrates the use of the CHARTWIDTH= option to create Gantt charts
that are consistent in appearance. The data set used in this example is the SAVE data
set created in Example 4.6.
Gantt charts are rst produced using different values of the MINDATE= option,
and without specifying the CHARTWIDTH= option. Output 4.27.1 shows a Gantt
chart using MINDATE=1jan04, and Output 4.27.2 shows a Gantt chart using
MINDATE=1oct03. Notice that the chart in Output 4.27.2 has a much larger chart
area than the chart in Output 4.27.1, and the Activity Description column is com-
pressed and rather difcult to read.
title f=swiss Gantt Example 27;
* plot the schedule with MINDATE=1jan04;
title2 f=swiss MINDATE=1jan04;
proc gantt data=save;
chart / mindate=1jan04d maxdate=1feb04d
dur=days nojobnum compress fill
ref=2jan04d to 2feb04d by week
reflabel font=swiss;
id descrpt;
run;
* plot the schedule with MINDATE=1oct03;
title2 f=swiss MINDATE=1oct03;
proc gantt data=save;
chart / mindate=1oct03d maxdate=1feb04d
dur=days nojobnum compress fill
ref=2oct03d to 2feb04d by week
reflabel font=swiss;
id descrpt;
run;
574

Chapter 4. The GANTT Procedure
Output 4.27.1. Without the CHARTWIDTH= Option (MINDATE=1Jan04)
Output 4.27.2. Without the CHARTWIDTH= Option (MINDATE=1Oct03)
Example 4.27. Using the CHARTWIDTH= Option

575
The same charts are now plotted with the CHARTWIDTH= option. The specication
CHARTWIDTH=75 indicates that the chart is rescaled so the axis area is 75% of
the chart width and the text area is 25% of the chart width. Therefore, specifying
CHARTWIDTH=75 for both charts gives the two charts a consistent appearance.
The output is shown in Output 4.27.3 and Output 4.27.4.
title f=swiss Gantt Example 27;
* plot the schedule with MINDATE=1jan04 and CHARTWIDTH=75;
title2 f=swiss MINDATE=1jan04, CHARTWIDTH=75;
proc gantt data=save;
chart / mindate=1jan04d maxdate=1feb04d
dur=days nojobnum compress fill
ref=2jan04d to 2feb04d by week
reflabel font=swiss chartwidth=75;
id descrpt;
run;
* plot the schedule with MINDATE=1oct03 and CHARTWIDTH=75;
title2 f=swiss MINDATE=1oct03, CHARTWIDTH=75;
proc gantt data=save;
chart / mindate=1oct03d maxdate=1feb04d
dur=days nojobnum compress fill
ref=2oct03d to 2feb04d by week
reflabel font=swiss chartwidth=75;
id descrpt;
run;
576

Chapter 4. The GANTT Procedure
Output 4.27.3. Using the CHARTWIDTH= Option (MINDATE=1Jan04)
Output 4.27.4. Using the CHARTWIDTH= Option (MINDATE=1Oct03)
Statement and Option Cross-Reference Tables

577
Statement and Option Cross-Reference Tables
The next two tables reference the statements and options in the GANTT procedure
that are illustrated by the examples in this section.
Table 4.30. Options Specied in Examples 4.14.14
Option 1 2 3 4 5 6 7 8 9 10 11 12 13 14
A

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

, this specication is ignored; other-


wise, this option is required.
ALIGN=variable
species the variable in the Network data set containing the time values to be used
for positioning each activity. This options triggers the TIMESCALE option that adds
a time axis at the top of the network and aligns the nodes of the network according
to the values of the ALIGN= variable. The minimum and maximum values of this
variable are used to determine the time axis. The format of this variable is used to de-
termine the default value of the MININTERVAL= option, which, in turn, determines
the format of the time axis.
AUTOREF
draws reference lines at every tick mark. This option is valid only for time-scaled
network diagrams.
596

Chapter 5. The NETDRAW Procedure
AUTOZONE
enables automatic zoning (or dividing) of the network into connected components.
This option is equivalent to dening an automatic zone variable that associates a
tree number for each node. The tree number refers to a number assigned (by the
procedure) to each distinct tree of a spanning tree of the network.
BREAKCYCLE
breaks cycles by reversing the back arcs of the network. The back arcs are determined
by constructing an underlying spanning tree of the network. Once cycles are broken,
the nodes of the network are laid out using a topological ordering of the new network
formed from the original network by ignoring the back arcs. The back arcs are drawn
after determining the network layout. Note that only the back arcs go from right to
left.
BOXHT=boxht
species the height of the box (in character cell positions) used for denoting a node.
If this option is not specied, the height of the box equals the number of lines re-
quired for displaying all of the ID variable values for any of the nodes. See the
ROTATETEXT option (under Graphics Options) for an exception.
BOXWIDTH=boxwdth
species the width of the box (in character cell positions) used for denoting a node.
If this option is not specied, the width of the box equals the maximum number of
columns required for displaying all of the ID variable values for any of the nodes.
See the ROTATETEXT option (under Graphics Options) for an exception.
CENTERSUBTREE
positions each node at the center of the subtree that originates from that node instead
of placing it at the midpoint of its children (which is the default behavior). Note that
the nodes are placed at integral positions along an imaginary grid, so the positioning
may not be exactly at the center. This option is valid only in conjunction with the
TREE option.
CHILDORDER=order
orders the children of each node when the network is laid out using either the TREE
or the SPANNINGTREE option. The valid values for this option are TOPDOWN and
BOTTOMUP for default orientation, and LEFTRGHT and RGHTLEFT for rotated
networks (drawn with the ROTATETEXT option). The default is TOPDOWN.
DP
causes PROC NETDRAW to use a dynamic programming (DP) algorithm to route
the arcs. This DP algorithm is memory and CPU-intensive and is not necessary for
most applications.
DURATION=variable
species a variable that contains the duration of each activity in the network. This
value is used only for displaying the durations of each activity within the node.
ACTNET Statement

597
FRAME
encloses the drawing area with a border. This option is valid only for time-scaled or
zoned network diagrams.
HTRACKS=integer
controls the number of arcs that are drawn horizontally through the space between
two adjacent nodes. This option enables you to control the arc-routing algorithm.
The default value is based on the maximum number of successors of any node.
ID=(variables)
species the variables in the Network data set that are displayed within each node.
In addition to the ID variables, the procedure displays the ACTIVITY variable, the
DURATION variable (if the DURATION= option was specied), and any of the
following variables in the Network data set: E

START, E

FINISH, L

START,
L

FINISH, S

START, S

FINISH, A

START, A

FINISH, T

FLOAT, and
F

FLOAT. See Chapter 2, The CPM Procedure, for a description of these


variables. If you specify the NODEFID option, only the variables listed in the ID=
option are displayed.
LAG=variable
LAG=(variables)
species the variables in the Network data set that identify the lag types of the prece-
dence relationships between an activity and its successors. Each SUCCESSOR vari-
able is matched with the corresponding LAG variable; that is, for a given observation,
the ith LAG variable denes 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, or
FF, which denote Finish-to-Start, Start-to-Start, Start-to-Finish, and Finish-to-
Finish, respectively. You can also use the keyword

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

) node. This is the default option.


To prevent the use of potential node positions, use the NONODETRACK option.
NOLABEL
suppresses the labels. By default, the procedure uses the rst three letters of the
variable name to label all the variables that are displayed within each node of the
network. The only exception is the variable that is identied by the ACTIVITY=
option.
NONDP
uses a simple heuristic to connect the nodes. The default mode of routing is NONDP,
unless the HTRACKS= or VTRACKS= option (or both) are specied and set to a
number that is less than the maximum number of successors. The NONDP option is
faster than the DP option.
NONODETRACK
blocks the horizontal track along potential node positions. This option may lead to
more turns in some of the arcs. The default is NODETRACK.
NOREPEATAXIS
displays the time axis only on the top of the chart and not on every page. This option
is useful if the different pages are to be glued together to form a complete diagram.
This option is valid only for time-scaled network diagrams.
ACTNET Statement

599
NOTIMEAXIS
suppresses the display of the time axis and its labels. Note that the nodes are still
placed according to the time scale, but no axis is drawn. This option is valid only for
time-scaled network diagrams.
NOZONELABEL
NOZONEDESCR
omits the zone labeling and the dividing lines. The network is still divided into zones
based on the ZONE variable, but there is no demarcation or labeling corresponding
to the zones.
PAGES=npages
species the maximum number of pages to be used for the network diagram in graph-
ics and line-printer modes. The default value is 100.
QUITMISSINGALIGN
stops processing if the ALIGN= variable has any missing values. By default, the
procedure tries to ll in missing values using the topological order of the network.
This option is valid only for time-scaled network diagrams.
REFBREAK
shows breaks in the time axis by drawing a zigzag line down the diagram just before
the tick mark at the break. This option is valid only for time-scaled network diagrams.
RESTRICTSEARCH
RSEARCH
restricts the scope of the arc layout algorithm by restricting the area of search for the
arc layout when the DP option is in effect; this is useful in reducing the computa-
tional complexity of the dynamic programming algorithm. By default, using the DP
algorithm to route the arcs, the y coordinates of the arcs can range through the entire
height of the network. The RESTRICTSEARCH option limits the y coordinates to
the minimum and the maximum of the y coordinates of the node and its immediate
successors.
SEPARATESONS
separates the children (immediate successors) of a given node by adding an extra
space in the center whenever it is needed to enable the node to be positioned at integral
(x, y) coordinates. For example, if a node has two children, placing the parent node
at the midpoint between the two children requires the y coordinate to be noninteger,
which is not allowed in the Layout data set. By default, the procedure positions
the node at the same y level as one of its children. The SEPARATESONS option
separates the two children by adding a dummy child in between, thus enabling the
parent node to be centered with respect to its children. This option is valid only in
conjunction with the TREE option.
SHOWBREAK
shows breaks in the time axis by drawing a jagged break in the time axis line just
before the tick mark corresponding to the break. This option is valid only for time-
scaled network diagrams.
600

Chapter 5. The NETDRAW Procedure
SHOWSTATUS
uses the variable STATUS (if it exists) in the Network data set to determine if an activ-
ity is in-progress or completed. Note that the STATUS variable exists in the Schedule
data set produced by PROC CPM when used with an ACTUAL statement. If there
is no STATUS variable or if the value is missing, the procedure uses the A

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

. At least one SUCCESSOR variable must


be specied if the data set does not contain a variable called

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

FINISH variables (if they are present) in the Network data


set to determine the critical activities. The default value is the value of the CARCS=
option.
602

Chapter 5. The NETDRAW Procedure
CREF=color
species the color of the reference lines. The default value is WHITE. This option is
valid only for time-scaled network diagrams.
CREFBRK=color
species the color of the lines drawn to denote breaks in the time axis. The default
value is WHITE. This option is valid only for time-scaled network diagrams.
FORMCHAR [index list ]=string
species the characters used for node outlines and arcs. See the Line-Printer
Options section on page 608 for a description of this option.
PATTERN=variable
species an integer-valued variable in the Network data set that identies the color
number for each node of the network. If the data set contains a variable called

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

FINISH variables (if they are present) in the Network data


set to determine the critical activities. The default value of this option is the value of
the CARCS= option.
CCRITOUT=color
species the outline color for critical nodes. The default value for this option is the
value of the COUTLINE= option, if it is specied; otherwise, it is the same as the
pattern color for the node.
CENTERID
centers the ID values placed within each node. By default, character valued ID vari-
ables are left justied and numeric ID variables are right justied within each node.
This option centers the ID values within each node.
CNODEFILL=color
species the ll color for all nodes of the network diagram. If you specify this option,
the procedure uses a solid ll pattern with the specied color, ignoring any ll pattern
specied in the PATTERN statements; the PATTERN statements are used only to
obtain the color of the outline for the nodes, unless you specify the COUTLINE=
option.
COMPRESS
draws the network on one physical page. By default, the procedure draws the network
across multiple pages if necessary, using a default scale that allots one character cell
position for each letter within the nodes. Sometimes, to get a broad picture of the
network and all its connections, you may want to view the entire network on one
screen. If the COMPRESS option is specied, PROC NETDRAW determines the
horizontal and vertical transformations needed so that the network is compressed to
t on one screen.
COUTLINE=color
species an outline color for all nodes. By default, the procedure sets the outline
color for each node to be the same as the ll pattern for the node. This option is
useful when used in conjunction with a solid ll using a light color. Note that if an
empty ll pattern is specied, then the COUTLINE= option will cause all nodes to
appear the same.
604

Chapter 5. The NETDRAW Procedure
CREF=color
species the color of the reference lines. If the CREF= option is not specied, the
procedure uses the text color. This option is valid only for time-scaled network dia-
grams.
CREFBRK=color
species the color of the zigzag break lines. If the CREFBRK= option is not specied,
the procedure uses the text color. This option is valid only for time-scaled network
diagrams.
CTEXT=color
CT=color
species the color of all text on the network diagram including variable names or
labels, values of ID variables, and so on. If CTEXT= is omitted, PROC NETDRAW
uses the value specied by the global graphics option CTEXT; if there is no such
specication, then the procedure uses the rst color in the COLORS= list of the
GOPTIONS statement.
DESCRIPTION=string
DES=string
species a descriptive string, up to 40 characters in length, that appears in the descrip-
tion eld of the master menu in PROC GREPLAY. If the DESCRIPTION= option is
omitted, the description eld contains a description assigned by PROC NETDRAW.
FILLPAGES
causes the diagram on each page to be magnied (if necessary) to ll up the page.
FONT=font
species the font of the text. If there is no FONT= specication, PROC NETDRAW
uses the font specied by the global graphics option FTEXT= ; if there is no such
specication, then the procedure uses hardware characters.
HEIGHT=h
HTEXT=h
species that the height for all text in PROC NETDRAW (excluding the titles and
footnotes) be h times the value of the global HTEXT= option, which is the default
text height specied in the GOPTIONS statement of SAS/GRAPH. The value of h
must be a positive real number; the default value is 1.0.
HMARGIN=integer
species the width of a horizontal margin (in number of character cell positions) for
the network in graphics mode. The default width is 1.
HPAGES=h
NXPAGES=h
species that the network diagram is to be produced using h horizontal pages.
However, it may not be possible to use h horizontal pages due to intrinsic constraints
on the output.
For example, PROC NETDRAW requires that every horizontal page should contain
at least one x level. Thus, the number of horizontal pages can never exceed the
number of vertical levels in the network. The exact number of horizontal pages used
ACTNET Statement

605
by the network diagram is given in the

ORNETDR macro variable. See the Macro
Variable

ORNETDR section on page 627 for further details.
The appearance of the diagramwith respect to the HPAGES= option is also inuenced
by the presence of other related procedure options. The HPAGES= option performs
the task of determining the number of vertical pages in the absence of the VPAGES=
option. If the COMPRESS or PCOMPRESS option is specied in this scenario, the
chart uses one vertical page (unless the HPAGES= and VPAGES= options are spec-
ied). If neither the COMPRESS nor PCOMPRESS option is specied, the number
of vertical pages is computed in order to display as much of the chart as possible in a
proportional manner.
LREF=linestyle
species the linestyle (1-46) of the reference lines. The default linestyle is 1, a solid
line. See Figure 4.5 in Chapter 4, The GANTT Procedure, for examples of the var-
ious line styles available. This option is valid only for time-scaled network diagrams.
LREFBRK=linestyle
species the linestyle (1-46) of the zigzag break lines. The default linestyle is 1, a
solid line. See Figure 4.5 in Chapter 4, The GANTT Procedure, for examples of
the various line styles available. This option is valid only for time-scaled network
diagrams.
LWCRIT=integer
species the line width for critical arcs and the node outlines for critical activities. If
the LWCRIT= option is not specied, the procedure uses the value specied for the
LWIDTH= option.
LWIDTH=integer
species the line width of the arcs and node outlines. The default line width is 1.
LWOUTLINE=integer
species the line width of the node outlines. The default line width for the node
outline is equal to LWIDTH for noncritical nodes and LWCRIT for critical nodes.
NAME=string
species a string of up to eight characters that appears in the name eld of the catalog
entry for the graph. The default name is NETDRAW. If either the name specied or
the default name duplicates an existing name in the catalog, then the procedure adds
a number to the duplicate name to create a unique name, for example, NETDRAW2.
NOARROWFILL
draws arrowheads that are not lled. By default, the procedure uses lled arrowheads.
NOPAGENUMBER
NONUMBER
suppresses the page numbers that are displayed in the top right corner of each page
of a multipage network diagram. Note that the pages are ordered from left to right,
bottom to top (unless the REVERSEY option is specied).
606

Chapter 5. The NETDRAW Procedure
NOVCENTER
draws the network diagram just below the titles without centering in the vertical di-
rection.
NXNODES=nx
species the number of nodes that should be displayed horizontally across each page
of the network diagram. This option determines the value of the HPAGES= option;
this computed value of HPAGES overrides the specied value for the HPAGES=
options.
NYNODES=ny
species the number of nodes that should be displayed vertically across each page of
the network diagram. This option determines the value of the VPAGES= option; this
computed value of VPAGES overrides the specied value for the VPAGES= options.
PAGENUMBER
PAGENUM
numbers the pages of the network diagram on the top right-hand corner of the page
if the diagram exceeds one page. The numbering scheme is from left to right, bottom
to top (unless the REVERSEY option is specied).
PATTERN=variable
species an integer-valued variable in the Network data set that identies the pat-
tern for lling each node of the network. If the data set contains a variable called

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

; hence, it is not necessary to spec-


ify the ACTIVITY= and SUCCESSOR= options. See Example 5.13 on page
668 and Example 5.14 on page 672 for illustrations of the use of the Layout
data set.
610

Chapter 5. The NETDRAW Procedure
The minimum information required by PROC NETDRAW from the Network data
set is the variable identifying each node in the network and the variable (or variables)
identifying the immediate successors of each node. In addition, the procedure can
use other optional variables in the data set to enhance the network diagram. The
procedure uses the variables specied in the ID= option to label each node. The
procedure also looks for default variable names in the Network data set that are added
to the list of ID variables; the default variable names are E

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

identifying the x and y


coordinates of each node and each turning point of each arc in the network, then this
information is used by the procedure to draw the network. Otherwise, the precedence
relationships among the activities are used to determine the layout of the network.
It is possible to specify only the node positions and let the procedure determine the
routing of all the arcs. However, partial information cannot be augmented by the
procedure.
Note: If arc information is provided, the procedure assumes that it is complete and
correct and uses it exactly as specied.
Variables in the Network Data Set
The NETDRAW procedure expects all the network information to be contained in
the Network input data set named by the DATA= option. The network information is
contained in the ACTIVITY and SUCCESSOR variables. In addition, the procedure
uses default variable names in the Network data set for specic purposes. For exam-
ple, the

X

and

Y

variables, if they are present in the Network data set, represent


the coordinates of the nodes, the

SEQ

variable indexes the turning points of each


arc of the network, and so on.
In addition to the network precedence information, the Network data set may also
contain other variables that can be used to change the default layout of the network.
For example, the nodes of the network can be aligned in the horizontal direction
using the ALIGN= specication, or they can be divided into horizontal bands (or
zones) using a ZONE variable.
Table 5.15 lists all of the variables associated with the Network data set and their
interpretations by the NETDRAW procedure. Note that all the variables are identied
to the procedure in the ACTNET statement. Some of the variables use default names
that are recognized by the procedure to denote specic information, as explained
previously. The table indicates if the variable is default or needs to be identied in
the ACTNET statement.
Layout of the Network

611
Table 5.15. Network Data Set and Associated Variables
Statement Variable Name Interpretation
ACTNET ACTIVITY Activity or node name
ALIGN Align variable for time-scaled network
DURATION Duration of activity
ID Additional variables to be displayed
PATTERN Pattern number
SUCCESSOR Immediate successor
WEB HTML page corresponding to activity
ZONE Zone variable for dividing network
Default A

FINISH default ID variable


Variable A

START default ID variable


Names E

FINISH default ID variable


E

START default ID variable


F

FLOAT default ID variable


L

FINISH default ID variable


L

START default ID variable


S

FINISH default ID variable


S

START default ID variable


T

FLOAT default ID variable

FROM

supersedes ACTIVITY= specication

PATTERN supersedes PATTERN= specication

SEQ

index of turning point in arc

TO

supersedes SUCCESSOR= specication

x coordinate of node or arc turning point

y coordinate of node or arc turning point


Missing Values
Missing values are not allowed for the ACTIVITY,

X

,

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

, which replicate the ACTIVITY and SUCCESSOR


variables fromthe Network data set. Note that the Layout data set has only one

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

) pairs of nodes, (C, D) and (C, E).

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) gives the coor-


dinates of the predecessor node; the succeeding observations contain the coordinates
of the turning points of the arc connecting the predecessor node to the successor. The
data set also contains a variable called

PATTERN, which contains the pattern num-
ber that is used for coloring the node identied by the

FROM

variable. The value


of this variable is missing for observations with

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

is assumed to denote the


order of the turning points. This interpretation is consistent with the values assigned
to the

X

,

Y

, and

SEQ

variables in the Layout data set produced by PROC


NETDRAW. If there is no variable called

SEQ

in the data set, the procedure as-


sumes that only the node positions are specied and uses the specied coordinates
to place the nodes and determines the routing of the arcs corresponding to these po-
sitions. If there is a variable called

SEQ

, the procedure requires that the turning


points for each arc be specied in the proper order, with the variable

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

START, in that order. The rst of these variables that is


found is used to align the nodes. The minimum and maximum values of the ALIGN=
variable are used to determine the time axis. The format of this variable is used
to determine the default value for the MININTERVAL= option. The value of the
MININTERVAL= option (or the default value) is used to determine the format of
the time axis. You can override the format based on mininterval by specifying the
desired format for the ALIGN= variable (using the FORMAT statement to indicate a
standard SAS format or a special user-dened format) and the USEFORMAT option
in the ACTNET statement. Table 5.16 lists the valid values of mininterval corre-
sponding to the type of the ALIGN= variable and the default format corresponding
to each value of mininterval. For each value in the rst column, the rst value of
mininterval listed is the default value of the MININTERVAL= option corresponding
to that type of the ALIGN= variable.
Several options are available in PROCNETDRAWto control the spacing of the nodes
and the scaling of a time-scaled network diagram:
The MININTERVAL= option enables you to scale the network diagram: one
tick mark is associated with one unit of mininterval. Thus, if mininterval is
DAY, each column is used to represent one day and all activities that start on
the same day are placed in the same column. By default, the procedure omits
any column (tick mark) that does not contain any node.
The LINEAR option enables you to print a tick mark corresponding to every
day (or the unit of mininterval). Note that, for a project that has few activities
Time-Scaled Network Diagrams

619
spread over a large period of time, the LINEAR option can lead to a network
diagram that is very wide.
The MAXNULLCOLUMN= option species the maximum number of empty
columns that is allowed between two consecutive nonempty columns. The
LINEARoption is equivalent to specifying maxncol = innity, while the default
time-scaled network diagram is drawn with maxncol = 0.
The NLEVELSPERCOLUMN= option enables you to contract the network
diagram by combining a few columns. For example, if mininterval is DAY and
nlevelspercol is 7, each column contains activities that start within seven days
of each other; note that the same effect can be achieved by setting mininterval
to be WEEK.
Table 5.16. MININTERVAL Values and Axis Format
ALIGN Variable Type MININTERVAL Axis Label Format
number numeric format
SAS time HOUR HHMM5.
MINUTE HHMM5.
SECOND TIME8.
SAS date DAY DATE7.
WEEKDAY DATE7.
WEEK DATE7.
MONTH MONYY5.
QTR MONYY5.
YEAR MONYY5.
SAS datetime DTDAY DATE7.
WORKDAY DATE7.
DTWRKDAY DATE7.
DTSECOND DATETIME16.
DTMINUTE DATETIME16.
DTHOUR DATETIME13.
DTWEEK DATE7.
DTMONTH MONYY5.
DTQTR MONYY5.
DTYEAR MONYY5.
The node-placement algorithm described in the Layout of the Network section on
page 611 is modied slightly for time-scaled network diagrams. The x coordinate of
each node is determined by the value of the ALIGN= variable. The scaling options
just described are used to determine the tick mark corresponding to the node. The y
coordinate is determined as before. Once the node placement is completed, the arc
routing algorithm is the same as described earlier.
Note: Since the node placement for time-scaled networks is determined by the
ALIGN= variable, it is possible that some of the arcs between the nodes may have to
620

Chapter 5. The NETDRAW Procedure
be routed from right to left instead of from left to right; in other words, there may be
some backward arcs. Note also that, if the ALIGN= variable is used to determine the
x coordinates of the nodes, the procedure can also draw networks that contain cycles
(see the second part of Example 5.12 on page 663).
Several other options are available to control the appearance of time-scaled network
diagrams: AUTOREF, BRKCHAR=, CAXIS=, CREF=, CREFBRK=, FRAME,
LREF=, LREFBRK=, NOREPEATAXIS, NOTIMEAXIS, REFBREAK,
REFCHAR=, and SHOWBREAK. These options are described in the Syntax
section on page 590.
Zoned Network Diagrams
Most projects have at least one natural classication of the different activities in the
project: department, type of work involved, location of the activity, and so on. The
ZONE= option enables you to divide the network diagram into horizontal bands or
zones corresponding to this classication. The procedure uses the following rules to
place the nodes in a zoned network diagram:
The values of the ZONE variable are used to dene as many zones as there are
distinct values of this variable.
Each node of the network is drawn within its corresponding zone.
The number of rows within each zone is determined by the maximum number
of nodes in any given column that correspond to that zone.
The values of the ZONE variable do not need to be sorted in any particular
order, nor do they need to be grouped by distinct values.
The zones are ordered according to the order of appearance of the different
values of the ZONE variable in the Network data set. This enables you to
choose any order for the zone values.
For arcs that connect two nodes within the same zone, the arc lies entirely
within the zone; in other words, all the turning points of the arc have y co-
ordinates that are between the minimum and maximum y coordinates for the
zone.
Each zone is labeled by the value of the ZONE variable unless the
NOZONELABEL option is specied.
Each zone is separated from the next by a horizontal line drawn across the
width of the network unless the NOZONELABEL option is specied.
In the graphics and full-screen modes of invocation of the procedure, you can
use the ZONEPAT option to color the nodes in each zone differently using
different pattern statements. In the graphics mode, the rst zone uses the rst
PATTERN statement, the second zone uses the second PATTERN statement,
and so on; in full-screen mode, the colors available for the device are repeated
in cyclic order. Note that the values of the PATTERN variable (or the default

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

FINISH variables (if these variables exist in the Network data


set) to determine if activities in the project are normal, critical, or supercritical. The
procedure then uses the rst generated PATTERN denition to ll the nodes cor-
responding to noncritical activities, the second generated PATTERN denition for
nodes corresponding to critical activities, and the third generated PATTERN deni-
tion for nodes corresponding to supercritical activities.
For zoned network diagrams, if there is no PATTERN variable, the ZONEPAT option
enables you to color the nodes based on the values of the ZONE= variable.
Using the Annotate Facility
The Annotate facility enables you to enhance graphics output produced by PROC
NETDRAW. To use this facility, you must create an Annotate data set, which con-
tains a set of graphics commands that can be superimposed on the network diagram.
This data set has a specic format and must contain key variables as described in
SAS/GRAPH Software: Reference. The chapter entitled The Annotate Data Set
lists the variables that are required in this data set and explains the coordinate systems
used by the Annotate facility. The present section explains the use of data coordinates
specically with reference to the NETDRAW procedure.
When annotating a graph produced by any of the graphics procedures, it is helpful
to use data coordinates that refer to the data values corresponding to the graph that
is being annotated. For example, if you want to label a particular node of a network
diagram with additional text, you can position the text accurately if you use data
coordinates instead of screen coordinates. With respect to PROC NETDRAW, the
Annotate facility uses the

X

and

Y

values in the Layout data set as the basis for


the data coordinate system. To use this feature, you can invoke PROC NETDRAW
(with the NODISPLAY option, if necessary) for the given network to produce the
Layout data set that contains the

X

and

Y

coordinates for each node of the


network. This data set can then be used to create the required Annotate data set
containing the graphics commands positioning the primitives appropriately on the
diagram using the data coordinates. See Example 5.16 on page 677 and Example
5.17 on page 681 for illustrations of this feature.
Note: The data coordinate system enables you to annotate the graph even if it spans
multiple pages. However, each annotation must be entirely contained within a given
page. For example, you cannot annotate a line on the network diagram that runs from
one page of the diagram to another.
Web-Enabled Network Diagrams
The WEB variable enables you to dene a HTML reference for each activity.
This HTML reference is associated with the node corresponding to the activity.
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
Macro Variable

ORNETDR

627
NETDRAW statement. By processing this SAS data set using a DATA step, you can
generate customized HTML pages for your network diagram.
Macro Variable

ORNETDR
The NETDRAW procedure denes a macro variable named

ORNETDR. This vari-
able contains a character string that indicates the status of the procedure. It is
set at procedure termination. The form of the

ORNETDR character string is
STATUS= REASON= , where STATUS= is either SUCCESSFUL or ERROR

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

FLOAT variables within


each node. The network is displayed in Output 5.1.2.
proc cpm data=widget out=sched
date=1dec03d;
activity task;
successor succ1 succ2 succ3;
duration days;
run;
options ps=45 ls=90;
title2 Schedule Information;
proc netdraw data=sched lineprinter;
actnet / activity=task
successor=(succ1 succ2 succ3)
duration = days;
run;
Example 5.1. Line-Printer Network Diagram

631
Output 5.1.2. Project Schedule
Widget Manufacture
Schedule Information
-------------------------
|Drawings Dur:10|
-- |ES:06DEC03 EF:15DEC03|--- --
| |LS:06DEC03 LF:15DEC03| | |
| |TF: 0 FF: 0 | | |
| ------------------------- | |
| | |
| | |
| | |--
| | |
| | |
------------------------- | ------------------------- | ------------------------- |
|Approve Plan Dur: 5| | |Write Specs Dur: 5| | |Prototype Dur:15| |
|ES:01DEC03 EF:05DEC03|--+- |ES:06DEC03 EF:10DEC03|---- |ES:16DEC03 EF:30DEC03|--+-
|LS:01DEC03 LF:05DEC03| | |LS:11DEC03 LF:15DEC03| |LS:16DEC03 LF:30DEC03| |
|TF: 0 FF: 0 | | |TF: 5 FF: 5 | |TF: 0 FF: 0 | |
------------------------- | ------------------------- ------------------------- |
| |
| |
| |
| |
| |
| ------------------------- ------------------------- |
| |Anal. Market Dur: 5| |Mkt. Strat. Dur:10| |
-- |ES:06DEC03 EF:10DEC03|---- |ES:11DEC03 EF:20DEC03|-----
|LS:05JAN04 LF:09JAN04| |LS:10JAN04 LF:19JAN04|
|TF:30 FF: 0 | |TF:30 FF:30 |
------------------------- -------------------------
632

Chapter 5. The NETDRAW Procedure
Widget Manufacture
Schedule Information
------------------------- -------------------------
|Materials Dur:10| |Test Market Dur:15|
|ES:31DEC03 EF:09JAN04|--- -- |ES:20JAN04 EF:03FEB04|---
|LS:31DEC03 LF:09JAN04| | | |LS:20JAN04 LF:03FEB04| |
|TF: 0 FF: 0 | | | |TF: 0 FF: 0 | |
------------------------- | | ------------------------- |
| | |
| | |
---------------------------+-----------------------------| |
| | |
| | |
------------------------- | ------------------------- | ------------------------- |
|Facility Dur:10| | |Init. Prod. Dur:10| | |Evaluate Dur:10| |
|ES:31DEC03 EF:09JAN04|---- |ES:10JAN04 EF:19JAN04|--+- |ES:20JAN04 EF:29JAN04|----
|LS:31DEC03 LF:09JAN04| |LS:10JAN04 LF:19JAN04| | |LS:25JAN04 LF:03FEB04|
|TF: 0 FF: 0 | |TF: 0 FF: 0 | | |TF: 5 FF: 5 |
------------------------- ------------------------- | -------------------------
|
|
|
|
|
| -------------------------
| |Marketing Dur: 0|
----------------------------------------------------------- |ES:20JAN04 EF:20JAN04|
|LS:09FEB04 LF:09FEB04|
|TF:20 FF:20 |
-------------------------
Widget Manufacture
Schedule Information
------------------------- -------------------------
|Changes Dur: 5| |Production Dur: 0|
|ES:04FEB04 EF:08FEB04|---- |ES:09FEB04 EF:09FEB04|
|LS:04FEB04 LF:08FEB04| |LS:09FEB04 LF:09FEB04|
|TF: 0 FF: 0 | |TF: 0 FF: 0 |
------------------------- -------------------------
Example 5.2. Graphics Version of PROC NETDRAW

633
Example 5.2. Graphics Version of PROC NETDRAW
The same network used in Example 5.1 is drawn here with the GRAPHICS option
(which is also the default mode of output for the NETDRAW procedure). In this
example, the network is drawn before scheduling the project with PROC CPM. The
global options HPOS= and VPOS= are set to 100 and 70, respectively. These op-
tions control the number of character cell positions on the screen. The network is
displayed in Output 5.2.1. Note that all the nodes are the same color as specied by
the PATTERN statement, the color of the arcs is blue as specied by the CARCS=
option, the width of all lines is 3 as specied by the LWIDTH= option, and the font
used for the text is SWISS as specied by the FONT= option.
goptions hpos=100 vpos=70 border;
pattern1 c=green v=e;
title h=3 j=l f=swiss Project: Widget Manufacture;
proc netdraw data=widget graphics;
actnet / act=task
succ=(succ1 succ2 succ3)
carcs=blue
font=swiss;
run;
Output 5.2.1. Project Network
634

Chapter 5. The NETDRAW Procedure
Example 5.3. Spanning Multiple Pages
In this example, the Schedule data set produced by PROC CPM is displayed in a
graphics network. As in the second part of Example 5.1, the procedure displays the
duration as well as the early and late start and nish times and the total oat and free
oat of each activity in the node corresponding to that activity. The network cannot
t on one page and is drawn across three pages, as shown in Output 5.3.1.
This example also illustrates several options for controlling the appearance of the net-
work diagram. The pattern statements set a background ll color for all the nodes of
the network (PATTERN1 and PATTERN2). The COUTLINE= and CCRITOUT= op-
tions set the outline colors for noncritical and critical activities, respectively. Recall
that the procedure uses the values of the E

FINISH and L

FINISH variables to de-


termine if an activity is critical. The CARCS= and CCRITARCS= options color the
regular arcs blue and the critical arcs (arcs connecting critical activities) red, respec-
tively. The CTEXT= options sets the color of the text to blue, while the FONT=
option uses the Swiss font for all text. Finally, the LWIDTH= option sets the default
width for all the lines in the network, and the LWCRIT= option further highlights the
critical arcs by drawing them with thicker lines.
In this invocation of PROC NETDRAW, the SEPARATEARCS option is used so that
the two parallel arcs leading into the activity Test Market (one from Mkt.Strat.
and the other from Init. Prod.) are drawn along separate tracks instead of along a
single track as in Example 5.2.
goptions hpos=80 vpos=50 border;
pattern1 c=ltgray v=s;
pattern2 c=ltgray v=s;
title c=blue j=l f=swiss h=1.5
Project: Widget Manufacture;
title2 c=blue f=swiss j=l h=1.5 Schedule Information;
footnote c=blue f=swiss j=r Spanning Multiple Pages ;
proc netdraw data=sched graphics;
actnet / act=task
succ=(succ1 succ2 succ3)
dur = days
coutline=blue
ccritout=red
carcs=blue
ccritarcs=red
ctext=blue
lwidth=1
lwcrit=2
separatearcs
font=swiss;
run;
Example 5.3. Spanning Multiple Pages

635
Output 5.3.1. Project Schedule
636

Chapter 5. The NETDRAW Procedure
Example 5.4. The COMPRESS and PCOMPRESS Options
In Example 5.2, the number of character cell positions were specied so that the entire
network t on one page; in Example 5.3, the network spanned several pages. To force
the network diagram to t on one page automatically, you can use the COMPRESS or
PCOMPRESS options. Both options use window transformations to t the network
on one page: the COMPRESS option treats the horizontal and vertical transforma-
tions independently of each other so that one direction may not be as compressed as
the other; the PCOMPRESS option uses a proportional transformation so that each
direction is compressed as much as the other. The following two invocations of PROC
NETDRAW illustrate the differences in the diagrams produced.
In both network diagrams, PATTERN statements are used to color the nodes red or
green, depending on whether the activities they represent are critical or not. The rst
PATTERN statement is for nodes corresponding to noncritical activities, and the sec-
ond statement is for critical activities. The second invocation of PROC NETDRAW
also uses the NOVCENTER option in the ACTNET statement to turn off centering in
the vertical direction, so that the network is drawn immediately below the titles.
Example 5.4. The COMPRESS and PCOMPRESS Options

637
goptions hpos=100 vpos=65 border;
title j=l f=swiss h=3 Project: Widget Manufacture;
title2 j=l f=swiss h=2 Schedule Information;
footnote f=swiss j=r h=1.5 COMPRESS Option ;
proc netdraw data=sched graphics;
actnet / act=task
succ=(succ1 succ2 succ3)
dur = days
carcs=blue ccritarcs=red
font=swiss
separatearcs
compress;
run;
footnote f=swiss j=r h=1.5 PCOMPRESS Option ;
proc netdraw data=sched graphics;
actnet / act=task
succ=(succ1 succ2 succ3)
dur = days
carcs=blue ccritarcs=red
font=swiss
separatearcs
pcompress
novcenter;
run;
638

Chapter 5. The NETDRAW Procedure
Output 5.4.1. Project Network: COMPRESS Option
Example 5.4. The COMPRESS and PCOMPRESS Options

639
Output 5.4.2. Project Network: PCOMPRESS Option
640

Chapter 5. The NETDRAW Procedure
Example 5.5. Controlling the Display Format
In addition to the COMPRESS and PCOMPRESS options and the HPOS= and
VPOS= global options, you can control the amount of information displayed on a
single page by
turning off the default ID variable selection (using the NODEFID option) and
using the ID= option to select only a few variables of interest in the Network
data set
setting the dimensions of each node using the BOXWIDTH= and the BOXHT=
options
specifying the horizontal and vertical distances between nodes using the
XBETWEEN= and YBETWEEN= options, respectively
This example uses the data fromExample 4.1 in Chapter 4, The GANTT Procedure,
and some of the options just mentioned to produce the network diagram shown in
Output 5.5.1. The ID= and NODEFID options are used to display only the activ-
ity name and duration values within each node. The NOLABEL option suppresses
the display of the variable names within each node. Some of the activity names are
truncated by the BOXWIDTH= option. Even with the restrictions imposed, the net-
work is too large to t on one page and spans two pages. Note that on devices with
higher resolution, you can increase the values of HPOS and VPOS (still maintaining
readability) to enable more of the network to be drawn on one page.
data ex ;
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 . .
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 . .
Example 5.5. Controlling the Display Format

641
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 . . .
finished 0 . . . .
;
proc cpm finishbefore date=1jan04d out=sched;
activity activity;
duration dur;
successors success1-success4;
run;
proc sort;
by e_start;
run;
goptions hpos=130 vpos=75 border;
title f=swiss j=l h=3 Site: Multi-Story Building
j=r Date: January 1, 2004;
footnote f=swiss j=r h=2 Controlling Display Format ;
proc netdraw data=sched graphics;
actnet / act = activity
succ = (success1-success4)
font=triplex
id = ( activity dur )
nolabel nodefaultid
boxwidth = 6
ybetween = 6
separatearcs;
run;
642

Chapter 5. The NETDRAW Procedure
Output 5.5.1. Controlling the Display Format
Example 5.5. Controlling the Display Format

643
You can also control the format of the display by specifying the number of pages into
which the network diagram should be split. You can do this by
using the HPAGES= and VPAGES= options, which specify the number of
pages in the horizontal and vertical directions, respectively
setting the number of nodes in the horizontal and vertical directions using the
NXNODES= and NYNODES= options, respectively
The following statements invoke PROC NETDRAW with some additional page con-
trol options. The HTEXT= option is also used to control the height of the text used
in the diagram.
footnote f=swiss j=r Controlling Number of Pages;
proc netdraw data=sched graphics;
actnet / act = activity
succ = (success1-success4)
font=triplex
id = ( activity dur )
nolabel nodefaultid
boxwidth = 6
ybetween = 6
separatearcs
htext=2
nopagenumber
hpages=3 vpages=1;
run;
644

Chapter 5. The NETDRAW Procedure
Output 5.5.2. Controlling the Display Format
Example 5.6. Nonstandard Precedence Relationships

645
Example 5.6. Nonstandard Precedence Relationships
This example illustrates the use of the LAG= option to indicate nonstandard prece-
dence relationships between activities. Consider the widget manufacturing project
described in the earlier examples. Some of the precedence constraints between the
activities may be nonstandard or have a nonzero lag value. For example, the activity
Init. Prod. may not be able to start until 2 days after the completion of the activity
Facility. The Network data set is displayed in Output 5.6.1. The variable lagdur
indicates the type of relationship between the activities specied in the variables task
and succ.
The following statements invoke PROC NETDRAW with the LAG= option. The
resulting network diagram is shown in Output 5.6.2.
title Widget Manufacture;
title2 h=1.5 Nonstandard Precedence Constraints;
proc netdraw graphics data=widglag;
actnet / act=task
succ=succ
lag=lagdur
pcompress
htext=3 boxht=3 arrowhead=2
xbetween=7 ybetween=9
centerid
separatearcs;
run;
646

Chapter 5. The NETDRAW Procedure
Output 5.6.1. Network with Nonstandard Precedence Constraints
Widget Manufacture
Network Data Set
Obs task days succ lagdur
1 Approve Plan 5 Drawings
2 Approve Plan 5 Anal. Market
3 Approve Plan 5 Write Specs
4 Drawings 10 Prototype
5 Anal. Market 5 Mkt. Strat.
6 Write Specs 5 Prototype
7 Prototype 15 Materials ss_9
8 Prototype 15 Facility ss_9
9 Mkt. Strat. 10 Test Market
10 Mkt. Strat. 10 Marketing
11 Materials 10 Init. Prod.
12 Facility 10 Init. Prod. fs_2
13 Init. Prod. 10 Test Market
14 Init. Prod. 10 Marketing
15 Init. Prod. 10 Evaluate
16 Evaluate 10 Changes ss_6
17 Test Market 15 Changes ff_3
18 Changes 5 Production
19 Production 0
20 Marketing 0
Output 5.6.2. Network Diagram with Nonstandard Precedence Constraints
Example 5.7. Controlling the Arc-Routing Algorithm

647
Example 5.7. Controlling the Arc-Routing Algorithm
This example illustrates the use of the DP and HTRACKS= options to control the
routing of the arcs connecting the nodes. The project is a simple construction project
with the following data. A Schedule data set produced by PROC CPM is input to
PROC NETDRAW. The rst invocation of the procedure illustrates the default lay-
out of the network. As explained in the Layout of the Network section on page
611, the NETDRAW procedure uses a simple heuristic to route the arcs between the
nodes. In the resulting diagram displayed in Output 5.7.1, note that the specication
of BOXHT=3 limits the number of rows within each node so that the oat values are
not displayed.
data exmp1;
format task $16. succesr1-succesr3 $16. ;
input task &
duration
succesr1 &
succesr2 &
succesr3 & ;
datalines;
Drill Well 4 Pump House . .
Pump House 3 Install Pipe . .
Power Line 3 Install Pipe . .
Excavate 5 Install Pipe Install Pump Foundation
Deliver Material 2 Assemble Tank . .
Assemble Tank 4 Erect Tower . .
Foundation 4 Erect Tower . .
Install Pump 6 . . .
Install Pipe 2 . . .
Erect Tower 6 . . .
;
proc cpm data=exmp1 date=1jan04d out=sched;
activity task;
duration duration;
successor succesr1 succesr2 succesr3;
run;
title j=l h=2 Site: Old Well Road;
title2 j=l h=2 Date: January 1, 2004;
footnote j=r Default Layout ;
proc netdraw data=sched graphics;
actnet / act = task
dur = duration
succ = (succesr1-succesr3)
boxht = 3 xbetween = 10
separatearcs
htext=2
pcompress;
run;
648

Chapter 5. The NETDRAW Procedure
Output 5.7.1. Arc Routing: Default Layout
Next, a different routing of the arcs is obtained by specifying the DP and the
HTRACKS= options. As a result of these options, the NETDRAW procedure uses a
dynamic programming algorithm to route the arcs, limiting the number of horizontal
tracks used to 1. The resulting network diagram is shown in Output 5.7.2. Notice
that at most one arc is drawn in each horizontal track. Recall that, by default, the
procedure uses a dynamic programming algorithm for arc routing if the number of
tracks is restricted to be less than the maximum number of successors. Thus, for this
example, the default routing option will be DP, even if it is not explicitly specied
(because HTRACKS = 1 and the maximum number of successors is 3).
footnote j=r h=1 Controlled Layout ;
proc netdraw data=sched graphics;
actnet / act = task
dur = duration
succ = (succesr1-succesr3)
boxht = 3 xbetween = 10
separatearcs
htracks=1
htext=2
pcompress
dp;
run;
Example 5.8. PATTERN and SHOWSTATUS Options

649
Output 5.7.2. Arc Routing: Controlled Layout
Example 5.8. PATTERN and SHOWSTATUS Options
As a project progresses, in addition to the criticality of the activities, you may also
want to display the status of the activity: whether it is in progress, has been com-
pleted, or is still to be scheduled. The SHOWSTATUS option in the ACTNET state-
ment displays this additional information. In the current example, the same progress
data as shown in Example 2.13 in Chapter 2, The CPM Procedure, are used to
illustrate the SHOWSTATUS option. The following program shows the necessary
code. First, PROC CPM schedules the project with the SHOWFLOAT option; this
enables activities that are already in progress or completed also to show nonzero oat.
Following this, a DATA step sets the variable style to 3 for activities that are com-
pleted or in progress; the remaining activities have missing values for this variable.
PROC NETDRAW is then invoked with the SHOWSTATUS option, which draws
two diagonal lines across nodes referring to completed activities and one diagonal
line for in-progress activities. The PATTERN= option in the ACTNET statement
identies the variable style containing the pattern information. Thus, the third pat-
tern statement is used for in-progress or completed activities; the other activities
(which have missing values for the variable style) use the second or the rst pat-
tern statement according to whether or not they are critical. However, since the rst
two PATTERNstatements have EMPTYll patterns specied, the nodes representing
activities that have not yet started are in fact colored on the basis of the COUTLINE=
and CCRITOUT= options. The resulting network diagram is shown in Output 5.8.1.
650

Chapter 5. The NETDRAW Procedure
data holidays;
format holiday holifin date7.;
input holiday & date7. holifin & date7. holidur;
datalines;
24dec03 26dec03 4
01jan04 . .
;
* actual schedule at timenow = 19dec03;
data actual;
format task $12. sdate fdate date7.;
input task & sdate & date7. fdate & date7. pctc rdur;
datalines;
Approve Plan 01dec03 05dec03 . .
Drawings 06dec03 16dec03 . .
Anal. Market 05dec03 . 100 .
Write Specs 07dec03 12dec03 . .
Prototype . . . .
Mkt. Strat. 10dec03 . . 3
Materials . . . .
Facility . . . .
Init. Prod. . . . .
Evaluate . . . .
Test Market . . . .
Changes . . . .
Production . . . .
Marketing . . . .
;
* merge the predicted information with network data;
data widgact;
merge actual widget;
run;
* estimate schedule based on actual data;
proc cpm data=widgact holidata=holidays
out=widgupd date=1dec03d;
activity task;
succ succ1 succ2 succ3;
duration days;
holiday holiday / holifin=(holifin);
actual / as=sdate af=fdate timenow=19dec03d
remdur=rdur pctcomp=pctc showfloat;
run;
/* Set patterns for activities that have started */
data netin;
set widgupd;
if a_start ^= . then style = 3;
run;
goptions hpos=120 vpos=70 border;
pattern1 c=green v=e;
pattern2 c=red v=e;
pattern3 c=ltgray v=s;
Example 5.8. PATTERN and SHOWSTATUS Options

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

Chapter 5. The NETDRAW Procedure
Example 5.9. Time-Scaled Network Diagram
This example illustrates the use of the TIMESCALE and ALIGN= options to draw
time-scaled network diagrams. The Schedule data set WIDGUPD, produced by
PROC CPM in the previous example, is used. First, PROC NETDRAW is invoked
with the TIMESCALE option without any ALIGN= specication. By default, the
procedure aligns the nodes to coincide with the early start times of the activities. The
network spans two pages(HPAGES=2 VPAGES=1), as shown in Output 5.9.1. The
HMARGIN= and VMARGIN= options add extra space around the margins.
title j=l f=swiss h=2 Project: Widget Manufacture;
title2 j=l f=swiss h=1.5 Date: December 19, 2003;
footnote j=l f=swiss Task Name / Early Finish Within Node
j=r f=swiss Time Scaled: Default Alignment ;
proc netdraw data=widgupd graphics;
actnet / act=task
succ=(succ1 succ2 succ3)
ybetween = 8
separatearcs
novcenter
font=swiss
id=(task e_finish)
nodefid
nolabel
showstatus
carcs=blue
ccritarcs=red
vmargin=5
hmargin=5
timescale
htext=2 pcompress
hpages=2 vpages=1
nopagenumber;
run;
Example 5.9. Time-Scaled Network Diagram

653
Output 5.9.1. TIMESCALE Option: Default Alignment
654

Chapter 5. The NETDRAW Procedure
Next, PROC NETDRAW is invoked with several of the time-scale options:
The ALIGN= option requests that the activities be placed according to the
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

START. The MININTERVAL= option


produces one tick mark per week for the duration of the project. The LREF= option
identies the linestyle of the reference lines and the dividing lines between zones.
The nodes are colored red or green according to whether or not the corresponding
activities are critical (PATTERN statements 1 and 2 from the previous invocation of
PROC NETDRAW are still valid).
proc cpm data=network interval=weekday
out=sched date=1dec03d;
activity task;
succ succ1 succ2 succ3;
duration days;
id phase;
run;
footnote j=r f=swiss Zone and Timescale ;
proc netdraw data=sched graphics;
actnet / act=task succ=(succ1 succ2 succ3)
pcompress
font = swiss
carcs = blue ccritarcs = red
cref = cyan
caxis = magenta
lref = 33
id = (task)
nodefid
nolabel
boxwidth = 8
htext=2
separatearcs
timescale
mininterval=week
autoref
linear
zone=phase
zonespace;
label phase = Department;
run;
662

Chapter 5. The NETDRAW Procedure
Output 5.11.2. Zoned Network Diagram with Time Axis
Example 5.12. Schematic Diagrams

663
Example 5.12. Schematic Diagrams
You can use PROC NETDRAW to determine node placement and arc routing for any
network depicting a set of nodes connected by arcs. If you want the procedure to
determine the node placement, the network must be acyclic. This example illustrates
the use of PROC NETDRAW to draw two networks that represent different schematic
ows. The rst network does not contain any cycles, while the second one has one
cycle; to draw the second network, you need to use the BREAKCYCLE option.
First, a schematic representation of the data ow going in and out of the three pro-
cedures (CPM, GANTT, and NETDRAW) is drawn using PROC NETDRAW. (See
Chapter 1, Introduction to Project Management, for a detailed discussion of such a
data ow.) The PATTERN= option is used to specify the variable in the data set that
identies the color that is to be used for each node. Nodes representing SAS/OR pro-
cedures are colored red, the ones representing output data sets are colored green, and
all other nodes (representing the use of other parts of the SAS System) are colored
blue. Three ID variables are used to specify the text that is to be placed within each
node. The ow diagram is shown in Output 5.12.1.
data dataflow;
format id1 $18. id2 $14. id3 $19. ;
input a $ b $ id1 & id2 & id3 & style;
datalines;
A B Data Definition: PROC FSEDIT, SAS/AF, etc. 2
B C Data Manipulation: Sort, Merge, Concatenate, etc. 2
B D Data Manipulation: Sort, Merge, Concatenate, etc. 2
D C . PROC NETDRAW . 1
C E PROC CPM . PROC PM 1
C F PROC CPM . PROC PM 1
E H Resource Usage . Data 3
F G . Schedule Data . 3
G I Data Manipulation: Sort, Merge, Subset, etc. 2
G J Data Manipulation: Sort, Merge, Subset, etc. 2
H K Data Manipulation: Sort, Merge, Subset, etc. 2
I . Other Reporting PROCs: PRINT, CALENDAR, etc. 2
J . PROC GANTT . PROC NETDRAW 1
K . Reporting PROCs: PLOT, CHART, GPLOT, GCHART, etc. 2
;
goptions hpos=110 vpos=70;
pattern1 v=s c=red;
pattern2 v=s c=blue;
pattern3 v=s c=green;
664

Chapter 5. The NETDRAW Procedure
title f=swiss h=3 A Typical Project Management System;
title2 f=swiss h=2.5 Schematic Representation of Data Flow;
proc netdraw data=dataflow graphics;
actnet / act=a succ=b id = (id1-id3)
nodefaultid font=swiss
nolabel
pattern=style
carcs=black
coutline=black
ctext=white
hmargin = 2
ybetween = 15
rectilinear
noarrowfill
pcompress
htext=2;
run;
Example 5.12. Schematic Diagrams

665
Output 5.12.1. Schematic Representation of Data Flow
666

Chapter 5. The NETDRAW Procedure
Next, a typical sequence of procedures followed at the scheduling of a nuclear power
plant outage is shown using the NETDRAW procedure. Such a schematic dia-
gram is illustrated in Chapter 1, Introduction to Project Management. In Figure
1.6, there is a cycle that is not normally allowed in a Network data set that is in-
put to PROC NETDRAW. However, you can draw such networks by specifying the
BREAKCYCLE option. (Note that you can also draw cyclic networks by specifying
explicitly the node coordinates or an ALIGN= variable that xes the x coordinates
for each node.)
In this example, the data set OUTAGE contains the network representation. The
variable style is used to color nodes appropriately. The resulting diagram is shown
in Output 5.12.2.
data outage;
format id1 $12. id2 $12. ;
input a $ b $ id1 & id2 & style;
datalines;
A B Project Definition 1
B C CPM Schedule 2
C D Gantt Chart Network 3
D E Start Power Outage 4
E F Project Update 1
F G Schedule Update 2
G E Gantt Chart Network 3
;
goptions hpos=110 vpos=70;
pattern1 v=s c=green;
pattern2 v=s c=blue;
pattern3 v=s c=blue;
pattern4 v=s c=red;
title f=swiss h=3 Scheduling an Outage;
title2 f=swiss h=2.5 Project Cycle;
proc netdraw data=outage graphics;
actnet / act=a succ=b id = (id1 id2)
breakcycle
nodefaultid
font=swiss
centerid
vmargin = 5 hmargin = 0
nolabel
novcenter
pattern=style
carcs=black coutline=black ctext=white
ybetween = 15 xbetween=3
noarrowfill
pcompress
htext=2;
run;
Example 5.12. Schematic Diagrams

667
Output 5.12.2. Scheduling a Power Outage
668

Chapter 5. The NETDRAW Procedure
Example 5.13. Modifying Network Layout
This example uses the SURVEY project described in Chapter 1, Introduction to
Project Management, to illustrate how you can modify the default layout of the
network. The data set SURVEYcontains the project information. PROCNETDRAW
is invoked with the GRAPHICS option. The network diagram is shown in Output
5.13.1.
data survey;
format id $20. activity succ1-succ3 $8. phase $9. ;
input id &
activity &
duration
succ1 &
succ2 &
succ3 &
phase $ ;
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
;
pattern1 v=s c=green;
title f=swiss j=l Project: Market Survey;
title2 f=swiss j=l h=1.5 Changing Node Positions;
footnote f=swiss j=r Default Layout ;
proc netdraw data=survey graphics out=network;
actnet / act=activity
succ=(succ1-succ3)
id=(id)
nodefid
nolabel
carcs = blue
ctext = white
coutline=red
font=swiss
centerid
boxht = 3
htext=2
pcompress
separatearcs
ybetween=8;
run;
title2 NETWORK Output Data Set;
proc print data=network;
run;
Example 5.13. Modifying Network Layout

669
Output 5.13.1. Default Network Layout of SURVEY Project
The Layout data set produced by PROC NETDRAW (displayed in Output 5.13.2)
contains the x and y coordinates for all the nodes in the network and for all the
turning points of the arcs connecting them.
Suppose that you want to interchange the positions of the nodes corresponding to
the two activities, Select Households and Train Personnel. As explained in the
Controlling the Layout section on page 617, you can invoke the procedure in
FULLSCREEN mode and use the MOVE command to move the nodes to desired
locations. In this example, the data set NETWORK produced by PROC NETDRAW
is used to change the x and y coordinates of the nodes. A new data set called
NODEPOS is created from NETWORK by retaining only the observations con-
taining node positions (recall that for such observations,

SEQ

= 0) and by drop-
ping the

SEQ

variable. Further, the y coordinates (given by the values of the

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

indicates to PROC NETDRAW that the


data set contains the x and y coordinates for all the nodes. Because there is no vari-
able named

SEQ

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 represent the production at the plant in period i, DEPOT1

i rep-
resent the inventory at DEPOT1 in period i, DEPOT2

i represent the inventory at


DEPOT2 in period i, and CUST

i represent the customers demand in period i


(i =1, 2). These variables can be thought of as nodes in a network with the following
data representing the COST and CAPACITY of the arcs connecting them:
FROM TO COST CAPACITY
PLANT_1 CUST_1 10 75
PLANT_1 DEPOT1_1 7 75
PLANT_1 DEPOT2_1 8 75
DEPOT1_1 CUST_1 3 20
DEPOT2_1 CUST_1 2 10
PLANT_1 PLANT_2 2 100
DEPOT1_1 DEPOT1_2 1 100
DEPOT2_1 DEPOT2_2 1 100
PLANT_2 CUST_2 10 75
PLANT_2 DEPOT1_2 7 75
PLANT_2 DEPOT2_2 8 75
DEPOT1_2 CUST_2 3 20
DEPOT2_2 CUST_2 2 10
CUST_1 . . .
CUST_2 . . .
Suppose that you want to use PROC NETDRAW to draw the network corresponding
to the preceding network ow problem and suppose also that you require the nodes
to be placed in specic positions. The following program saves the network infor-
mation along with the required node coordinates in the Network data set ARCS and
invokes PROC NETDRAW to draw the network diagram shown in Output 5.14.1.
The Network data set also contains a variable named

pattern, which species that
pattern statement 1 be used for nodes relating to period 1 and pattern statement 2 be
used for those relating to period 2.
Example 5.14. Specifying Node Positions

673
data arcs;
input from $ to $ _x_ _y_ _pattern;
datalines;
PLANT_1 CUST_1 1 5 1
PLANT_1 DEPOT1_1 1 5 1
PLANT_1 DEPOT2_1 1 5 1
DEPOT1_1 CUST_1 2 6 1
DEPOT2_1 CUST_1 2 4 1
PLANT_1 PLANT_2 1 5 1
DEPOT1_1 DEPOT1_2 2 6 1
DEPOT2_1 DEPOT2_2 2 4 1
PLANT_2 CUST_2 4 2 2
PLANT_2 DEPOT1_2 4 2 2
PLANT_2 DEPOT2_2 4 2 2
DEPOT1_2 CUST_2 5 3 2
DEPOT2_2 CUST_2 5 1 2
CUST_1 . 3 5 1
CUST_2 . 6 2 2
;
pattern1 v=s c=green;
pattern2 v=s c=red;
title f=swiss c=blue Distribution Network;
proc netdraw data=arcs graphics out=netout;
actnet / act=from
succ=to
separatearcs
font=swiss
ybetween = 4
centerid
ctext = white
carcs = blue
htext=2
pcompress;
run;
Note: This network diagram can also be drawn by using suitably dened ZONE and
ALIGN variables.
674

Chapter 5. The NETDRAW Procedure
Output 5.14.1. Distribution Network
Example 5.15. Organizational Charts with PROC NETDRAW
This example illustrates using the TREE option to draw organizational charts. The
Network data set, DOCUMENT, describes how the procedures are distributed be-
tween two volumes of the SAS/OR documentation. The structure can be visualized
easily in a tree diagram. The data set DOCUMENT contains the parent-child re-
lationship for each node of the diagram. For each node, a detailed description is
contained in the variable ID. In addition, the variable

pattern species the pat-
tern to be used for each node. PROC NETDRAW is invoked with the TREE option,
which illustrates the organization of the documentation in the form of a tree dia-
gram drawn from left to right. The CENTERID option centers text within each node.
Arrowheads are not necessary for this diagram and are suppressed by specifying
ARROWHEAD=0. Output 5.15.1 shows the resulting diagram.
data document;
format parent child $8. id $24.;
input parent $ child $ id & _pattern;
datalines;
OR MPBOOK Operations Research 1
OR PMBOOK Operations Research 1
PMBOOK CPM Project Management 2
PMBOOK DTREE Project Management 2
PMBOOK GANTT Project Management 2
PMBOOK NETDRAW Project Management 2
PMBOOK PM Project Management 2
PMBOOK PROJMAN Project Management 2
Example 5.15. Organizational Charts with PROC NETDRAW

675
MPBOOK ASSIGN Mathematical Programming 3
MPBOOK INTPOINT Mathematical Programming 3
MPBOOK LP Mathematical Programming 3
MPBOOK NETFLOW Mathematical Programming 3
MPBOOK NLP Mathematical Programming 3
MPBOOK TRANS Mathematical Programming 3
CPM . CPM Procedure 2
DTREE . DTREE Procedure 2
GANTT . GANTT Procedure 2
NETDRAW . NETDRAW Procedure 2
PM . PM Procedure 2
PROJMAN . PROJMAN Application 2
ASSIGN . ASSIGN Procedure 3
INTPOINT . INTPOINT Procedure 3
LP . LP Procedure 3
NETFLOW . NETFLOW Procedure 3
NLP . NLP Procedure 3
TRANS . TRANS Procedure 3
;
goptions ftext=swiss;
pattern1 v=s c=blue;
pattern2 v=s c=red;
pattern3 v=s c=green;
title j=l h=1.5 Operations Research Documentation;
title2 j=l h=1 Procedures in Each Volume;
footnote j=r h=.75 Default Tree Layout ;
proc netdraw graphics data=document;
actnet / act=parent
succ=child
id=(id)
nodefid
nolabel
pcompress
centerid
tree
arrowhead=0
xbetween=15
ybetween=3
rectilinear
carcs=black
ctext=white
htext=3;
run;
676

Chapter 5. The NETDRAW Procedure
Output 5.15.1. Organization of Documentation: Default TREE Layout
The procedure draws the tree compactly with the successors of each node being
placed to the immediate right of the node, ordered from top to bottom in the or-
der of occurrence in the Network data set. The next invocation of PROC NETDRAW
illustrates the effect of the SEPARATESONS and CENTERSUBTREE options on the
layout of the tree (see Output 5.15.2).
footnote j=r h=.75 Centered Tree Layout ;
proc netdraw graphics data=document;
actnet / act=parent
succ=child
id=(id)
nodefid
nolabel
pcompress
novcenter
centerid
tree
arrowhead=0
separatesons
centersubtree
xbetween=15
ybetween=3
rectilinear
carcs=black
ctext=white
htext=3.5;
run;
Example 5.16. Annotate Facility with PROC NETDRAW

677
Output 5.15.2. Organization of Documentation: Controlled TREE Layout
Example 5.16. Annotate Facility with PROC NETDRAW
This example demonstrates the use of PROC NETDRAW for a nonstandard applica-
tion. The procedure is used to draw a time table for a class of students. The days
of the week are treated as different zones, and the times within a day are treated as
different values of an alignment variable. The following DATA step denes a total
of twenty activities, m1, . . . ,f5, which refer to the ve different periods for the
ve different days of the week. The variable class contains the name of the subject
taught in the corresponding period and day. Note that the periods are taught during
the hours 1, 2, 3, 5, and 6; the fourth hour is set aside for lunch. The time axis is
labeled with the format CLASSTIM, which is dened using PROC FORMAT. The
USEFORMAT option in the ACTNET statement instructs PROC NETDRAW to use
the explicit format specied for the time variable rather than the default format.
This example also illustrates the use of the Annotate facility with PROC NETDRAW.
The data set ANNO labels the fourth period LUNCH. The positions for the text are
specied using data coordinates that refer to the (

,

Y

) grid used by PROC


NETDRAW. Thus, for example X = 4 identies the x coordinate for the annotated
text to be the fourth period, and the y coordinates are set appropriately. The resulting
time table is shown in Output 5.16.1.
678

Chapter 5. The NETDRAW Procedure
/* Define format for the ALIGN= variable */
proc format;
value classtim 1 = 9:00 - 10:00
2 = 10:00 - 11:00
3 = 11:00 - 12:00
4 = 12:00 - 1:00
5 = 1:00 - 2:00
6 = 2:00 - 3:00 ;
run;
data schedule;
format day $9. class $12. ;
input day $ class & time daytime $ msucc $;
format time classtim.;
label day = "Day \ Time";
datalines;
Monday Mathematics 1 m1 .
Monday Language 2 m2 .
Monday Soc. Studies 3 m3 .
Monday Art 5 m4 .
Monday Science 6 m5 .
Tuesday Language 1 t1 .
Tuesday Mathematics 2 t2 .
Tuesday Science 3 t3 .
Tuesday Music 5 t4 .
Tuesday Soc. Studies 6 t5 .
Wednesday Mathematics 1 w1 .
Wednesday Language 2 w2 .
Wednesday Soc. Studies 3 w3 .
Wednesday Phys. Ed. 5 w4 .
Wednesday Science 6 w5 .
Thursday Language 1 th1 .
Thursday Mathematics 2 th2 .
Thursday Science 3 th3 .
Thursday Phys. Ed. 5 th4 .
Thursday Soc. Studies 6 th5 .
Friday Mathematics 1 f1 .
Friday Language 2 f2 .
Friday Soc. Studies 3 f3 .
Friday Library 5 f4 .
Friday Science 6 f5 .
;
Example 5.16. Annotate Facility with PROC NETDRAW

679
data anno;
/* Set up required variable lengths, etc. */
length function color style $8;
length xsys ysys hsys $1;
length when position $1;
xsys = 2;
ysys = 2;
hsys = 4;
when = a;
function = label ;
x = 4;
size = 2;
position = 5;
y=5; text=L; output;
y=4; text=U; output;
y=3; text=N; output;
y=2; text=C; output;
y=1; text=H; output;
run;
pattern1 v=s c=magenta;
title Class Schedule: 2003-2004;
footnote j=l Teacher: Mr. A. Smith Hall
j=r Room: 107 ;
proc netdraw graphics data=schedule anno=anno;
actnet / act=daytime
succ=msucc
id=(class)
nodefid nolabel
zone=day
align=time
useformat
linear
pcompress
coutline=black
hmargin = 2 vmargin = 2
htext=2;
run;
680

Chapter 5. The NETDRAW Procedure
Output 5.16.1. Use of the Annotate Facility
Example 5.17. AOA Network Using the Annotate Facility

681
Example 5.17. AOA Network Using the Annotate Facility
This example illustrates the use of the Annotate Facility to draw an Activity-on-Arc
network. First, PROC NETDRAW is invoked with explicit node positions for the
vertices of the network. The ALIGN= and ZONE= options are used to provide hor-
izontal and vertical axes as a frame of reference. The resulting diagram is shown in
Output 5.17.1.
data widgaoa;
format task $12. ;
input task & days tail head _x_ _y_;
datalines;
Approve Plan 5 1 2 1 2
Drawings 10 2 3 4 2
Anal. Market 5 2 4 4 2
Write Specs 5 2 3 4 2
Prototype 15 3 5 7 1
Mkt. Strat. 10 4 6 10 3
Materials 10 5 7 10 1
Facility 10 5 7 10 1
Init. Prod. 10 7 8 13 1
Evaluate 10 8 9 16 1
Test Market 15 6 9 18 2
Changes 5 9 10 20 1
Production 0 10 11 23 1
Marketing 0 6 12 19 2
Dummy 0 8 6 16 1
. . 11 . 26 1
. . 12 . 22 3
;
pattern1 v=e c=red;
title j=l Project: Widget Manufacture;
title2 j=l Network in Activity-on-Arc Format;
footnote j=r Initial Layout ;
proc netdraw graphics data=widgaoa out=netout;
actnet / act=tail
succ=head
id=(tail)
align=_x_
zone=_y_
ybetween = 10
nodefid
nolabel
pcompress
htext=2;
label _y_= Y \ X ;
run;
682

Chapter 5. The NETDRAW Procedure
Output 5.17.1. Activity-on-Arc Format
Example 5.17. AOA Network Using the Annotate Facility

683
In Output 5.17.1, the arc leading from vertex 4 to vertex 6 has two turning points:
(10.5, 3) and (10.5, 2). Suppose that you want the arc to be routed differently, to
provide a more symmetric diagram. The next DATA step creates a data set, NETIN,
which changes the x coordinates of the turning points to 16.5 instead of 10.5. Further,
two Annotate data sets are created: the rst one labels the nodes outside the boxes,
either to the top or to the bottom, and the second one sets labels for the arcs. PROC
NETDRAW is then invoked with the combined Annotate data set to produce the
diagram shown in Output 5.17.2.
data netin;
set netout;
if _from_=4 and _to_=6 and _seq_>0 then _x_=16.5;
run;
data anno1;
set netout;
if _seq_=0;
/* Set up required variable lengths, etc. */
length function color style $8;
length xsys ysys hsys $1;
length when position $1;
length text $12;
xsys = 2;
ysys = 2;
hsys = 4;
when = a;
/* label the nodes using node numbers */
function = label ;
size = 2;
position = 5;
text = left(put(tail, f2.));
x=_x_;
if _y_ = 1 then y=_y_-.3;
else y=_y_+.5;
run;
data anno2;
/* Set up required variable lengths, etc. */
length function color style $8;
length xsys ysys hsys $1;
length when position $1;
length text $12;
xsys = 2;
ysys = 2;
hsys = 4;
when = a;
/* label the arcs using Activity names */
function = label ;
size = 2;
position = 5;
x=2.5; y=1.8; text=Approve Plan; output;
x=5.5; y=.8; text=Drawings; output;
x=5.7; y=1.4; text=Write Specs; output;
684

Chapter 5. The NETDRAW Procedure
x=7; y=3.4; text=Anal.Market; output;
x=8.5; y=.8; text=Prototype; output;
x=11.5; y=1.4; text=Facility; output;
x=11.5; y=.8; text=Materials; output;
x=14.5; y=.9; text=Init. Prod; output;
x=13.5; y=3.4; text=Mkt. Strat.; output;
x=18; y=.8; text=Evaluate; output;
x=21.5; y=.8; text=Changes; output;
x=24.5; y=.8; text=Production; output;
x=20; y=3.4; text=Marketing; output;
position=6;
x=16.6; y=1.5; text=Dummy; output;
x=18.6; y=1.5; text=Test Market; output;
;
data anno;
set anno1 anno2;
run;
footnote j=r Annotated and Modified Layout ;
pattern1 v=s c=red;
proc netdraw graphics data=netin anno=anno;
actnet / nodefid
nolabel
boxwidth=1
pcompress
novcenter
vmargin=20
xbetween=10;
run;
Example 5.17. AOA Network Using the Annotate Facility

685
Output 5.17.2. Activity-on-Arc Format: Annotated Diagram
686

Chapter 5. The NETDRAW Procedure
Example 5.18. Branch and Bound Trees
This example illustrates a nonstandard use of PROC NETDRAW. The TREE option
in PROC NETDRAW is used to draw a branch and bound tree such as one that you
obtain in the solution of an integer programming problem. See Chapter 4, The LP
Procedure (SAS/OR Users Guide: Mathematical Programming) for a detailed dis-
cussion of branch and bound trees. The data used in this example were obtained from
one particular invocation of PROC LP.
The data set NET (created in the following DATA step) contains information per-
taining to the branch and bound tree. Each observation of this data set represents a
particular iteration of the integer program, which can be drawn as a node in the tree.
The variable node names the problem. The variable object gives the objective value
for that problem. The variable problem identies the parent problem corresponding
to each node; for example, since the second and the seventh observations have prob-
lem equal to -1 and 1, respectively, it indicates that the second and the seventh
problems are derived from the rst iteration. Finally, the variable

pattern species
the pattern of the nodes based on the status of the problem represented by the node.
data net;
input node problem cond $10. object;
if cond="ACTIVE" then _pattern=1;
else if cond="SUBOPTIMAL" then _pattern=2;
else _pattern=3;
datalines;
1 0 ACTIVE 4
2 -1 ACTIVE 4
3 2 ACTIVE 4
4 -3 ACTIVE 4.3333333
5 4 SUBOPTIMAL 5
6 3 FATHOMED 4.3333333
7 1 ACTIVE 4
8 -7 ACTIVE 4
9 -8 FATHOMED 4.3333333
10 8 FATHOMED 4.3333333
11 7 ACTIVE 4
12 -11 FATHOMED 4.3333333
13 11 FATHOMED 4.5
;
The next DATA step (which creates the data set LOGIC) uses this child-parent in-
formation to format the precedence relationships as expected by PROC NETDRAW.
Next, the two data sets are merged together to create the Network input data set
(BBTREE) for PROC NETDRAW. The ID variable in the data set BBTREE is for-
matted to contain both the iteration number and the objective value.
Finally, PROC NETDRAW is invoked with the TREE, ROTATE, and ROTATETEXT
options to produce a branch and bound tree shown in Output 5.18.1. Note that the
ROTATE and ROTATETEXT options produce a rotated graph with a top-down ori-
entation.
Example 5.18. Branch and Bound Trees

687
/* set precedence relationships
using child-parent information */
data logic;
keep node succ;
set net(firstobs=2);
succ=node;
node=abs(problem);
run;
proc sort data=logic;
by node;
run;
/* combine the logic data and the node data */
/* set ID values */
data bbtree;
length id $ 9;
merge logic net; by node;
if node < 10 then id=put(node,1.)||put(object,f8.2);
else id=put(node,2.)||put(object,f7.2);
run;
goptions ftext=swissb border;
pattern1 v=s c=green;
pattern2 v=s c=red;
pattern3 v=s c=blue;
title j=c Branch and Bound Tree;
title2 ;
footnote1 h=1.2 j=c c=red Optimal
c=green Active
c=blue Fathomed ;
footnote2 ;
footnote3 Node shows Iteration Number and Objective Value ;
proc netdraw data=bbtree graphics out=bbout;
actnet /activity=node
successor=succ
id=(id)
nodefid
nolabel
ctext=white
coutline=black
carcs=black
xbetween=15
ybetween=3
font=swiss
compress
rectilinear
tree
rotate
rotatetext
arrowhead=0
htext=2;
run;
688

Chapter 5. The NETDRAW Procedure
Output 5.18.1. Branch and Bound Tree
In the next invocation, PROC NETDRAW uses a modied layout of the nodes to
produce a diagram where the nodes are aligned according to the iteration number.
The following program uses the Layout data set produced in the previous invocation
of PROC NETDRAW. The same y coordinates are used; but the x coordinates are
changed to equal the iteration number. Further, the ALIGN= specication produces
a time axis that labels each level of the diagram with the iteration number. Each node
is labeled with the objective value. The resulting diagram is shown in Output 5.18.2.
data netin;
set bbout;
if _seq_ = 0; drop _seq_ ;
_x_ = _from_;
id = substr(id, 3);
run;
goptions rotate=landscape;
title Branch and Bound Tree;
title2 h=1.5 Aligned by Iteration Number;
footnote1 h=1.2 j=c c=red Optimal
c=green Active
c=blue Fathomed ;
footnote2 ;
footnote3 j=l Node shows Objective Value ;
pattern1 v=e c=green;
pattern2 v=e c=red;
pattern3 v=e c=blue;
proc netdraw data=netin graphics;
Statement and Option Cross-Reference Tables

689
actnet /id=(id)
ctext=black
carcs=black
align = _from_
frame
pcompress
rectilinear
arrowhead=0
nodefid
nolabel
htext=2.5
xbetween=8;
run;
Output 5.18.2. Branch and Bound Tree: Aligned by Iteration Number
Statement and Option Cross-Reference Tables
The next two tables reference the options in the NETDRAW procedure that are illus-
trated by the examples in this section. Note that all the options are specied on the
ACTNET statement.
690

Chapter 5. The NETDRAW Procedure
Table 5.18. Options Specied in Examples 5.15.9
Option 1 2 3 4 5 6 7 8 9
ACTIVITY= X X X X X X X X X
ALIGN= X
ARROWHEAD= X
AUTOREF X
BOXHT= X X
BOXWIDTH= X X
CARCS= X X X X X
CCRITARCS= X X X X
CCRITOUT= X X
CENTERID X
COMPRESS X
COUTLINE= X X
CREF= X
CTEXT= X
DATA= X X X X X X X X X
DP X
DURATION= X X X X
FONT= X X X X X X
FRAME X
GRAPHICS X X X X X X X X
HMARGIN= X
HPAGES= X X
HTEXT= X X X X X
HTRACKS= X
ID= X X X
LAG= X
LINEPRINTER X
LREF= X
LWCRIT= X
LWIDTH= X
NODEFAULTID X X X
NOLABEL X X X
NOPAGENUMBER X X
NOVCENTER X X
PATTERN= X
PCOMPRESS X X X X X
SEPARATEARCS X X X X X X X
SHOWBREAK X
SHOWSTATUS X X
SUCCESSOR= X X X X X X X X X
TIMESCALE X
VMARGIN= X
VPAGES= X X
XBETWEEN= X X
YBETWEEN= X X X X
Statement and Option Cross-Reference Tables

691
Table 5.19. Options Specied in Examples 5.105.18
Option 10 11 12 13 14 15 16 17 18
ACTIVITY= X X X X X X X X X
ALIGN= X X X
ANNOTATE= X X
ARROWHEAD= X X
AUTOREF X
BOXHT= X
BOXWIDTH= X X X
BREAKCYCLE X
CARCS= X X X X X X X
CAXIS= X
CCRITARCS= X
CENTERID X X X X
CENTERSUBTREE X
COMPRESS X X
COUTLINE= X X X X
CREF= X
CREFBRK= X
CTEXT= X X X X X
DATA= X X X X X X X X X
DP X
DURATION= X
FONT= X X X X X X
FRAME X X
GRAPHICS X X X X X X X X X
HMARGIN= X X
HTEXT= X X X X X X X X X
ID= X X X X X X X X
LINEAR X X X
LREF= X
LREFBRK= X
MININTERVAL= X
NOARROWFILL X
NODEFID X X X X X X X X
NOLABEL X X X X X X X X
NOVCENTER X X X X
OUT= X X
PATTERN= X
PCOMPRESS X X X X X X X X X
RECTILINEAR X X X
REFBREAK X
ROTATE X
ROTATETEXT X
SEPARATEARCS X X X X
SEPARATESONS X
SUCCESSOR= X X X X X X X X X
TIMESCALE X X
692

Chapter 5. The NETDRAW Procedure
Table 5.19. (continued)
Option 10 11 12 13 14 15 16 17 18
TREE X X
USEFORMAT X
VMARGIN= X X X X
XBETWEEN= X X X X
YBETWEEN= X X X X X X
ZONE= X X X
ZONEPAT X
ZONESPACE X
References
Even, S. (1979), Graph Algorithms, Rockville, MD: Computer Science Press Inc.
Chapter 6
The PM Procedure
Chapter Contents
OVERVIEW . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 695
GETTING STARTED . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 695
SYNTAX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 697
PROC PM Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 697
PM WINDOW . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 699
User Interface Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . 700
Project Hierarchy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 702
Table View . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 703
Gantt View . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 706
Creating and Editing Projects . . . . . . . . . . . . . . . . . . . . . . . . . 711
Setting Activity Filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 716
Saving and Restoring Preferences . . . . . . . . . . . . . . . . . . . . . . . 716
Sorting Activities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 717
Setting the Project Font . . . . . . . . . . . . . . . . . . . . . . . . . . . . 717
Renumbering the Activities . . . . . . . . . . . . . . . . . . . . . . . . . . 718
Printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 718
DETAILS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 719
Schedule Data Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 719
Project Data Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 721
TIMENOW Macro Variable . . . . . . . . . . . . . . . . . . . . . . . . . . 721
Microsoft Project Data Conversion . . . . . . . . . . . . . . . . . . . . . . 722
EXAMPLES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 723
Example 6.1. Dening a New Project . . . . . . . . . . . . . . . . . . . . . 723
Example 6.2. Adding Subtasks to a Project . . . . . . . . . . . . . . . . . . 728
Example 6.3. Saving and Comparing Baseline Schedules . . . . . . . . . . 731
Example 6.4. Effect of Calendars . . . . . . . . . . . . . . . . . . . . . . . 734
Example 6.5. Dening Resources . . . . . . . . . . . . . . . . . . . . . . . 737
Example 6.6. Editing Progress . . . . . . . . . . . . . . . . . . . . . . . . 741
694

Chapter 6. The PM Procedure
Chapter 6
The PM Procedure
Overview
The PM procedure is an interactive procedure that can be used for planning, control-
ling, and monitoring a project. The syntax and the scheduling features of PROC PM
are virtually the same as those of the CPM procedure. However, since the PM pro-
cedure is interactive, there are a few extra options that are available and a few other
options that have a default behavior that is different from the CPM procedure. These
differences are noted in the Syntax section on page 697. One major difference is
that only the Activity-On-Node representation of the project is supported in PROC
PM. In other words, TAILNODE and HEADNODE statements are not supported.
For a complete description of the syntax and the scheduling algorithm for the CPM
procedure, refer to Chapter 2, The CPM Procedure.
When PROC PM is invoked with the activity network representation, an interactive
window is opened that displays a Table View of the project on the left and a Gantt
View of the project on the right. You can add activities and edit the project data
using the Table View. You can also use the Gantt View to move activities, change
the durations of the activities, and add precedence constraints between the activities.
These features are described in the PM Window section on page 699.
The PM procedure is designed to facilitate its inclusion in a Project Management ap-
plication, such as PROJMAN. Any changes that are made to the activity network or to
the activity durations, resource requirements, alignment specications, and other ac-
tivity information need to be saved in the resulting Schedule output data set. Further,
you should be able to use this output data set as input to a future invocation of PROC
PM and continue to manage the project. Thus, there are some differences in the de-
sign of the Schedule output data set (dened in PROC CPM) to enable the integration
of PROC PM into a Project Management application. The differences between the
Schedule data sets in the two procedures are described in the Schedule Data Set
section on page 719.
Getting Started
Consider the simple Software Development Project described in the Getting Started
section of Chapter 2, The CPM Procedure. Recall that the Activity data set,
SOFTWARE, contains the activity descriptions, durations, and precedence con-
straints. The following statements (identical to the PROC CPM invocation) initialize
the project data and invoke the PM procedure.
696

Chapter 6. The PM Procedure
data software;
format Descrpt $20. ;
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 pm data=software
out=intro1
interval=day
date=01mar04d;
id descrpt;
activity activity;
duration duration;
successor succesr1 succesr2;
run;
When you invoke the PM procedure, the PM Window appears (see Figure 6.1), con-
sisting of the Table View and the Gantt View of the project. The activities are listed
in the order in which they are dened in the Activity data set. The two views are
separated by a dividing line that can be dragged to the left or right, controlling the
size of the two views. Further, the two views scroll together in the vertical direction
but can scroll independently in the horizontal direction.
The Table View contains several editable columns (in white) that can be used to edit
the project data as well as add new activities to the project. Some of the columns (in
gray), such as the Schedule times, are not editable. The Gantt View contains a Gantt
chart of the project and displays the precedence relationships between the activities.
You can use the Gantt View to add or delete precedence constraints between activities
and to change the durations or alignment constraints of the activities by dragging the
schedule bars. Details of the interface are described in the PM Window section on
page 699.
PROC PM Statement

697
Figure 6.1. Software Development Project
Syntax
The syntax for PROC PM is virtually identical to that for PROC CPM. The main dif-
ference is that you replace the PROC CPM statement with the PROC PM statement.
Note also that the TAILNODE and HEADNODE statements are not supported in
PROC PM.
The form of the PROC PM statement is
PROC PM options ;
PROC PM Statement
PROC PM options ;
All the options that are available in the PROC CPM statement can also be specied in
the PROC PM statement. However, there are a few additional options available with
PROC PM, and some of the other PROC CPM options are not needed as they are the
default behavior in PROC PM.
698

Chapter 6. The PM Procedure
Options Specic to PROC PM
The following options can be specied on the PROC PM statement.
NODISPLAY
invokes the procedure in a noninteractive mode. The schedule for the project is still
computed and the requested output data sets are created and saved. However, the
PM Window is not displayed. This option is useful for scheduling large projects
that do not need to be updated interactively. Note that invoking PROC PM with the
NODISPLAY option is similar to invoking PROC CPM; however, since the format
of the Schedule output data set is different for the two procedures, you may see some
differences in the order and content of the observations. See the Schedule Data Set
section on page 719 for details.
PROJECT=SAS-data-set
identies a SAS data set that can be used to save and restore preferences that control
the project view. For example, preferences such as the font, column order, column
widths, lters, and so forth, can be saved from one invocation to another. See the
Project Data Set section on page 721 for more details about this data set and the
preferences that can be saved in it.
PROJECTNAME=string
PROJNAME=string
NAME=string
species a descriptive string identifying the name of the project. This string is used
to label the PM Window.
Default Options in PROC PM
The following options are the default in PROC PM.
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 vari-
ables specied in the SUCCESSOR or PROJECT statements without appearing as a
value of the variable specied in the ACTIVITY statement. This option is the default
in PROC PM. In other words, the Schedule output data set produced by PROC PM
contains one observation for every activity that appears as a value of the ACTIVITY,
SUCCESSOR, or PROJECT variables (as long as it has not been deleted in the cur-
rent invocation of the procedure). It also contains an observation for every activity
that is added to the project using the graphical user interface.
AUTOUPDT
requests that the procedure should assume automatic completion (or start) of activities
that are predecessors to activities already completed (or in progress). This option is
the default in PROC PM.
PM Window

699
ESTIMATEPCTC
ESTPCTC
ESTPCTCOMP
ESTPROG
indicates that a variable named PCT

COMP is to be added to the Schedule output


data set (and the Resource Schedule output data set) that contains the percent com-
pletion time for each activity (for each resource used by each activity) in the project.
This option is the default in PROC PM.
SHOWFLOAT
indicates that activities that are completed or in progress should have nonzero oat.
This option is the default in PROC PM.
XFERVARS
indicates that all relevant variables are to be copied from the Activity data set to the
Schedule data set. This option is the default in PROC PM. The procedure carries
over to the output data set all the relevant variables from the input data set. Thus,
the Schedule output data set contains all the project information that is necessary to
schedule it.
PM Window
Figure 6.2. LAN Selection Project
700

Chapter 6. The PM Procedure
The PM Window provides the standard editing and viewing functions of a typical
project management tool. It can be displayed by invoking the PM procedure or using
the Activities Window in the PROJMAN application. For an existing project, the PM
Window is populated with the activities in the project. For a new project, the PM
window is empty. Figure 6.2 displays the PM Window for one of the sample projects
included with the PROJMAN application.
After you have nished editing the project, you can close the PM Window to save the
new project data in the Schedule output data set that was specied in the invocation
of the PM procedure.
User Interface Features
This section describes some of the typical features of the PM Windows graphical
user interface. The PM Window provides both a Gantt View and a Table View of the
project. The size of each view can be changed by pointing the cursor at the dividing
line between the two views until it changes to a double arrow and dragging it to the
right or left.
Only part of the project may be visible in the PM Window; horizontal and verti-
cal scroll bars are provided that enable you to scroll the project data in both direc-
tions. Note that the Gantt and the Table Views are attached to each other so that they
scroll together vertically. Each view can be scrolled horizontally, independently of
the other.
The pull-down menu at the top of the PM Window provides access to several project
management functions under the Edit, View, and Project menus. For example, the
Project pull-down menu is shown in Figure 6.3. The commands available through
the pull-down menus are described in detail in the appropriate sections.
Figure 6.3. Project Pull-down Menu
In addition to the pull-down menus, context-sensitive pop-up menus are available in
the Table and Gantt Views, the time axis, along the arcs, and from select columns
in the Table View. Pop-up menus are displayed by positioning the cursor over a
particular object and clicking the right mouse button. For example, clicking the right
mouse button on an arc in the Gantt View displays the arc pop-up menu shown in
Figure 6.4.
Figure 6.4. Arc Pop-up Menu
User Interface Features

701
In some situations, the pop-up menu selection can lead to a dialog box that requires
you to type a value in one or more of the elds in the box. For example, selecting
Edit Lag... from the arc pop-up menu leads to the dialog box displayed in Figure 6.5.
(See the Create Nonstandard Precedence Relationships section on page 714 for a
discussion of nonstandard precedence constraints.)
Figure 6.5. Edit Lag Dialog Box
The Table View displays project data in a tabular format. Some of the columns are
editable (white background) while other columns, which are computed by the proce-
dure, are not editable (gray background). The Gantt View always displays the early
start schedule of the project. In addition, it also displays the resource-constrained
schedule (if resources are present), the actual schedule (if the project has started and
is in progress), and the baseline schedule (if a baseline schedule is saved for the
project.) The display of all the schedule bars (except the Early Schedule bar) can be
toggled on or off using the pop-up menu from the Gantt View.
Note that each row of the combined Table View and Gantt View represents one ac-
tivity (also referred to as task in this chapter). Any change in data or movement of a
row in one view is also reected in the other.
In addition to the pull-down and pop-up menu actions, several drag-and-drop type of
actions are available within the PM Window. You can move the columns and rows
of the Table View by selecting a row or column and dragging to the desired position.
You can also change the width of the columns by dragging the column dividers in the
Table header region.
You can manipulate the durations of the tasks using the Task Information dialog box
shown in Figure 6.6 or by changing the length of the Early Schedule bar in the Gantt
View. You can also move the task in time by dragging the Early Schedule bar to a
new position. This affects the Target Date for the associated task.
702

Chapter 6. The PM Procedure
Figure 6.6. Task Information Dialog Box
Any of the preceding tasks may result in a change to the project schedule that is
immediately reected in the Table and Gantt Views. All editing abilities and the cor-
responding changes to the schedule are described in detail in the following sections.
Project Hierarchy
The PM procedure displays a hierarchical project structure if it is invoked with the
PROJECT statement. If the procedure is invoked without a PROJECT statement, the
supertask and subtask relationship is not supported, and all the activities are consid-
ered to be at the same level, belonging to a single project. Note that, in the PROJMAN
application, the PM procedure is always invoked with the PROJECT statement.
If the PROJECT statement is used, then a tasks level in the project hierarchy is
indicated in the Table View by using small square boxes to the left of the activity
number in the Job Nbr. column. Empty boxes indicate that the activity does not
have any subtasks (it is a leaf activity), while lled boxes indicate that the activity is
a supertask. Further, a Project Summary task is included to represent the root task
(or Summary Task) of the project. This task is positioned at the top of the list of
activities, and its display can be toggled on or off by selecting Display Summary
Task from the View pull-down menu (see Figure 6.7).
Figure 6.7. View Pull-down Menu
In the Gantt View, supertasks are indicated by vertical cones at the end of their corre-
sponding schedule bars.
Table View

703
Note that the durations of the supertasks are determined by the overall duration of
their subtasks. Thus, you cannot change the duration of a supertask.
If there is no PROJECT statement, all menu selections that correspond to the multi-
project structure are grayed out and are unavailable for selection. For example, the
Display Summary Task selection in Figure 6.7 will be grayed out.
Table View
The Table View displays information about a project in tabular form. It displays
activities along with their descriptions, various activity schedules, resource require-
ments, calendars, and target dates. The hierarchical information about an activity is
provided in the Job Nbr. column by a number of small square boxes to the left of
the activity number. The number of square boxes corresponds to the level of the ac-
tivity in the project hierarchy. Empty boxes indicate that the activity does not have
any subtasks or that it is a leaf activity, while lled boxes indicate that the activity
is a supertask. Some columns in the Table View are editable while others are write-
protected. The editable columns are lighter in color than the noneditable ones. In
general, you can type into all columns that provide input to the project, while all
other columns that contain output values from PROC PM are write-protected. For
example, in Figure 6.2, the WBS Code column cannot be edited, while the Activity
and Duration columns can be edited.
In the Table View, you can add or delete activities, add subtasks, change the order
of the columns or the activities, edit activity information, and so on. These tasks are
described in the following sections.
Add/Copy/Delete Tasks
Clicking the right mouse button on any task in the Table View displays the pop-
up menu shown in Figure 6.8. From this pop-up menu, you can Add/Copy/Delete
the selected task. If the Add Task menu item is selected, the new task is added
immediately following the selected task. If the PM procedure is invoked with the
PROJECT statement (as is always the case if you use PROJMAN), you can also add
a subtask to the selected task. If the Copy Task menu item is selected, a copy of the
selected task is added to the bottom of the Table View. The new task has the same
duration and calendar as the selected task. If the selected task is a supertask, all its
subtasks (and any internal precedence constraints) are copied as well.
Figure 6.8. Table View Pop-up Menu
704

Chapter 6. The PM Procedure
Change Column Width
The width of a column in the Table View can be increased or decreased by dragging
(with the left mouse button) the column dividers in the Table Header region of the
Table View. When the cursor is positioned on the column divider, it changes to a
double arrow. Dragging it to the right or left increases or decreases the width of the
column.
Change the Order of the Columns
The display order of columns in the Table View can be changed in several ways:
Drag the column in the header row and drop it to the destination.
Select View from the pull-down menu and then choose Move Columns to Left
(see Figure 6.9). Choosing any of the available options moves the correspond-
ing columns to the leftmost portion of the Table View.
Figure 6.9. Move Columns Pull-down Menu
Edit Durations
To change the duration of an activity, edit the Duration column in the Table View.
Note that changing an activitys duration to 0 changes the activity into a Milestone.
Activity durations can also be changed in the Gantt View.
Edit Alignment Constraints
Scroll to columns named Target Date and Target Type. Enter one of either SGE, SLE,
MS, MF, FGE, or FLE in the Target Type column. You can either type the values or
select them from the pop-up menu displayed by pressing the right mouse button in
the Target Type column (see Figure 6.10). Enter the appropriate date in the Target
Date column. You can also view these columns by selecting View->Move Columns
to Left->Target Dates from the pull-down menu (Figure 6.9). You can also change
an activitys alignment constraints in the Gantt View.
Table View

705
Figure 6.10. Target Type Pop-up Menu
Edit Calendars
To change an activitys calendar, you can enter the calendar number in the Activity
Calendar column or the calendar description in the Calendar Name column. Note
that the calendars that can be assigned to an activity are predened in the Calendar
data set. To see a list of the calendars, you can click in one of the calendar columns
with the right mouse button. This will pop up a list of calendars, from which you can
select the activitys calendar. See Figure 6.11 for an example of a calendar pop-up
menu with two calendars.
Figure 6.11. Calendar Pop-up Menu
Edit Resource Requirements
You can change the amount of resources required for an activity by editing the
Resource columns in the Table View. Changing the resource requirement causes
the project to be rescheduled using the new resource specications. See the Edit
Resource Requirements section on page 715.
Edit Progress Information
You can edit the actual start, actual nish, percent complete, or remaining duration
for an activity by editing one of the Progress Information columns in the Table View.
Note that by changing one of these columns, all the other related progress columns
may also be affected. For example, entering 100 in the Percent Complete column
for an activity that is in progress updates the Remaining Duration column to 0, and
the Actual Finish column is lled in appropriately. You can also modify the progress
information of an activity in the Gantt View.
Expand/Collapse Supertasks
Double-clicking on a supertask in the Table View toggles the expand/collapse switch.
This action enables you to either view or hide all the subtasks of the supertask.
706

Chapter 6. The PM Procedure
Hide Tasks
An individual task can be hidden by clicking the right mouse button over the task
in the Table View and choosing Hide from the menu shown in Figure 6.8. Tasks
can also be hidden from view using several lters described in the Setting Activity
Filters section on page 716.
Move Tasks
Drag with the left mouse button anywhere in the row corresponding to an activity you
want to move and drop it to the destination.
Gantt View
In the Gantt View, activity schedules are pictorially depicted by horizontal bars. There
is one bar for each of the early, resource, actual, and baseline schedules. For the Early
Schedule bar, critical activities are marked in different colors than the noncritical
activities. Weekends are marked by shaded vertical rectangles running through the
chart. Supertasks are differentiated from leaf activities by anchoring vertical cones at
the ends of their Early Schedule bars.
The Gantt View is displayed with a rectangular grid that can be turned on or off by
selecting Grid from the pop-up menu (see Figure 6.12) that is displayed by clicking
anywhere outside of the schedule bars in the Gantt View with the right mouse button.
Figure 6.12. Gantt View Pop-up Menu
The pop-up menu in the Gantt View also enables you to toggle the display of the
Actual, Resource, or Baseline Schedule bars. Note that these bars can be displayed
in the Gantt View only if the project data contain the actual, resource-constrained, or
baseline schedules, respectively.
In addition to displaying the activity schedules in an easy-to-view format, the Gantt
View in the PM Window can also be used to change the durations of the activities,
add or delete precedence constraints, set activity alignment constraints, set progress
information, and provide access to calendar, precedence, and resource information.
You can also change several of the display attributes of the Gantt View by using the
Time Axis pop-up menu (see Figure 6.13) to set the scale of the axis, format the time
axis labels, set the units of display, and so forth. All of these tasks are described in
the following sections.
Figure 6.13. Time Axis Pop-up Menu
Gantt View

707
Change the Format of the Time Axis
The format of the major axis can be changed by clicking with the right mouse button
on the header row of the Gantt View and choosing Format for the major axis. For
the minor axis, choose Format Minor. The selections available for the formats are
shown in Figure 6.14 and Figure 6.15. In addition to the formats explicitly listed for
the major axis, you can specify any valid numeric format by selecting Other... and
lling in the appropriate elds in the dialog box that is opened as a result.
Figure 6.14. Major Axis Format Pop-up Menu
Figure 6.15. Minor Axis Format Pop-up Menu
Change Increments
Increments in the Gantt View dene the number of tick marks on the minor axis
per tick mark on the major axis. They can be changed by clicking with the right
mouse button on the header area and choosing Increment from the pop-up menu.
The available selections are shown in Figure 6.16.
Figure 6.16. Increment Pop-up Menu
Change the Scale of the Time Axis
Point the mouse to a tick mark on the major axis in Gantt View. The cursor changes
to a double arrow. Drag the tick mark horizontally to change the scale. You can also
change the scale using the Scale pop-up menu (see Figure 6.17) from the Time Axis
pop-up menu.
708

Chapter 6. The PM Procedure
Figure 6.17. Scale Pop-up Menu
Change Units
The Time Axis Units in the Gantt View can be changed by clicking with the right
mouse button on the header bar in the Gantt View and selecting Units (see Figure
6.18). The default value of the units used for display is based on the specication of
the INTERVAL= parameter in the invocation of the PM procedure.
Figure 6.18. Units Pop-up Menu
Display/Hide Selected Schedules
A display/hide switch for a given schedule can be toggled by clicking with the right
mouse button in the main panel of the Gantt View and choosing the desired schedule
(see Figure 6.19).
Figure 6.19. Gantt View Pop-up Menu
Display Task Information
You can display detailed information for an activity by right-clicking on any of its
schedule bars and selecting Task Information from the resulting pop-up menu (see
Figure 6.20).
Figure 6.20. Schedule Bar Pop-up Menu
Gantt View

709
The ensuing Task Information dialog box (see Figure 6.21) displays the job number,
duration, duration units, a list of predecessor activities, and a list of successor activi-
ties, as well as applicable calendar and resource information for the selected activity.
You can also edit the activity duration from the Task Information dialog box.
Figure 6.21. Task Information Dialog Box
If any calendars have been dened to the project, the activity calendar is also dis-
played. If the project utilizes any resources, there is a list box that lists the resources
required by the activity (see Figure 6.22). Selecting a resource from this list box
displays the quantity required by the activity in the Req eld. Furthermore, if the
selected resource drives the duration of the activity, then the appropriate work value
is also displayed in the Work eld.
Figure 6.22. Task Information Dialog Box (Calendar and Resources)
Modify Activity Alignment Constraints
An activitys Early Schedule bar can be moved using the left mouse button. When
the mouse is positioned over the activity bar, the cursor changes to a cross-hair type.
You can then drag the bar horizontally and move it to a new position. This sets an
alignment constraint of type SGE for the selected activity with the align date corre-
sponding to the one at the left edge of the bars new position. Other types of align-
ment constraints can be entered by editing the Target Date and Target Type columns
as described in the Edit Alignment Constraints section on page 704.
710

Chapter 6. The PM Procedure
Modify Durations
You can modify the duration of an activity in several ways. In the Gantt View, you can
enter it directly using the Task Information dialog box as described in the Display
Task Information section on page 708, or change it indirectly by altering the width
of the schedule bar. To change the duration of an activity, point to the right edge of
the activitys Early Schedule bar with the left mouse button, and drag to the left or
the right depending on whether you want to decrease or increase the duration. You
can also edit activity durations in the Table View.
Modify Precedence Information
You can add precedence constraints by depressing the left mouse button at either end
of the predecessor activity bar and releasing it at either end of the successor activity
bar. The type of constraint (FS, FF, SS, or SF) depends on which end of the bars the
constraints are drawn from.
You can delete precedence constraints by clicking on the arc with the right mouse
button and selecting Delete (see Figure 6.23).
Figure 6.23. Arc Pop-up Menu
You can modify the type of the precedence constraint or the lag value associated
with the precedence constraint by clicking on the arc with the right mouse button and
selecting Edit Lag. The ensuing dialog box is shown in Figure 6.24. Enter the value
of the lag duration in the rst eld and the type of the lag in the second eld. Valid
values of lag are Finish-to-Start (FS), Start-to-Start (SS), Start-to-Finish (SF), and
Finish-to-Finish (FF).
Figure 6.24. Edit Lag Dialog Box
If calendars are dened in the project, the Edit Lag dialog box includes the lag cal-
endar associated with the selected precedence constraint. You can change the lag
calendar by selecting from the list of available calendars that is displayed within the
Edit Lag dialog box shown in Figure 6.25.
Creating and Editing Projects

711
Figure 6.25. Edit Lag Dialog Box (Multiple Calendars)
Modify Progress Information
To modify the Progress using the Gantt View, you must include the Actual Schedule
in the view. You can drag the actual schedule bar for the activity to change the amount
of progress on the activity; you can also move the activitys actual bar to change the
Actual Start of the activity.
When the project contains progress information, a Timenow line is drawn in the Gantt
View, indicating the TIMENOW date. You can move the Timenow line by dragging
it. When you change the value of TIMENOW, the progress information changes for
all the activities. A conrmation window requires you to conrm that you do want
to change the progress information for all the activities. (See also the TIMENOW
Macro Variable section on page 721.)
You can also edit the progress columns in the Table View.
Creating and Editing Projects
The PM Window provides an easy-to-use interface to enter basic project information
such as a list of activities, their durations, order of precedence, resource requirements,
and so forth. You can also use the Edit pull-down menu (see Figure 6.26) to add or
delete progress, baseline, and other information. All these functions are described in
the following sections.
712

Chapter 6. The PM Procedure
Figure 6.26. Edit Pull-down Menu
Add Activities
An activity (or task) can be added to the Project in the PM Window by clicking the
right mouse button in the Table View. If Add Task is chosen from the pop-up menu,
then an activity is added at the same level as the selected activity. Subtasks of an
activity can be added by selecting Add Subtask. These actions are also available
from the Edit pull-down menu (Figure 6.26) whenever an activity is selected in the
Table View. Note that the selected activity is highlighted.
To add a new task at the topmost level of the project hierarchy, choose New Task
from the Edit pull-down menu.
Add Precedence Constraints
To add precedence constraints, point the cursor at the right edge of the predecessor
activity until it changes to a cross-hair and drag it vertically up or down to the left edge
of the successor activity. By starting and dropping at different ends of the activity bar,
you can create nonstandard precedence relationships between the activities. You can
view the predecessor and successor tasks for an activity from the Task Information
dialog box.
Add Baseline Information
Baseline information is saved in a project so that the current status of a project can be
measured against some base schedule. The baseline information can be set in several
different ways; most of the actions relating to the Baseline schedule can be performed
using the selections available from the Edit pull-down menu (see Figure 6.26).
If the project data include a Baseline schedule, saved in the variables B

START
and B

FINISH, the PM Window displays the Baseline schedule when it is rst


invoked. This schedule can be replaced by choosing Replace Baseline from
the Edit pull-down menu. This selection can be used to reset the Baseline
schedule to a new schedule corresponding to one of the current schedules.
Creating and Editing Projects

713
If the project data do not include a Baseline schedule, it can be set in the
PM Window by selecting Set Baseline from the Edit pull-down menu (see
Example 6.3). This selection can be used to set the Baseline schedule to one
of the current schedules (see Figure 6.27). Thus, selecting Resource from the
pull-down menu sets the baseline schedule to the current resource-constrained
schedule. By saving the current resource-constrained schedule, you can per-
form some what-if analysis by changing some of the resource requirements or
other parameters of the project and comparing the resulting schedule with the
saved baseline schedule.
Figure 6.27. Set Baseline Pull-down Menu
The individual Baseline values can also be edited in the Table View by chang-
ing the values in the Baseline Start and Baseline Finish columns.
If new activities are added to the project, the Baseline values for the new tasks
are missing. These can be set to correspond to the current schedule values by
selecting Fill Missing Baseline from the Edit pull-down menu.
If you want to delete the Baseline information from the project data, you can
select Delete Baseline from the Edit pull-down menu.
Add Progress Information
Progress information can be included by using the ACTUAL statement, which is sim-
ilar to the one for PROC CPM. If the PM Window is invoked without the ACTUAL
statement, then progress information can be added to the Project from the Edit pull-
down menu (Figure 6.26) by choosing Add Progress.
Progress information is updated by dragging the actual schedule bars horizontally (in
a manner similar to the one for changing durations) in the Gantt Viewor by modifying
the values in the Progress columns in the Table View. See the Modify Progress
Information section on page 711 and the Edit Progress Information section on
page 705.
For details on how the progress information is used to update the project schedule, see
the Progress Updating section on page 122 in Chapter 2, The CPM Procedure.
See also Example 6.6.
714

Chapter 6. The PM Procedure
Change Duration
The duration of an activity can be directly changed from the Duration column of the
Table View or the Task Information dialog box of the Gantt View. It can also be
indirectly changed by dragging the activity bar at the right edge using the left mouse
button in the Gantt View.
Copy Activities
An activity (or task) can be copied in the PM Window by clicking the right mouse
button in the Table View. If Copy Task is chosen from the pop-up menu, then a
copy of the selected activity is added at the end of the activities listed in the Table
View. The new task has the same duration and calendar as the selected task. If the
selected task is a supertask, all its subtasks (and any internal precedence constraints)
are copied as well.
Create Milestones
Milestones can be created by adding an activity and assigning it zero duration.
Create Nonstandard Precedence Relationships
A Finish-to-Start relationship between two activities is considered to be a standard
precedence constraint. It is created when the precedence constraint is drawn by drag-
ging the cursor from the right end of the predecessor activity bar to the left end of
the successor activity bar. Nonstandard precedence constraints are created by starting
and ending at different ends of the two activity bars. For example, a Start-to-Finish
relationship is created by dragging the cursor from the left end of the predecessor
activity bar to the right end of the successor activity bar.
In addition to specifying the type of the precedence constraint, you can also specify
a lag or lead time between the two activities. This lag value can be edited from the
Gantt View. See the Modify Precedence Information section on page 710.
Create Subtasks
Subtasks can be created only if the PM procedure is invoked with the PROJECT
statement or from the PROJMAN application. To create a subtask, click the right
mouse button on the parent activity in the Table View. Then choose Add Subtask
from the background menu. The newly created subtask has one more little square
box than the parent task in the Job Nbr. column in the Table View. The empty square
boxes denote that it is a leaf activity (a task with no subtasks). The number of boxes
denote a tasks level in the project hierarchy, starting with level 0 for the Project
Summary task.
Delete Activities
An activity can be deleted in the Table View by clicking the right mouse button any-
where in the task row and choosing Delete Task. If the selected task is a supertask,
all its subtasks are deleted as well. Note that, in this case, a conrmation dialog box
conrms the Delete Supertask action.
Creating and Editing Projects

715
Delete Precedence Constraints
To delete a precedence constraint, click anywhere on the arc with the right mouse
button and choose Delete from the pop-up menu. You can view the predecessor and
successor tasks for an activity from the task information window.
Edit Activity Alignment Constraints
Activity alignment constraints can be added/modied as described in the Edit
Alignment Constraints section on page 704 and in the Modify Activity Alignment
Constraints section on page 709.
Edit Baseline Information
To edit the baseline schedule, scroll to the Baseline Start and Baseline Finish
columns, and type in the new values of the baseline start and nish times. Note
that you cannot change the baseline values by moving the Baseline Schedule bars.
See the Add Baseline Information section on page 712.
Edit Calendar Specications
Calendars are dened by the CALEDATA= option in the PROC PM statement. This
option is similar to the corresponding option in PROC CPM. Once calendars are
dened in the Project, an activitys calendar can be changed or set in the Table View
by editing the Activity Calendar or Calendar Name columns. You can either type the
values or select them from the pull-down menu displayed by pressing the right mouse
button in either of the Calendar columns. See the Edit Calendars section on page
705. You can also view the activity calendar from the task information window.
Edit Resource Requirements
The resource requirement information for each activity is displayed and can be edited
in the Table View. A column for a resource is created in the Table View when it is
specied in the RESOURCE statement of the PROC PM invocation, or it is created
by the Resource Manager of PROJMAN. For details about the RESOURCE state-
ment, the Resource data set, and Resource Allocation, see Chapter 2, The CPM
Procedure. Changing the resource requirement causes the project to be rescheduled
using the new resources. You can also view the resource requirements for an activity
from the task information window.
If alternate resources are used by the scheduling algorithm, an extra set of columns
is added to the Table View. These columns (one for every resource in the project)
display the resources that were actually used. These Usage columns for the resources
cannot be edited.
716

Chapter 6. The PM Procedure
Setting Activity Filters
Activity lters can be set by using the project hierarchy or by selecting from a list of
activity attributes, as described in this section.
Figure 6.28. View Pull-down Menu
Activities at different levels in the hierarchy can be viewed by selecting View from
the pull-down menu (Figure 6.28) and choosing the appropriate level of the project
hierarchy to lter out the higher level tasks. For example, selecting Level 2 Tasks
displays only the tasks that are at Level 2 or lower. All activities can be viewed by
selecting Tasks at All Levels from the View pull-down menu.
Activities can also be ltered using different criteria by choosing View->Filters from
the View pull-down menu (see Figure 6.28). The available lters are shown in Figure
6.29. By default, no lter is in effect (the selection is None); you can save the lter
of your choice in the Preference data set (see the Saving and Restoring Preferences
section on page 716).
Figure 6.29. Filters Pull-down Menu
Saving and Restoring Preferences
When the PM Window is displayed for the rst time for a given project, the order
and width of the columns in the Table View, the font used for the display, the size
of the window, the boundary between the Table and the Gantt Views, and several
other attributes of the display are determined by the procedure. As you add activities
and edit the Table View, you can change some of these attributes according to your
preference. You can also choose a different level of display or set some activity lters
(see the Setting Activity Filters section on page 716).
Setting the Project Font

717
PROC PM enables you to save the attributes of the display in an indexed data set
that is specied in the PROC PM statement, using the PROJECT= option. You can
use this data set to save display preferences such as the font, column order, column
widths, lters, and so forth. See the Project Data Set section on page 721 for details
regarding the format of this data set.
You can save and restore the preferences from the Project pull-down menu, which
contains the Preferences submenu (Figure 6.30). Note that you have to explicitly
save the project preferences using the Save selection from this pull-down menu.
Closing the PM Window saves only the activity data of the project; it does not auto-
matically save the project preferences. When you restore preferences, the state used
is the one that was last saved for the project in the specied preference data set.
Figure 6.30. Preferences Pull-down Menu
Sorting Activities
Activities can be sorted by activity number, early start, late start, and resource start by
choosing Project->Sort from the Project pull-down menu (see Figure 6.31). Once
the activities are sorted, the Schedule output data set contains the activities in the new
sorted order. See the Renumbering the Activities section on page 718.
Figure 6.31. Sort Pull-down Menu
Setting the Project Font
When the PM Window is rst displayed, the font used in all the text areas of the
window is the same as the SAS font used in other windows. You can use the Fonts
selection in the Project pull-down menu (Figure 6.32) to change the font used in the
PM Window. You can choose various fonts and their sizes from the font manager
thus obtained. This font can also be saved (and restored) in the Project data set.
718

Chapter 6. The PM Procedure
Figure 6.32. Project Pull-down Menu
Renumbering the Activities
When the PM Window is rst displayed for the specied project, the activities are
listed in the order in which they are dened in the Activity data set. The activity
numbers displayed in the Job Nbr. column correspond to this same order. Even
if the activities are rearranged, either by moving selected activities or by sorting,
these numbers do not change. Likewise, no renumbering takes place automatically if
activities are deleted from the project.
You can use the Renumber selection in the Project pull-down menu (Figure 6.32)
to reassign consecutive numbers to the activities, starting from the rst activity dis-
played.
When you close the PM Window, saving all the activity information to the Schedule
data set, the activities are numbered according to the order in which they were dis-
played at the end of the editing session. In other words, the Close action implicitly
invokes the Renumber command on the project activities. These activity numbers
are, in fact, saved as the values of the ACTID variable (see the Schedule Data Set
section on page 719).
Printing
The PM Window provides functionality to print the Gantt View, the Table View, or
both, provided that a printer has been selected and the correct information has been
set in the Printer Setup Window. For more information on setting up the printer
options, see the SAS companion for your operating environment or contact the SAS
Support Consultant at your site for further instructions. Print Preview can be used
to view the information before printing, and the printed output can be saved to a le.
All the printing functions are available from the File pull-down menu (Figure 6.33).
Figure 6.33. File Pull-down Menu
Schedule Data Set

719
Preview the Printed Output on the Screen
You can view the printed output on screen before actually printing it by selecting
Print Preview from the File pull-down menu.
Print Options
Select Print Options from the File pull-down menu. There are options for selecting
time and activity axis range and scaling of the printed output. See Figure 6.34.
Figure 6.34. Print Options Dialog Box
Save the Printed Output to a File
The printed output can be saved to a le by selecting File->Print ->Print to File.
Details
The computation of the schedule, the resource constrained scheduling algorithm,
the resource usage information, and all other aspects of the scheduling engine for
PROC PM are the same as the ones for PROC CPM. Refer to Chapter 2, The CPM
Procedure, for details. A few minor differences in the content of the Schedule out-
put data set and the Project data set (not available in PROC CPM) are described in
the following sections.
Schedule Data Set
The Schedule data set produced by PROC PM is very similar to the Schedule data
set produced by PROC CPM. See the OUT= Schedule Data Set section in the PROC
CPM chapter.
However, unlike PROC CPM, the PM procedure is interactive in nature, enabling
you to add activities, set precedence constraints, reorder the activities, and so on.
Thus, the output data set produced by PROC PM is designed to capture the original
project data as well as all the changes that are made to the project in the course of the
interactive session.
There are several main differences between the forms of the Schedule output data sets
produced by the PM and CPM procedures:
720

Chapter 6. The PM Procedure
The PM procedure automatically includes all relevant variables that are
needed to dene the project. Thus, the ACTIVITY, SUCCESSOR, LAG,
DURATION, ALIGNDATE, and ALIGNTYPE variables are included in the
output data set by default. If the RESOURCE statement is used, all the re-
source variables are also included. Likewise, if actual progress is entered for
the project during the course of the interactive session, all the progress-related
variables are added to the output data set.
The PM procedure contains three sets of observations, identied by three dif-
ferent values of a new variable, OBS

TYPE. The rst set of observations


contains one observation for every activity in the project. The value of the
OBS

TYPE variable for these observations is SCHEDULE. These obser-


vations contain all the activity information such as the duration, the start and
nish times, the resource requirements, and so forth. The second set of obser-
vations contains one observation for every precedence constraint in the project.
The value of the OBS

TYPE variable for these observations is LOGIC.


These observations contain all the precedence information such as the activ-
ity, successor, and lag information.
The third set of observations is present only if the project has resource-driven
durations. The value of the OBS

TYPE variable for these observations is


WORK. These observations specify the WORK value for each resource used
by each activity in the project.
The order of the activities in the Schedule data set produced by PROC PM
corresponds to the order in which the activities appear in the Table View at the
end of the interactive session. Likewise, when the procedure is rst invoked,
the order of the activities in the Table View corresponds to the order in which
the activities are dened in the Activity input data set. If, during the course
of the session, some of the activities are reordered or deleted, or if some new
activities are added, the Schedule output data set contains all the activities that
are dened in the Table View at the end of the session.
The PM procedure also assigns a numeric identier for each activity. These
values are assigned by PROC PM consecutively in the order of the activities in
the Table View and saved in a variable called ACTID (see the Renumbering
the Activities section on page 718). In addition to the ACTID variable, the
Schedule data set also contains a numeric variable called SUCCID, which con-
tains the numeric identier for the successor activities in the observations for
which OBS

TYPE=LOGIC. If the PROJECT statement is used in the invo-


cation of the PM procedure, a numeric variable called PNTID is added to the
Schedule data set; this variable identies the parent task for each activity.
Note: If the ACTIVITY variable in the Activity input data set is a char-
acter variable, the ACTID, SUCCID, and PNTID variables are added to
the Schedule data set in addition to the ACTIVITY, SUCCESSOR, and
PROJECT variables. On the other hand, if the ACTIVITY variable in the
Activity input data set is numeric, the newACTID, SUCCID, and PNTIDvari-
ables replace the numeric ACTIVITY, SUCCESSOR, and PROJECT vari-
ables, respectively.
TIMENOW Macro Variable

721
Project Data Set
The Project data set is used to save and restore preferences that control the project
view. The following preferences can be saved from one invocation to another:
text font
time increment
time units
major time axis format
minor time axis format
schedule bars displayed (for example, Actual, Baseline, and so forth)
chart grid
chart scale
table column widths
table column order
Table View-Gantt View dividing line
activity lters
activity level
project summary
window dimensions
The Project data set uses three variables to save the preference information:
PROJATTR contains a keyword identifying the project attribute; each at-
tribute has either a numeric value or a character value. The length of this vari-
able is 8.
PRATNVAL used for numeric data corresponding to the attribute.
PRATCVAL used for character data corresponding to the attribute. The
length of this variable is 200.
Note that the Project data set is used internally by the PM procedure and is not de-
signed to be altered or edited directly. Its contents may not be meaningful except to
the PM procedure.
TIMENOW Macro Variable
The PM Window can be used to add and edit progress information to a project. When
progress information is added, the Schedule data set contains all the Progress vari-
ables; see the Progress Updating section on page 122 in Chapter 2, The CPM
Procedure.
722

Chapter 6. The PM Procedure
However, all the values of the progress variables are reconciled and revised on the
basis of the value of the TIMENOW parameter. Since the PM procedure enables you
to move the TIMENOW line as well as implicitly change the value of TIMENOW by
updating the Actual Start or Finish times of the activities, the value of TIMENOW at
the end of the editing session is an important parameter of the project. This value is
saved in a macro variable called TIMENOW and can be used in subsequent editing
sessions of the same project. See Example 6.6 for an example of the use of the
TIMENOW macro variable.
Microsoft Project Data Conversion
There are two SAS macros, MDBTOPM and MP2KTOPM, that are available for
converting Microsoft

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. Following a successful conversion, each of these macros proceeds
to invoke an instance of the PM procedure using values for the relevant options that
were determined during the course of the data conversion. Execution of these macros
requires SAS/ACCESS software.
MDBTOPM is a SAS macro that converts Microsoft Project 98 data saved in MDB
format to a form that is readable by the PM procedure. The MDBTOPM macro has
two arguments: one that species the location of the .MDB le and another that
species the location of the directory for storing the SAS data sets.
MP2KTOPM is a SAS macro that converts Microsoft Project 2000 data saved in
MDB format to a form that is readable by the PM procedure. The MP2KTOPM
macro has three arguments: one that species the location of the .MDB le, one that
species the location of the directory for storing the SAS data sets, and an optional
numeric third argument that controls the mode of the PM procedure invocation. A
nonzero value invokes the PM procedure in the default interactive mode and a value
of zero invokes the PM procedure in noninteractive mode.
The following SAS data sets are generated by the conversion macros:
Activity data set
Calendar data set
Holiday data set
Workday data set
Resource data set
Preferences data set
The MDBTOPM and MP2KTOPM macros convert the hierarchical relationships,
precedence relationships, time constraints, resource availabilities, resource require-
ments, project calendars, resource calendars, holiday information, workshift infor-
mation, actual start and nish times, and baseline start and nish times. In addition,
the notes and cost elds are also extracted and stored in the Activity data set.
Example 6.1. Dening a New Project

723
Note: In order to retain the values of the options used to invoke the PM proce-
dure, you will need to save the preferences by choosing Preferences->Save from
the Project pull-down menu.
Examples
This section illustrates some of the interactive features of PROC PM using a few
simple examples that lead you through different stages of entering and editing project
data. A simple software development project is used in all the examples. The output
data set from one example is used as input to the next example. Where necessary,
additional data sets are created, or the input data set is modied using simple DATA
step code.
You could also use PROJMAN to create the software project and then proceed to each
succeeding example using the application to dene the calendars, resources, and so
forth. The PROJMAN application automatically manages the required data sets.
Example 6.1. Dening a New Project
In this example, a simple software development project is built from scratch, starting
with an empty Activity data set. PROC PM is invoked with an Activity data set that
has no observations and just a few variables that are required to start the procedure. In
addition to the Activity data set, a Project data set is also dened that is used to save
the display attributes of the PM Window to be used between successive invocations of
the procedure. The following program invokes PROC PM and opens a PM Window
that enables you to enter project data. The initial window is shown in Output 6.1.1.
Note that the PROJNAME= option is used in the PROC PM statement. This value
is used to label the PM Window. Also specied in the PROC PM statement is the
PROJECT= option that identies the project attribute data set. The activities in the
project follow a weekday calendar which is indicated to PROC PM by specifying the
INTERVAL=WEEKDAY option. In the PM Window, the weekends are shaded gray
in the Gantt View.
/* Initialize the Activity data set */
data software;
length activity $20.;
input activity $ actid succid pntid duration;
datalines;
;
data softattr;
length projattr $8. pratcval $200.;
input projattr pratnval pratcval;
datalines;
;
724

Chapter 6. The PM Procedure
proc pm data=software project=softattr
date=1mar04d interval=weekday
projname=Software Project
out=softout1;
act actid;
succ succid;
project pntid;
duration duration;
id activity;
run;
Output 6.1.1. Initial PM Window
In the PM Window, enter the following tasks with the corresponding durations in the
Table View:
Design 5
Develop 10
Document 8
Test 8
Ship 0
As each task is entered, the Schedule columns in the Table View are updated with
the early and late start times, and the Early Schedule bars appear in the Gantt View.
Output 6.1.2 shows the PM Window after the ve tasks have been entered. To view
the Schedule columns, you can scroll the Table View to the right or use the View
pull-down menu (Figure 6.7) to move the Schedule columns to the left.
Example 6.1. Dening a New Project

725
Output 6.1.2. List of Tasks in the Software Project
To enter precedence constraints between two activities, such as Design and
Develop, draw an arc, using the left mouse button, from the end of the predecessor
task to the beginning of the successor task. Use the Gantt View to enter the following
precedence constraints:
Design --> Develop
Design --> Document
Develop --> Test
Test --> Ship
726

Chapter 6. The PM Procedure
Output 6.1.3 shows the Software Project as the last precedence constraint is being
drawn. Note that, in this view of the PM Window, the Schedule columns have been
moved to the left, the grid lines in the Gantt View have been turned off (using the
menu in Figure 6.12), and the Gantt View has been scrolled to the right to bring the
end of the schedule bar for Test into view.
Output 6.1.3. Drawing Precedence Constraints
To check the overall project status, you can bring the Project Summary task into view
by selecting Display Summary Task from the View pull-down menu (Figure 6.7).
Note that the project duration is 23 days. The Summary Task is indicated by vertical
cones at the end of its schedule bar.
Example 6.1. Dening a New Project

727
For the next few examples, the units used in the Gantt View are changed to Weeks
using the Axis pop-up menu shown in Figure 6.13, the Summary Task is displayed at
the top of the list of activities, and the Activity description columns are shown in the
Table View. To save these window settings in the Project data set, select Project->
Preferences->Save from the Project pull-down menu. The view of the project cor-
responding to these settings is shown in Output 6.1.4. You can end the interactive
editing session by closing the window. All the activity and precedence information
is saved in the output data set, SOFTOUT1, displayed in Output 6.1.5. Note the two
sets of observations in this data set: the rst contains all the schedule information
for all the activities, and the second lists all the precedence relationships between
activities.
Output 6.1.4. Project Schedule
728

Chapter 6. The PM Procedure
Output 6.1.5. Schedule Data Set
Schedule Data Set
O P P W d a S
B R R B u c U
S O O S S r P t C
_ P J J _ A U a A i C
T N _ _ C C C t R v E
O Y T D L O T C i E i S
b P I U E D I I o N t S
s E D R V E D D n T y R
1 SCHEDULE . 23 0 0 0 . 23 Project Summary
2 SCHEDULE 0 . 1 0.0 1 . 5 Project Summary Design
3 SCHEDULE 0 . 1 0.1 2 . 10 Project Summary Develop
4 SCHEDULE 0 . 1 0.2 3 . 8 Project Summary Document
5 SCHEDULE 0 . 1 0.3 4 . 8 Project Summary Test
6 SCHEDULE 0 . 1 0.4 5 . 0 Project Summary Ship
7 LOGIC . . . 1 2 5 Design Develop
8 LOGIC . . . 1 3 5 Design Document
9 LOGIC . . . 2 4 10 Develop Test
10 LOGIC . . . 4 5 8 Test Ship
A A E L
L L E _ L _ T F E L
G G _ F _ F _ _ E S L S
N N S I S I F F S _ S _
D T T N T N L L _ D _ D
O L A Y A I A I O O A E A E
b A T P R S R S A A S S S S
s G E E T H T H T T C C C C
1 . 01MAR04 31MAR04 01MAR04 31MAR04 0 0 0 0 0 0
2 . 01MAR04 05MAR04 01MAR04 05MAR04 0 0 1 5 1 5
3 . 08MAR04 19MAR04 08MAR04 19MAR04 0 0 2 4 2 4
4 . 08MAR04 17MAR04 22MAR04 31MAR04 10 10 3 3 3 3
5 . 22MAR04 31MAR04 22MAR04 31MAR04 0 0 4 2 4 2
6 . 01APR04 01APR04 01APR04 01APR04 0 0 5 1 5 1
7 . . . . . . . . . . .
8 . . . . . . . . . . .
9 . . . . . . . . . . .
10 . . . . . . . . . . .
Example 6.2. Adding Subtasks to a Project
In this example, the output data set from Example 6.1 is used as input to PROC PM.
The following statements bring up the saved view of the project as shown in Output
6.2.1. Note that this view is identical to the view saved in Output 6.1.4.
proc pm data=softout1 project=softattr
date=1mar04d interval=weekday
projname=Software Project
out=softout1;
act actid;
succ succid;
project pntid;
duration duration;
id activity;
run;
Example 6.2. Adding Subtasks to a Project

729
Output 6.2.1. Project Schedule
In the invocation of PROC PM, the output data set name is the same as the input data
set. Thus, it is possible to make changes to the Activity data set using PROC PM and
then save the results back to the original data set.
In the current view of the Software Project, you want to add some subtasks to the
Design and Develop tasks. Suppose that these two tasks are broken into two
subtasks each, one for Module 1 and the other for Module 2. Further, you want
to remove the precedence constraint between the Design and Develop phases and
add constraints between the respective modules. You can accomplish these tasks by
making the following editing changes in the PM Window.
1. Use the Table View pop-up menu to add the following subtasks to Design:
Module 1: 5 days
Module 2: 3 days
2. Add a link from Module 1 to Module 2.
3. Use the Table View pop-up menu to add the following subtasks to Develop:
Module 1: 6 days
Module 2: 5 days
4. Add a link from Module 1 to Module 2.
5. Remove the link between the supertasks Design and Develop by clicking
on the arc and selecting Delete from the pop-up menu.
6. Add a link from Module 1 under Design to Module 1 under Develop.
7. Add a link from Module 2 under Design to Module 2 under Develop.
730

Chapter 6. The PM Procedure
The resulting project schedule is displayed in Output 6.2.2 and saved in the data set
SOFTOUT1. Note that the new project duration is 24 days.
Output 6.2.2. Project Schedule
Example 6.3. Saving and Comparing Baseline Schedules

731
Example 6.3. Saving and Comparing Baseline Schedules
This example shows you how to save a baseline schedule and use it for comparing
new schedules. Recall that in Example 6.2 the Schedule data are saved in the data
set SOFTOUT1. Thus, the following invocation of PROC PM displays the Software
project in its last saved state (as in Output 6.2.2, but with the WBS codes lled in).
At the end of the editing session, the schedule is saved in the data set SOFTOUT3.
proc pm data=softout1 project=softattr
date=1mar04d interval=weekday
projname=Software Project
out=softout3;
act actid;
succ succid;
project pntid;
duration duration;
id activity;
run;
Use the Edit -> Set Baseline pull-down menu (Figure 6.27) to save the current Early
Schedule as a Baseline Schedule. The resulting display is shown in Output 6.3.1.
Note that the Gantt View now shows the Baseline Schedule, in addition to the Early
Schedule. Also, the activities have been numbered to be sequential in the current
view (see the Renumbering the Activities section on page 718).
Output 6.3.1. Using Baseline Schedules
732

Chapter 6. The PM Procedure
The baseline schedule is useful in determining the effect of changes to the project on
the schedule. For example, suppose there is a directive from the Director of your divi-
sion that all the developers are required to attend a User Interface Standards Meeting
before starting the development of Module 2. This meeting has been scheduled to
start on March 15, 2004 and is expected to take 3 days. What is the effect of this
directive on your project schedule?
To see this, you can make the following changes in the PM Window:
1. Add a new task to the project by selecting New Task from the Edit pull-down
menu.
2. To edit the newly entered task, you may need to scroll down.
3. Type in the name of the task: UI Meeting. Set its duration to 3.
4. In the Gantt View, draw a link from this new task to Task 6 (Module 2 under
Develop).
5. Also in the Gantt View, grab the task, UI Meeting, using the left mouse button
and drag it to the tick mark corresponding to 15Mar04.
The resulting view is shown in Output 6.3.2. Note that the view may differ depending
on the display parameters of your device. It is easy to see that, due to the 3-day
meeting that is mandated, there is a delay in the project schedule (the project duration
is now 26 days).
Output 6.3.2. Effect of UI Meeting on Schedule
Example 6.3. Saving and Comparing Baseline Schedules

733
You can get a complete picture of the effect on the schedule by examining all the
Schedule columns that are shown in the Table View. Output 6.3.3 shows the Schedule
columns, the Baseline columns, and the Target Date and Type columns in the Table
View. To obtain this view, some of the columns have been moved and the Baseline
Schedule bars (in the Gantt View) have been hidden from the display.
Output 6.3.3. Table View Showing all Schedules
If the project delay resulting from the UI Meeting is of concern, you may want to
schedule the meeting on an earlier date. Suppose the revised start date of the meeting
is March 10, 2004. To see the effect of the change, you can do the following:
1. Revert to the saved project preferences so that both the Table and the Gantt
Views are visible.
2. Use the View pull-down menu to move the Target Date column to the left in
the Table View.
3. Scroll down, if necessary, to bring the task UI Meeting into view.
4. Change the Target Date column for this task to 10Mar04.
The resulting view is displayed in Output 6.3.4. Note that, as a result of this change,
all the activities are back on schedule as the new schedule coincides with the saved
baseline schedule. The last activity was dened after the baseline schedule had been
saved in Example 6.2; hence, there is no baseline schedule bar for this activity. You
can use the Fill Missing Baseline selection fromthe pull-down menu shown in Figure
6.26 to set the baseline schedule for the UI Meeting to be the current early schedule.
734

Chapter 6. The PM Procedure
Output 6.3.4. Editing Target Date
Example 6.4. Effect of Calendars
Continuing with the project scenario in the preceding examples, you want to explore
other ways of shortening the project duration. One possible alternative is to work
overtime. As the project manager, you would like to see the effect on the schedule if
you change the calendar for all the development tasks to a six-day calendar.
Calendars are dened using the Calendar data set, as in the CPM procedure.
Alternately, if you are using the PROJMAN application, you can use the Calendars
Window to dene a six-day calendar. This example denes a Calendar data set and
invokes PROC PM as follows. Note that, in order to use calendars, the Activity data
set needs to have a CALID variable, which is added in a simple DATA step.
/* Define a Calendar data set identifying */
/* Saturday as a workday */
data calendar;
input calid calname $ _sat_ $;
datalines;
1 Sixday WORKDAY
;
/* Add the CALID variable to the Activity data set */
data softout3;
set softout3;
calid=.;
run;
Example 6.4. Effect of Calendars

735
/* Use softout3 as the Activity data set and specify */
/* the preceding calendar data set. */
proc pm data=softout3 project=softattr
calendar=calendar
date=1mar04d interval=weekday
projname=Software Project
out=softout4;
act actid;
succ succid;
project pntid;
duration duration;
id activity;
calid calid;
run;
When the PM procedure initializes the PM Window, it attempts to restore all the
display settings using the values in the Project data set, SOFTATTR. However, the
new Activity data set has an extra variable, calid, which leads to two new columns in
the Table View, one for the Activity Calendar (which displays the Calendar ID) and
the other for the Calendar Name. These columns are added at the right end of the
Table View and can be seen by scrolling to the right. The resulting view is displayed
in Output 6.4.1.
Output 6.4.1. Calendar Columns
736

Chapter 6. The PM Procedure
By default, all the activities are assumed to follow the standard ve-day calendar.
Now, you want to change the calendar for the supertask Develop and all its subtasks
to be the six-day calendar dened in the data set CALENDAR. Note that, in the
calendar denition, it is sufcient to specify that Saturday is a working day. All the
other days of the week default to the default calendars work pattern; see the Default
Calendar section on page 116 in Chapter 2, The CPM Procedure.
To facilitate the editing of the calendar values and to see the effect on the project du-
ration, reorder the columns (using the left mouse to drag the columns in the Table
Header) to display the activity, Activity Calendar, Calendar Name, and Duration
columns in the Table View. You may need to move the dividing line between the
Table and Gantt Views.
You can enter the Calendar values by typing the number 1 in the Activity Calendar
column or the value Sixday in the Calendar Name column. You can also use the
Calendar pop-up menu in one of the calendar columns to select the desired calendar
(see Output 6.4.2). Note that the project duration has reduced to 22 days as a result
of the six-day calendar.
Output 6.4.2. Effect of Six-Day Calendar
To see the effect on the individual activities, change the units to Days in the Gantt
View and enlarge the Gantt View, as shown in Output 6.4.3.
Example 6.5. Dening Resources

737
Output 6.4.3. Gantt View of Calendar Effect
Example 6.5. Dening Resources
In all the preceding examples, it was assumed that you had enough resources to work
on the different tasks. Unfortunately, as a project manager you need to schedule your
project using the limited set of resources available to you. In this example, you will
assign some project resources and schedule the project subject to resource constraints.
In order to assign resources to the tasks, you need to add resource variables to the
Activity data set as well as dene a resource availability (Resource) data set.
Suppose that the resources that you are interested in are Tester and Programmer. The
following statements set up the project data needed to perform resource-constrained
scheduling with PROC PM using the output data produced in Example 6.4.
/* Define a Resource data set specifying */
/* 1 Tester and 1 Programmer as the */
/* available resources */
data resources;
input _date_ & date7. Tester Programmer;
datalines;
01jan04 1 1
;
738

Chapter 6. The PM Procedure
/* Add the resource variables Tester and */
/* Programmer to the Activity data set */
/* (the output data set saved in last example) */
data softout4;
set softout4;
Tester=.;
Programmer=.;
run;
/* Use softout4 as the Activity data set and */
/* specify the preceding Resource data set. */
/* Save the schedule in softout5. */
proc pm data=softout4 project=softattr
calendar=calendar
resourcein=resources
date=1mar04d interval=weekday
projname=Software Project
out=softout5;
act actid;
succ succid;
project pntid;
duration duration;
id activity;
calid calid;
resource Tester Programmer / per=_date_;
run;
Output 6.5.1. Adding Resources to the Project
Example 6.5. Dening Resources

739
Output 6.5.1 shows the Table and Gantt Views of the project after rearranging some
of the columns and moving the dividing line to show the resource columns. The
Resource Schedule bars are also brought into display by clicking the right mouse
button over the background in the Gantt View and selecting Resource Schedule. The
Resource Schedule bar is shown between the Early Schedule bar and the Baseline
Schedule bar. Note that the resource schedule coincides with the early schedule be-
cause no resource requirements have been specied for either of the two resources.
You can now use the Table View to enter the resource requirements for each task. Set
the requirement for the resource Tester to 1 for the tasks Document and Test,
and the requirement for the resource Programmer to 1 for the tasks numbered 2,
3, 5, and 6. The resulting schedule is displayed in Output 6.5.2. In this view, the
baseline schedule is not displayed. You can see that several of the tasks have been
delayed, resulting in lengthening the project duration to 29 weekdays.
Output 6.5.2. Editing Resource Requirements
You can set the resource-constrained schedule as a baseline to do some what-if
analysis. For example, suppose you would like to determine the effect of adding
another programmer to the project. In order to change the resource availability, you
need to save the current project, edit the Resource availability data set to add another
programmer, and then reinvoke the PM procedure.
740

Chapter 6. The PM Procedure
First, in the PM Window displayed in Output 6.5.2, do the following:
1. Re-display the Baseline Schedule bar.
2. Use the Replace Baseline selection from the Edit pull-down menu to select
the Resource Schedule as the new baseline schedule.
3. Save the project preferences.
4. Close the PM Window.
Reinvoke PROC PM after dening a new resource availability:
/* Change the resource availability for Programmer to 2 */
data resources;
input _date_ & date7. Tester Programmer;
datalines;
01jan04 1 2
;
/* Use softout5 as the Activity data set and specify */
/* the preceding Resource data set. */
/* Save the schedule back to softout5. */
proc pm data=softout5 project=softattr
calendar=calendar
resourcein=resources
date=1mar04d interval=weekday
projname=Software Project
out=softout5;
act actid;
succ succid;
project pntid;
duration duration;
id activity;
calid calid;
resource Tester Programmer / per=_date_;
run;
Using the new resource availability, you reduced the project duration by ve days.
The resulting schedule is displayed in Output 6.5.3, which also shows the baseline
schedule corresponding to the earlier resource availability data set.
Example 6.6. Editing Progress

741
Output 6.5.3. Comparison of Two Resource Schedules
Example 6.6. Editing Progress
Once a project plan has been established and the project is under way, a major part of
a project managers responsibility is to monitor the project as it progresses. This ex-
ample uses the PM Window to add progress information to the project and discusses
some of the related editing functions.
In the nal window of Example 6.5 (shown in Output 6.5.3), do the following:
1. Delete the baseline schedule using the Edit pull-down menu.
2. From the Edit pull-down menu, select Add Progress.
The resulting display is shown in Output 6.6.1. The Gantt View now shows the Actual
Schedule bar between the Early Schedule bar and the Resource Schedule bar. It
also displays a Timenow Line. Since no progress information has been entered, the
Timenow Line is drawn at the beginning of the project and all the Actual Schedule
bars show only a handle that can be used to drag progress for a particular task.
742

Chapter 6. The PM Procedure
Output 6.6.1. Adding Progress Information to Project
You can enter progress information in several ways:
Drag the Timenow Line to update progress information for several tasks at
once. The actual start and nish times (until the Timenow date) are set assum-
ing that the tasks follow the resource-constrained schedule. (If there are no
resource constraints, the tasks are assumed to follow the early schedule.)
Use the handle on the Actual Schedule bar for a given task to drag the progress
bar using the left mouse button.
Bring the Progress columns into view in the Table View and edit one of the
Progress columns.
As an example, use the left mouse button to drag the Timenow Line to the tick mark
corresponding to 15MAR04. The resulting window (after reordering and resizing
some columns and scrolling the Gantt View) is shown in Output 6.6.2.
Example 6.6. Editing Progress

743
Output 6.6.2. Moving the Timenow Line
Note that some of the activities are completed while others are still in progress. If the
project data are saved at this point, the Schedule data set will have all the Progress
variables (A

START, A

FINISH, PCT

COMP, and REM

DUR). However, for


the PM procedure to be able to recapture the exact state of the schedule as it was
saved, it also needs to know the value of TIMENOW when the project data was last
saved. This value (15Mar04 for the current example) is saved as a macro variable
named TIMENOW (see the TIMENOW Macro Variable section on page 721).
To see how the Actual information can be used from one invocation of PROC PM to
the other, save the project as displayed in Output 6.6.2 and then reinvoke PROCPMto
continue editing the progress information. Note that if you are using the PROJMAN
application, the value of TIMENOW is automatically saved by the application and
used in subsequent editing of the project.
744

Chapter 6. The PM Procedure
Recall from the last invocation of PROC PM that the data are saved in the data set
SOFTOUT5. To use the saved progress information, invoke PROC PM as follows:
/* Use softout5 as the Activity data set and specify */
/* the Resource data set defined in the last example.*/
/* Save the schedule in softout6. */
proc pm data=softout5 project=softattr
calendar=calendar
resourcein=resources
date=1mar04d interval=weekday
projname=Software Project
out=softout6;
act actid;
succ succid;
project pntid;
duration duration;
id activity;
calid calid;
/* Use the ACTUAL statement to specify the Progress */
/* variables and the value of TIMENOW saved from the*/
/* previous invocation */
actual / as=a_start af=a_finish
remdur=rem_dur pctcomp=pct_comp
timenow=&timenow;
resource Tester Programmer / per=_date_;
run;
The preceding program displays the PM Window for the updated Software project.
Now use the Table View to edit some of the Progress columns. To do so, you can
either scroll to the Progress Columns or move these columns to the left in the Table
View using the appropriate selection from the View pull-down menu (Figure 6.9).
Task number 6 (Module 2 under Develop) has a Remaining Duration value of 4.
At this point in time, you may notice that you have misjudged the amount of work
involved and that you need only one more day to nish the task. Enter 1 in the
Remaining Duration column. This editing change immediately causes the Percent
Complete column to update to 50, indicating that 50% of the work is completed. The
resulting effect on the project schedule is shown in Output 6.6.3 (the windowhas been
scrolled down to enable the second half of the project to be visible). Note that reduc-
ing the duration of the Module task did not affect the project end date. The duration
of the project is still 24 days. Studying the schedule of the Document and Test
tasks, you notice that the delay to the project is caused by the fact that the resource-
constrained schedule of the task Test is delayed due to resource constraints.
Example 6.6. Editing Progress

745
Output 6.6.3. Editing the Remaining Duration Column
In addition to revising the progress information for Module 2, you also real-
ize that the Document task is 50% complete as of the Timenow date. Edit the
Percent Complete column in the Table View, changing the value from 25.0 to 50.0.
Immediately, the Remaining Duration column changes to 2. The resulting window is
shown in Output 6.6.4. The project end date (for the resource-constrained schedule)
is 28Mar04. Thus, the project duration is now reduced to 20 days.
746

Chapter 6. The PM Procedure
Output 6.6.4. Editing the Percent Complete Column
Chapter 7
The Projman Application
Chapter Contents
OVERVIEW . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 749
PROJMAN COMMAND . . . . . . . . . . . . . . . . . . . . . . . . . . . . 749
PROJMAN WINDOW . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 750
Projman Options Window . . . . . . . . . . . . . . . . . . . . . . . . . . . 752
Import Project Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . 753
PROJECT INFORMATION WINDOW . . . . . . . . . . . . . . . . . . . . 754
Project Schedule Summary Window . . . . . . . . . . . . . . . . . . . . . 755
PM WINDOW . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 756
CALENDARS WINDOW . . . . . . . . . . . . . . . . . . . . . . . . . . . . 757
Edit Calendar Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 758
HOLIDAYS WINDOW . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 759
Edit Holiday Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 760
RESOURCES WINDOW . . . . . . . . . . . . . . . . . . . . . . . . . . . . 762
Edit Resource Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . 763
Availability Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 765
Alternates Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 766
WORKSHIFTS WINDOW . . . . . . . . . . . . . . . . . . . . . . . . . . . 768
Edit Workshift Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . 769
SCHEDULE OPTIONS WINDOW . . . . . . . . . . . . . . . . . . . . . . 770
Additional Options Window . . . . . . . . . . . . . . . . . . . . . . . . . . 772
Additional Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 772
Resource Options Window . . . . . . . . . . . . . . . . . . . . . . . . . . 774
Resource Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 774
Scheduling Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 776
REPORTS WINDOW . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 777
Report Options Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . 779
Tabular Report Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . 780
Graphics Report Options . . . . . . . . . . . . . . . . . . . . . . . . . . . 781
Title Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 782
Footnote Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 783
748

Chapter 7. The Projman Application
Options Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 783
Standard Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 783
Macro Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 785
CALENDAR REPORT OPTIONS WINDOW . . . . . . . . . . . . . . . . 788
GANTT CHART OPTIONS WINDOW . . . . . . . . . . . . . . . . . . . . 790
Chart Control Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 791
Task Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 792
Time Axis Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 793
Task Bar Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 793
Color Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 794
NETWORK DIAGRAM OPTIONS WINDOW . . . . . . . . . . . . . . . . 795
Page/Layout Control Options . . . . . . . . . . . . . . . . . . . . . . . . . 797
Node Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 799
Time Scale Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 800
Arc Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 800
Color Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 801
RESOURCE REPORT OPTIONS WINDOW . . . . . . . . . . . . . . . . . 802
TABULAR LISTING OPTIONS WINDOW . . . . . . . . . . . . . . . . . 803
Additional Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 804
IMPORT ACTIVITY DATA SET WINDOW . . . . . . . . . . . . . . . . . 805
Standard Import Options . . . . . . . . . . . . . . . . . . . . . . . . . . . 806
Secondary Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 807
Basic Activity Information . . . . . . . . . . . . . . . . . . . . . . . . . . 807
Progress/Baseline Information . . . . . . . . . . . . . . . . . . . . . . . . 809
Resource Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 810
Additional Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . 811
IMPORT CALENDAR DATA SET WINDOW . . . . . . . . . . . . . . . . 812
IMPORT HOLIDAY DATA SET WINDOW . . . . . . . . . . . . . . . . . 813
IMPORT RESOURCEIN DATA SET WINDOW . . . . . . . . . . . . . . . 815
IMPORT WORKSHIFT DATA SET WINDOW . . . . . . . . . . . . . . . 816
EDIT DATE WINDOW . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 817
Chapter 7
The Projman Application
Overview
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. For more information, see Chapter 6, The PM Procedure.
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. When you invoke Projman, the Projman Window is displayed. This
window is the primary window for accessing the functionality of the application. See
the Projman Window section on page 750 for more information.
Projman enables you to dene multiple projects, information about which is stored
in a project dictionary data set. For more information about this data set, see the
PROJDICT= Option section, which follows. To access the data associated with
a project, you use the Project Information window. This window provides access to
interfaces for dening data corresponding to activities, calendars, holidays, resources,
and workshifts. See the Project Information Window section on page 754 for more
information.
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 easily modify any of the standard reports to add your own person-
alized reports to the application. For more information on reports, see the Reports
Window section on page 777.
For general information about project management, consult Appendix A, Glossary
of Project Management Terms.
Projman Command
The projman command supports two options:
PROJDICT=
project name
PROJDICT= Option
The PROJDICT= option is used to specify the location of the Projman project dic-
tionary data set. The project dictionary data set stores the denition of each project
created with the Projman application.
750

Chapter 7. The Projman Application
Valid values for the option are a two-level SAS data set name (that is,
<library>.<dsname>, where <library> is a currently dened SAS libname and
<dsname> is a valid SAS data set name).
If the data set specied with the PROJDICT= option does not exist, Projman attempts
to create a new project dictionary data set at that location. If the data set already
exists and it is not a valid project dictionary data set, Projman uses the default project
dictionary data set location, SASUSER.PROJDICT.
Project Name Option
The Project Name option can be used to indicate a project that should be opened au-
tomatically when Projman is started. If the project does not exist, Projman produces
a warning message.
To specify project names that contain multiple adjacent blanks (that is, Project

ABC), enclose the name in double quotes.


Projman Window
The Projman Window is the initial window opened by the Projman application. When
you start the application, all currently dened projects are listed in this window. To
view an existing project, select the desired name in the project list and click Open.
Projects can be opened with either read or update access.
When a new or existing project is opened, a Project Information window is displayed.
Individual project data can be manipulated from that window. For more information,
see the Project Information Window section on page 754.
Project List
The project list contains a list of all projects that are dened to the application.
Projman Window

751
Quit
Pressing the Quit button exits the Projman application. If projects are open with
update access and changes have been made, you are prompted to save changes.
New
Pressing the New button creates a new project and opens that project with update
access. A default project name (Projectn, where n is an integer) is automatically gen-
erated and added to the project list. When creating a new project, you are prompted
to select the library where the project data is to be stored. After you select a library,
the Project Information window is opened. For more information on that window, see
the Project Information Window section on page 754.
Open
Pressing the Open button opens the selected project with read or update access. The
access level is determined by the current setting of the Open Mode option. In order to
save modications to a project, you must open the project with update access. While
you have a project open with update access, other users are only able to obtain read
access to that project.
Copy
Pressing the Copy button copies the selected project. When copying a project, you
are prompted to select the library where the project data is to be stored. You are
also required to specify a unique project name. The new project name automatically
appears in the project list.
Delete
Pressing the Delete button deletes the selected project. In order to delete a project,
you must be able to obtain update access. In other words, no other user can have the
project open with update access.
Display Library
This option is used to toggle the display of project library names within the project
list. The library name indicates the library reference to the SAS data library where
a particular projects data is stored. If a projects library reference is not dened,
Projman is unable to open the project.
Options
When this button is pressed, the Projman Options window is displayed. For informa-
tion on this window, see the Projman Options Window section on page 752.
Import Project
When this button is pressed, the Import Project window is opened. For information
on this window, see the Import Project Window section on page 753.
752

Chapter 7. The Projman Application
Open Mode
The Open Mode option is used to specify whether projects are to be opened with
read or update access. When a project is opened with read access, you may modify
a working copy of the project data, but you are unable to save those changes when
the project is closed (although you can use the Save As feature to save the modied
project as a different project).
When a project is opened with update access, no other Projman session can open that
same project with update access; however, read access is available. It is necessary to
use update access if you want to save changes to the current project.
For different users to have simultaneous read access to the same project, SAS/SHARE
software is required. Note that only one user can have update access to a particular
project at a particular time. Access level does not affect the ability to produce project
reports.
Projman Options Window
The Projman Options window enables you to manipulate options that control the
behavior of the Projman application.
User Name
The User Name eld can be used to specify the users name, which is used to indi-
cate who last modied a project. Modication information appears in the Project
Schedule Summary window. For information on that window, see the Project
Schedule Summary Window section on page 755.
Device Driver
The Device Driver eld can be used to specify the name of the device driver that is
to be used when printing reports. You can also indicate whether or not to use this
device as a target device when reports are shown on the screen. In other words, the
graphics output on the screen emulates the characteristics of the device listed in the
Device Driver eld.
Import Project Window

753
Default Scheduling Options
The Default Scheduling Options enable you to set default values for the projects
duration unit, day start, and day length parameters. Note that changing the values of
these options does not affect projects that already exist.
Automatically open Activities Window when opening projects.
If this option is selected, a projects Activities window(an interactive Gantt chart win-
dow provided by the PM procedure) automatically opens when the project is opened.
For more information, see the PM Window section on page 756.
Import Project Window
The Import Project window enables you to import external project data or create
sample projects.
Activity Data Set
When this option is selected and the Import Project... button is pressed, the Import
Activity Data Set window is opened. For more information, see the Import Activity
Data Set Window section on page 805.
PROJMAN (V6) project
When this option is selected and the Import Project... button is pressed, you are
presented with a list of Version 6 Projman projects to import.
Import Project...
Depending upon the setting of Project Type as Activity data set or PROJMAN
(V6) project, pressing this button commences the appropriate import process.
Sample Projects
This list displays the sample projects that are currently available with the Projman
application. Make the desired selection and use the Create Sample Project button
to create a sample project.
754

Chapter 7. The Projman Application
Create Sample Project
Use this button to create the sample project that is currently selected in the Sample
Projects list.
Project Information Window
The Project Information window is initially displayed when a project is opened for
read or update. The access control level is indicated in the window title. In this
window, you can edit the project name and description as well as access windows for
specifying project data and producing reports.
Name
The Name eld is used to specify the name of the project. Project names must be
unique. A longer description can be given in the Description eld.
Description
The Description eld is provided to give the opportunity for storing a short descrip-
tion of the project. A description is purely optional and is used for identication
purposes only.
Activities
When this button is selected, the PM window (an interactive Gantt Chart provided by
the PM procedure) displays the current project structure and schedule. Within this
window, activities can be added and deleted and corresponding data can be modied.
For more information, see the PM Window section on page 756.
Options
This selection is used to access a window for setting project scheduling options, as
well as a window for adding variables to the Activity data set. For more information
on project scheduling options, see the Schedule Options Window section on page
770.
Project Schedule Summary Window

755
Calendars
When this button is pressed, the Calendars window is opened. For information on
this window, see the Calendars Window section on page 757.
Holidays
When this button is pressed, the Holidays window is opened. For information on this
window, see the Holidays Window section on page 759.
Resources
When this button is pressed, the Resources window is opened. For information on
this window, see the Resources Window section on page 762.
Workshifts
When this button is pressed, the Workshifts window is opened. For information on
this window, see the Workshifts Window section on page 768.
Reports
When this button is pressed, the Reports window is opened. For information on this
window, see the Reports Window section on page 777.
Summary
When this button is pressed, the Project Schedule Summary window is opened. For
information on this window, see the Project Schedule Summary Window section
on page 755.
Project Schedule Summary Window
This window displays summary information for the different project schedules that
have been computed. In addition to the start and nish times for these schedules, the
duration and the percent completion of the project are also displayed. Note that these
values correspond to the Resource Schedule of the project if resource-constrained
scheduling was performed; otherwise, they correspond to the Early Schedule of the
project.
This window also indicates the dates when the project was created and last modied
as well as the user that last modied the project.
756

Chapter 7. The Projman Application
PM Window
The PM window (also referred to as the Activities window) is an interactive Gantt
chart window provided by the PM procedure. Within Projman, this window is used
to manipulate data corresponding to the project activities. This data includes names,
durations, precedence relationships, calendars, resource requirements, progress in-
formation, and baseline schedules, as well as user-dened identication elds.
While the PM window is open, all other Projman application windows are inactive.
To access options that control the manner in which the PM window schedules activi-
ties, press the Options button on the Project Information window before opening the
PM window. For additional information on the PM window, see Chapter 6, The PM
Procedure.
Calendars Window

757
Calendars Window
The Calendars window lists all of the calendars that have been dened for the project.
From this window, you can create, edit, copy, and delete calendar denitions. Once
dened, calendars can be assigned to activities as well as resources. You can dene
as many individual calendars as you want. Note that some actions in this window are
disabled if they are not valid.
Calendar List
This list contains all of the calendars that are dened for the project. By selecting an
item in this list, you can manipulate the selected item by pressing the Open, Copy,
or Delete buttons. The New button can always be used to add a new item to the list.
New
When this button is pressed, a new calendar is created and displayed in an Edit
Calendar window for editing.
Copy
When this button is pressed, the selected calendar is copied and displayed in an Edit
Calendar window for editing. If no calendar is selected, this option is disabled.
Open
When this button is pressed, the selected calendar is displayed in an Edit Calendar
window for editing. If no calendar is selected, this option is disabled.
Delete
When this button is pressed, the selected item in the calendar list is deleted. A sec-
ondary window is opened to conrm the deletion. Deletions are irreversible unless
the project is closed without saving the current changes. If no calendar is selected,
this option is disabled.
758

Chapter 7. The Projman Application
Import Calendar Data Set
When this button is pressed, a window is displayed for importing a CALENDAR data
set. For information on this window, see the Import Calendar Data Set Window
section on page 812. The import data set is required to be in the format appropriate
for input to the CPM or PM procedure. For information on the CALENDAR data set,
see the CALEDATA Data Set section on page 117.
Edit Calendar Window
This window enables you to create and modify calendar denitions. You can specify
a calendar name and description as well as choose the workshifts for each day of the
work week.
Calendar names can take either character or numeric values, but they must be unique.
If a calendar is dened with the name Default, every activity in the project will follow
that calendar unless the activity has a specic calendar associated with it.
Calendar Name
The Calendar Name eld is used to specify the name of the calendar. The calendar
name can be either character or numeric, but it must be unique. This name is the value
that will be used to assign calendars to activities and resources. A longer description
can be given in the Description eld.
Description
The Description eld enables you to store a short description about the calendar. A
description is purely optional and is used for identication purposes only.
Workshift Table
The Workshift table indicates the workshifts that have been assigned to each day of
the week. By default, Monday through Friday are working days (identied by the
WORKDAY workshift), while Saturday and Sunday are nonworking days (identied
by the HOLIDAY workshift). To change the workshift associated with a particular
day or days, simply select that day (days) by selecting the corresponding workshift
(workshifts) in the table and press the Set Workshift... button.
Holidays Window

759
Set Workshift...
When the Set Workshift... button is pressed, a window is opened that displays all of
the workshifts currently dened for the project. By selecting different workshifts, you
can change the highlighted values in the Workshift table. When the desired selection
has been made, press the Close button to close the window.
Holidays Window
The Holidays window lists all of the holidays that have been dened for the project.
From this window, you can create, edit, copy and delete holiday denitions. You
can dene as many individual holidays as you want. Note that some actions in this
window are disabled if they are not valid.
Holiday List
This list contains all of the holidays that are dened for the project. By selecting an
item in this list, you can manipulate the selected item by pressing the Open, Copy,
or Delete buttons. The New button can always be used to add a new item to the list.
New
When this button is pressed, a new holiday is created and displayed in an Edit Holiday
window for editing.
Copy
When this button is pressed, the selected holiday is copied and displayed in an Edit
Holiday window for editing. If no holiday is selected, this option is disabled.
Open
When this button is pressed, the selected holiday is displayed in an Edit Holiday
window for editing. If no holiday is selected, this option is disabled.
760

Chapter 7. The Projman Application
Delete
When this button is pressed, the selected item in the holiday list is deleted. A sec-
ondary window is opened to conrm the deletion. Deletions are irreversible unless
the project is closed without saving any changes. If no holiday is selected, this option
is disabled.
Import Holiday Data Set
When this button is pressed, a window is displayed for importing a HOLIDAY data
set. For information on this window, see the Import Holiday Data Set Window
section on page 813. The import data set is required to be in the format appropriate
for input to the CPM or PM procedure. For information on the HOLIDAY data set,
see the HOLIDATA Data Set section on page 118.
Edit Holiday Window
This window enables you to create and modify holiday denitions. You can specify a
holiday name and description as well as a start date, nish date, and the duration (or
length) of the holiday. Additionally, you can indicate the calendar or calendars that
the holiday is to be associated with.
Holiday names can take either character or numeric values. A start date is always
required when dening a holiday.
Holiday Name
The Holiday Name eld is used to specify the name of the holiday. The holiday
name can be either character or numeric. A longer description can be given in the
Description eld.
Description
The Description eld enables you to store a short description about the holiday. A
description is purely optional and is used for identication purposes only.
Edit Holiday Window

761
Holiday Start Date
The Holiday Start Date is used to indicate the calendar date that represents the start
of the holiday. The start date is required. The value can be entered with either a
DATEw. (that is, 01MAY2004) or a DATETIMEw. (that is, 01MAY2004:08:30:00)
format. Alternatively, by pressing the Start: button, you can access an Edit Date
window to specify the desired value.
Holiday Finish Date
The Holiday Finish Date can be used to indicate the calendar date that represents
the nish of the holiday. The nish date is not required; however, if not specied,
the holiday will last only one duration unit (as dened for the project) unless the
length of the holiday is specied in the Duration eld. The nish date value can
be entered with either a DATEw. (that is, 01MAY2004) or a DATETIMEw. (that is,
01MAY2004:16:59:59) format. Alternatively, by pressing the Finish: button, you
can access an Edit Date window to specify the desired value.
Duration
The Duration eld can be used to specify the length of the holiday. Duration values
are specied in the units of the projects duration unit. The duration is optional, but it
is assumed to be 1 if the holiday nish date is not provided. If the holiday nish date
is specied, the duration is ignored.
Calendars...
Pressing the Calendars... button opens a window for indicating which project calen-
dar or calendars the holiday is to be associated with. If no calendars are specied in
the list, the holiday is assigned to all calendars.
The Calendars window contains a list of calendars that the current holiday is assigned
to. To remove calendars, simply select the calendar to be removed and press the
Remove button. To add calendars to the list, press the Add button. A list of all
calendars is displayed and if you select individual calendar entries, they are added to
the holidays calendar assignments.
762

Chapter 7. The Projman Application
Resources Window
The Resources window lists all of the resources that have been dened for the project.
From this window, you can create, edit, copy and delete resource denitions. You
can dene as many individual resources as you want. Note that some actions in this
window are disabled if they are not valid.
Resource List
This list contains all of the resources that are dened for the project. By selecting an
item in this list, you can manipulate the selected item by pressing the Open, Copy,
or Delete buttons. The New button can always be used to add a new item to the list.
New
When this button is pressed, a new resource is created and displayed in an Edit
Resource window for editing.
Copy
When this button is pressed, the selected resource is copied and displayed in an Edit
Resource window for editing. If no resource is selected, this option is disabled.
Open
When this button is pressed, the selected resource is displayed in an Edit Resource
window for editing. If no resource is selected, this option is disabled.
Delete
When this button is pressed, the selected item in the resource list is deleted. A sec-
ondary window is opened to conrm the deletion. Deletions are irreversible unless
the project is closed without saving any changes. If no resource is selected, this option
is disabled.
Edit Resource Window

763
Import Resourcein Data Set
When this button is pressed, a window is displayed for importing a RESOURCEIN
data set. For information on this window, see the Import Resourcein Data Set
Window section on page 815. The import data set is required to be in the for-
mat appropriate for input to the CPM or PM procedure. For information on the
RESOURCEIN data set, see the RESOURCEIN= Input Data Set section on page
126.
Edit Resource Window
This window enables you to create and modify resource denitions. You can specify
a resource name and description as well as indicate the resource type and priority.
Actual, budgeted, and xed resource costs can also be specied. In two secondary
windows, you can dene the availability prole and a list of substitute resources.
Resource names must be valid SAS variable names and must be unique.
Name
The Name eld is used to specify the name of the resource. The resource name must
be a valid SAS variable name and must be unique. A longer description can be given
in the Description eld.
Description
The Description eld enables you to store a short description of the resource. A
description is purely optional and is used for reporting purposes only.
Calendar
The Calendar eld is used to specify the name of the calendar for the resource.
Simply type the name of the desired calendar in the eld and press Enter. If that
calendar does not exist, you are asked if you would like for it to be created. If you
respond afrmatively, a calendar (with default settings) is created and given the speci-
ed name. Calendars are modied by accessing the Calendars windowfor the project.
For more information, see the Calendars Window section on page 757.
764

Chapter 7. The Projman Application
Resource Type
Resources are classied as either consumable or replenishable. A consumable re-
source is one that is used up by the job (such as bricks or money), while a replen-
ishable resource becomes available again once a job using it has nished (such as
laborers or machinery).
If the For Aggregation Only option is selected, this resource is used for aggrega-
tion rather than resource-constrained scheduling. When a resource is dened as an
aggregate resource, resource availability information is ignored.
Amount of Work
This selection indicates the amount of work that a particular resource is to perform on
an activity (or the manner in which the resource affects an activitys duration). When
the Fixed by activity duration option is selected, the resource works for a xed
duration, as specied for the activity; in other words, the activitys duration is not af-
fected by changing the rate of the resource used by the activity. The Drives activity
duration selection indicates that the activitys work value indicates the total amount
of work required by the resource for that activity; such a resource is called a driving
resource. The Spans entire activity selection indicates that the resource is to be a
spanning resource; in other words, the resource is required to work throughout the ac-
tivitys 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, through-
out 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.
Resource Priority
You can use the horizontal slider to specify a resource priority value between 1 and
100. Lower numbers indicate higher priority. During resource-constrained schedul-
ing, this number is used to order activities that are waiting for resources when the
primary scheduling rule is specied as resource priority. For information on schedul-
ing rules, see the Scheduling Rules section on page 776.
Resource Cost
The Cost elds enables you to specify an actual, budgeted, and xed cost value for
each resource. These costs are optional and are used in cost calculations for resource
cost reports.
Supplementary Resource Level
The Supplementary Resource Level eld can be used to specify an 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 without delaying it beyond
its late start time.
Availability Window

765
Availability...
Pressing the Availability... button opens the Availability window for the current re-
source. From this window, you can dene the availability prole for the resource.
For more information, see the Availability Window section on page 765.
Alternates...
Pressing the Alternates... button opens the Alternates window for the current re-
source. From this window, you can dene alternate (substitute) resources for the cur-
rent resource. For more information, see the Alternates Window section on page
766.
Availability Window
This window enables you to specify the availability prole for the current resource.
By adding records to the prole, you can indicate when the resource availability
changes over time. By default, one record is added to the list to indicate an initial
availability of one unit on January 1, 1960.
It is only necessary to add records for each change in the availability. Note that,
for consumable resources, the availability amount represents the cumulative amount
available to date.
Day
The horizontal slider is used to specify the desired day for adding an entry to the
availability prole.
Month
The horizontal slider is used to specify the desired month for adding an entry to the
availability prole.
766

Chapter 7. The Projman Application
Year
The horizontal slider is used to specify the desired year for adding an entry to the
availability prole.
Time
The horizontal slider is used to specify the desired time for adding an entry to
the availability prole. Note that times are based on a 24 hour clock (that is,
13:00=1 PM).
Available
The Available eld is used to specify the desired available amount for adding (or
updating) an entry to the availability prole.
Availability Prole
The Availability Prole list indicates the amount of resource that is available to the
project over time. To add or update records in the list, select the desired date, specify
an available amount, and press the Add/Update button. Records in the list are sorted
automatically by date. To delete records from the list, select the desired records and
press the Delete button.
Add/Update
Pressing the Add/Update button adds or updates a record in the availability prole
depending on the current date setting and the available amount specied. Records in
the availability prole are sorted automatically by date.
Delete
Pressing the Delete button removes the currently selected records in the availability
prole. Note that deletions cannot be aborted unless changes to the resource are not
saved.
Alternates Window
This window enables you to specify the alternates prole for the current resource.
By adding records to the prole, you can indicate which resources and at what rate
those resources can be substituted for the current resource. Alternate resources are
purely optional, but they can be very helpful in reducing resource infeasibilities. Only
resources of the same type (consumable or replenishable) can be substituted for one
another.
Alternates Window

767
Resources List
The Resources list contains all of the resources dened for the project that are of the
same type (replenishable or consumable) as the current resource, as substitutions can
only be made by like-typed resources. Selecting one or more resources in this list
enables you to add records to the alternates prole.
Rate
The Rate eld is used to specify the rate o substitution for an alternate resource spec-
ication. For example, if resource Z is to be substituted for resource X with a sub-
stitution rate of 0.5, an activity that requires 1 unit of resource X could be completed
with 0.5 units of resource Z.
Priority
The horizontal slider can be used to indicate a priority for an alternate resource spec-
ication. Lower numbers indicate higher priority. This priority is used to order the
resources that are listed as alternates (substitutes) for the current resource.
Alternates Prole
The Alternates Prole indicates the resources that are eligible to be substituted for
the current resource (if it should be unavailable during project scheduling). Records
in this list are ordered by priority to indicate the order in which substitutions would
be made, if needed. To add or update records in the list, select one or more resources
in the Resources list, specify the rate of substitution and the priority, and press the
Add/Update button. To delete records from the list, select the desired records and
press the Delete button.
Add/Update
Pressing the Add/Update button adds or updates a record in the alternates prole
depending on the current resource, rate, and priority settings.
768

Chapter 7. The Projman Application
Delete
Pressing the Delete button removes the currently selected records in the alternates
prole. Note that deletions cannot be aborted unless changes to the resource are not
saved.
Workshifts Window
The Workshifts window lists all of the workshifts that have been dened for the
project. From this window, you can create, edit, copy, and delete workshift de-
nitions. You can dene as many individual workshifts as you want. Note that some
actions in this window are disabled if they are not valid.
Workshift List
This list contains all of the workshifts that are dened for the project. By selecting an
item in this list, you can manipulate the selected item by pressing the Open, Copy,
or Delete buttons. The New button can always be used to add a new item to the list.
New
When this button is pressed, a new workshift is created and displayed in an Edit
Workshift window for editing.
Copy
When this button is pressed, the selected workshift is copied and displayed in an Edit
Workshift window for editing. If no workshift is selected, this option is disabled.
Open
When this button is pressed, the selected workshift is displayed in an Edit Workshift
window for editing. If no workshift is selected, this option is disabled.
Delete
When this button is pressed, the selected item in the workshift list is deleted. A
secondary window is opened to conrm the deletion. Deletions are irreversible unless
the project is closed without saving any changes. If no workshift is selected, this
option is disabled.
Edit Workshift Window

769
Import Workshift Data Set
When this button is pressed, a window is displayed for importing a WORKSHIFT
data set. For information on this window, see the Import Workshift Data Set
Window section on page 816. The import data set is required to be in the format ap-
propriate for input to the CPM or PM procedure. For information on the WORKDAY
data set, see the WORKDATA Data Set section on page 116.
Edit Workshift Window
This window enables you to create and modify workshift denitions. You can specify
a workshift name and description as well as dene the on/off working times that make
up the valid working periods within a single day.
Workshift names must be valid SAS variable names and must be unique.
Workshift Name
The Workshift Name eld is used to specify the name of the workshift. The work-
shift name must be a valid SAS variable name and must be unique. A longer descrip-
tion can be given in the Description eld.
Description
The Description eld enables you to store a short description of the workshift. A
description is purely optional and is used for identication purposes only.
Shift Time
The horizontal slider can be used to adjust the shift time. When the Add -> button
is pressed, this value is added to the Shift Times list. The values in the Shift Times
list are sorted automatically. Note that times are based on a 24 hour clock (that is,
13:00=1 PM).
770

Chapter 7. The Projman Application
Add ->
When this button is pressed, the current shift time value is added to the Shift Times
list. The values in the Shift Times list are sorted automatically.
Shift Times List
The Shift Times list contains the on/off working times that represent the workshift
(workday) denition. Times can be added to the list by setting the Shift Time and
pressing the Add -> button, while times are removed by selecting items in the list
and pressing the Delete button. Times should be added to the Shift Times list in pairs
that represent on/off working times. A valid workshift will have an even number of
times in the list.
Delete
When this button is pressed, any times selected in the Shift Times list are deleted.
Schedule Options Window
This window enables you to set options that control the scheduling of the active
project using the critical path method. These options are maintained separately
for each project, and default values depend upon the data specied for the project.
Schedule Constraints (such as resource leveling) can be enabled and disabled here.
Secondary windows can be used to set additional options that are used to provide
tighter control over the scheduling algorithm.
Some options are not available unless certain project data has been specied. For
example, if no resources are dened, the Resource Leveling option is disabled.
However, when resources are added to the project, this option is automatically en-
abled and selected.
Project Start Date
The Project Start Date is used to align the start of the project. This value can be
entered with either a DATEw. (that is, 01MAY2004) or a DATETIMEw. (that is,
Schedule Options Window

771
01MAY2004:08:30:00) format. Alternatively, by pressing the Start: button, you can
access an Edit Date window to specify the desired value.
A project nish date can also be specied. If neither of these dates is specied, the
project start date is automatically set to the current date upon initial scheduling.
Project Finish Date
The Project Finish Date is used to align the nish of the project. This value can
be entered with either a DATEw. (that is, 01MAY2004) or a DATETIMEw. (that is,
01MAY2004:17:00:00) format. Alternatively, by pressing the Finish: button, you
can access an Edit Date window to specify the desired value.
A project start date can also be specied. If neither of these dates is specied, the
project start date is automatically set to the current date upon initial scheduling.
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 Week
Minute Month
Hour Qtr
Day Year
Weekday
The default value is Day.
Workday Start
This option can be used to specify the start of the default workday. Values for this
option correspond to a TIME5. (hh:mm) value, where hh is in hours and mm is in
minutes. Use the horizontal slider to select the desired value. Note that times are
based on a 24 hour clock (that is, 13:00=1 PM).
This option is ignored when the duration unit is specied as Month, Qtr, or Year.
Workday Length
This option can be used to specify the length of the default workday. Values for this
option correspond to a TIME5. (hh:mm) value, where hh is in hours and mm is in
minutes. Use the horizontal slider to select the desired value.
This option is ignored when the duration unit is specied as Month, Qtr, or Year.
Resource Leveling
The Resource Leveling option is used to indicate that the activities in the project are
to be scheduled subject to the availability of required resources. If the active project
contains resource data, this option is selected by default; otherwise, the option is
disabled. To schedule a project without using resource constraints, simply deselect
the Resource Leveling option.
772

Chapter 7. The Projman Application
Resource Options...
Pressing this button opens the Resource Options window, which is used to set options
to control the resource allocation algorithm. For more information on this window,
see the Resource Options Window section on page 774.
Additional Options...
Pressing this button opens the Additional Options window, which is used to set basic
options that control the project scheduling algorithm. For more information on this
window, see the Additional Options Window section, which follows.
Additional Options Window
This window enables you to control general scheduling options, such as the use
of holidays and calendars. There are also controls for supertask and progress op-
tions. Note that some of these options are disabled if the required project data are not
present. The settings of these options are established and maintained for each project.
Additional Options
Use Holidays
When this option is activated, holiday denitions are considered during scheduling;
otherwise, all holidays are ignored. Note that this option is disabled if no holidays
have been dened. This option is automatically activated when holidays are initially
created.
Use Calendars
When this option is activated, calendar denitions are considered during scheduling;
otherwise, all calendars are ignored. Note that this option is disabled if no calendars
have been dened. This option is automatically activated when calendars are initially
created.
Additional Options

773
Compute individual critical paths for each separate supertask.
When this option is selected, the scheduling algorithm calculates a separate critical
path for each supertask in the project.
By default, the projects early nish time is treated as the starting point for the calcu-
lation of the backward pass (which calculates the late start schedule). The late nish
time for each supertask is then determined during the backward pass on the basis of
the precedence constraints. If a target date is placed on the nish time of a supertask,
the late nish time of the supertask is further constrained by this value. However,
when this option is activated, the scheduling algorithm requires that the late nish
time of each subtask be less than or equal to the early nish time of the supertask.
Allow supertask durations to drive the late nish calculation.
When this option is activated, the scheduling algorithm uses the specied super-
task duration to compute the maximum allowed late nish time for each supertask.
Otherwise, the maximumallowed late nish time is determined by the supertask span,
as computed from the span of all the subtasks of the supertask.
Aggregate rather than constrain supertask resource requirements.
When this option is selected, the resource requirements for all supertasks are used
only for aggregation purposes and not for resource-constrained scheduling.
Ignore resource requirements for all supertasks.
When this option is activated, the resource requirements for all supertasks are ig-
nored.
Allow completed or in-progress activities to have nonzero oat.
When this option is selected, the scheduling algorithm allows activities that are com-
pleted or in progress to have nonzero oat. For more information on oat, see total
oat and free oat in Appendix A, Glossary of Project Management Terms. By
default, all completed or in-progress activities have zero oat.
Update predecessors of completed or in-progress activities.
When this option is selected, the scheduling algorithm assumes automatic comple-
tion (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 no actual start
or actual nish time, then the algorithm assumes that A must have already nished.
Activity A is assigned an actual start time and an actual nish time consistent with
the precedence constraints.
Allow in-progress activities to split if resources are insufcient.
When this option is activated, the scheduling algorithm allows activities that are in
progress at the timenow date to be split if they cause resource infeasibilities. During
resource allocation, any activities with early start values less than the timenow date
are scheduled even if there are not enough resources. This is true even for activities
774

Chapter 7. The Projman Application
that are in progress. This option permits an activity to be split into two segments at
the timenow date, allowing the second segment of the activity to be scheduled later
when resource levels permit. Note that activities with a target date alignment type
of mandatory start or mandatory nish are not allowed to be split; also, activities
without resource requirements are not split.
Resource Options Window
The Resource Options window enables you to control several aspects of the resource
scheduling algorithm. When activities are scheduled subject to the limited availability
of resources, it is quite possible that a feasible schedule does not exist or cannot be
found. The resource options available here can be used to control and manipulate the
resource allocation process. In some cases, these options might enable the algorithm
to nd a feasible schedule or to shorten the existing schedule.
These options settings are established and maintained for each project. Note that
some options have no effect if the appropriate data has not been specied.
Resource Options
Resource Cutoff Date
The Resource Cutoff Date eld can be used to specify a cutoff date for resource
leveling. When this date is specied, the scheduled start and nish for activities
that would occur after the cutoff date are set to missing (empty). This value can
be entered with either a DATEw. (that is, 01MAY2004) or a DATETIMEw. (that is,
01MAY2004:17:00:00) format. Alternatively, by pressing the Date: button, you can
access an Edit Date window to specify the desired value.
Resource Options

775
Maximum Activity Delay
The Default Maximum Activity Delay eld can be used to specify the maximum
amount of time by which any activity in the project can be delayed due to lack of
resources. This value acts as a default for all project activities, while individual val-
ues can be specied for each separate activity. The default value for this option is
+INFINITY.
Resource Usage Observations
The maximum number of resource observations sets an upper limit on the number of
observations that the resource usage output data set can contain. The default value
is 1000. Use the horizontal slider to increase this limit. The frequency indicates the
time interval at which observations are added to the data set. Use the combo box to
select the desired time interval.
Limit activity resource delays.
When this option is activated, the maximum activity delay and each activitys delay
values (if specied) are used to control activity schedule slippage when performing
resource leveling; otherwise, the values are ignored and activity schedules are allowed
to slip indenitely.
Use resource calendars.
When this option is activated, resource calendars (if specied) are used to determine
on/off work periods for resources; otherwise, all resource calendars are ignored.
Allow activity splitting.
When this option is activated, activities are allowed to be split into segments during
resource allocation. The maximum number of segments and the minimum segment
duration can be specied for each activity to control the extent of the splitting.
Use alternate resources.
When this option is activated, alternate resources (if specied) are used; otherwise,
they are ignored.
Allow designated resources to drive activity durations.
This option is used to activate resource-driven durations, provided that resources have
been dened as driving resources and work rates have been specied for the activities.
Allow multiple resources to be allocated independently.
When this option is selected, each resource can be scheduled separately for each
activity during resource allocation; otherwise, all resources (required by an activity)
must be available before work on the activity can be scheduled. If this option is
selected, each resource is scheduled independently of the others. This may cause an
activitys schedule to be extended if its resources cannot all start at the same time.
776

Chapter 7. The Projman Application
Continue scheduling even when resources are insufcient.
When this option is selected, the scheduling algorithm continues to schedule activ-
ities even when resources are insufcient. By default, the algorithm stops (with a
partial schedule) when it cannot nd sufcient resources for an activity before the
activitys latest possible start time (accounting for the activitys delay value or the
maximum activity delay and using supplementary or alternate resources if necessary
and if allowed). This option is equivalent to specifying innite supplementary levels
for all resources under consideration.
Require intersection of resource calendars for each activity.
When this option is selected, an activity can be scheduled only during periods that
are common working times for all resource calendars (corresponding to the resources
used by that activity) and the activitys calendar. Use this option with caution; if an
activity uses resources that have mutually disjoint calendars, that activity can never
be scheduled.
If this option is not specied and resources have independent calendars, then each
resource is scheduled using its own calendar. Thus, an activity can have one resource
working on a ve-day calendar, while another resource is working on a seven-day
calendar.
Allocate alternate resources before using supplementary levels.
This option indicates that the scheduling algorithm is to check for alternate resources
before using supplementary resources. When this option is not selected, the algorithm
uses supplementary levels rst (if available) and alternate resources are used only if
the supplementary levels are not sufcient.
Allow activities to be delayed before using supplementary levels.
When this option is selected, the scheduling algorithm waits until an activitys late
start plus delay before it is scheduled using a supplementary level of resources.
Otherwise, even if an activity has a nonzero value specied for delay, it can be sched-
uled using supplementary resources before late start plus delay.
Scheduling Rules
The primary scheduling rule is used to order the list of activities whose predecessor
activities have been completed while scheduling activities subject to resource con-
straints. The secondary scheduling rule is used to break ties caused by the primary
scheduling rule. The scheduling rule choices are
Activity Priority Late Finish Time
Delayed Late Start Resource Priority
Late Start Time Shortest Duration
The default primary scheduling rule is Late Start Time, while the default secondary
scheduling rule is Shortest Duration.
Reports Window

777
Activity Priority
The Activity Priority scheduling rule species that activities in the waiting list (for
resources) should be sorted in the order of increasing values of their priority.
Delayed Late Start
The Delayed Late Start scheduling rule species that activities in the waiting list (for
resources) should be sorted in the order of increasing values of their late start plus
their delay.
Late Start Time
The Late Start Time scheduling rule species that activities in the waiting list (for
resources) should be sorted in the order of increasing values of their late start.
Late Finish Time
The Late Finish Time scheduling rule species that activities in the waiting list (for
resources) should be sorted in the order of increasing values of their late nish.
Resource Priority
The Resource Priority scheduling rule species that activities in the waiting list (for
resources) should be sorted in the order of increasing values of the resource priority
for the most important resource used by each activity. In other words, the resource
priorities are used 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).
Shortest Duration
The Shortest Duration scheduling rule species that activities in the waiting list (for
resources) should be sorted in the order of increasing values of their durations.
Reports Window
The Reports window displays a list of all project reports dened to the Projman ap-
plication. Reports are divided into two categories, Standard and Custom. Standard
reports are included with the application and cannot be modied or deleted. You
can copy and modify standard reports to create custom reports, which can be copied,
modied, and deleted.
Reports are grouped according to type. The following types are available:
Calendars Resource Schedule
Gantt Charts Resource Usage
Network Diagrams Tabular
Resource Cost
778

Chapter 7. The Projman Application
You can dene as many different reports as you would like. Reports are designed
to work with any project provided that the necessary data are available. Individual
report options can be set by accessing the Options window for a particular report. For
more information, see the Options Window section on page 783.
Global report options can be set by accessing the Report Options window. These
options include the setting of default colors and fonts as well as the specication of
report titles and footnotes. For more information, see the Report Options Window
section on page 779.
Active Project
The Active Project indicates the project that is active for the Reports window. When
you generate reports, the active project provides the data for the selected report. When
multiple projects are open at one time, the active project removes any confusion about
which project data are used to produce the report. To change the active project, simply
click on the name of the current project, and a list of open projects is displayed for
selection.
Report Type
The Report Type combo box indicates the type of reports that are currently displayed
in the window. By default, all reports are initially displayed. For example, you might
use this option to specify that only Gantt chart reports are to be listed in the window.
To change the report type, simply click on the combo box, and a list of available
report types is displayed.
Standard Reports
This list contains all of the reports (of a particular type or types) that are dened by
the Projman application. These standard reports cannot be modied or deleted. To
make changes to one of these reports, you must select the desired report and press the
Copy button. A copy of the selected report is added to the Custom Reports list. Use
the View button to generate a report.
Report Options Window

779
Custom Reports
This list contains all of the reports (of a particular type or types) that have been created
by the user. Custom reports are created by copying a report from the list of standard
reports. These reports can be manipulated by selecting the desired report in the list
and pressing the Open, Copy, or Delete buttons. Use the View button to generate a
particular report.
Open
When this button is pressed, the selected custom report is displayed in the reports
Options window for editing. For more information on that window, see the Options
Window section on page 783. If no custom report is selected, this option is disabled.
Copy
When this button is pressed, the selected report is copied and displayed in the reports
Options window for editing. For more information on that window, see the Options
Window section on page 783. If no report is selected, this option is disabled.
Delete
When this button is pressed, the selected report in the Custom Reports list is deleted.
A secondary window is opened to conrm the deletion. Note that the deletion of
reports is irreversible. If no custom report is selected, this option is disabled.
View
When this button is pressed, the currently selected report is generated. If no report is
selected, the option is disabled. Note that when modifying a specic custom report,
you can view the report to verify the results before saving the current changes.
Options
When this button is pressed, the Report Options window is displayed. From that
window, you can control general options that affect all project reports. For more
information, see the Report Options Window section on page 779.
Close
When this button is pressed, the window is closed. Also, all individual report Options
windows (which are currently open) are closed.
Report Options Window
The Report Options window provides access to various options for both tabular and
graphic quality reports. You can modify output appearance features such as page
headings, titles, and footnotes as well as colors and fonts. These options affect all
reports generated with the Projman application.
780

Chapter 7. The Projman Application
Tabular Report Options
Print current date.
When this option is selected, the current date is displayed in the upper-right corner of
each page of all tabular (nongraphics quality) reports.
Print page numbers.
When this option is selected, page numbers are displayed in the upper-right corner of
each page of all tabular (nongraphics quality) reports.
Characters per line
The horizontal slider can be used to specify the width of pages of tabular (nongraphics
quality) reports. The number of characters per line must be an integer value between
64 and 256.
Lines per page
The horizontal slider can be used to specify the length of pages of tabular (nongraph-
ics quality) reports. The number of lines per page must be an integer value between
15 and 512.
Titles
When the Titles button is pressed, a window is displayed for specifying one or more
titles for project reports. You can customize any of your output from reports by
adding up to four titles to the top of each page.
To create or modify a title, simply press the button corresponding to the title you
want to modify. For each title, you can specify the type, color, and size of the font
Graphics Report Options

781
as well as the justication used to align the text. Note that the type, color, size, and
justication specications are used only when producing graphics-quality reports.
For more information, see the Title Window section on page 782.
Footnotes
When the Footnotes button is pressed, a window is displayed for specifying one or
more footnotes for project reports. You can customize any of your output fromreports
by adding up to four footnotes to the bottom of each page.
To create or modify a footnote, simply press the button corresponding to the footnote
you want to modify. For each footnote, you can specify the type, color, and size of
the font as well as the justication used to align the text. Note that the type, color,
size, and justication specications are used only when producing graphics-quality
reports. For more information, see the Footnote Window section on page 783.
Formats
When the Formats button is pressed, a window is displayed for selecting the format
to be used for displaying project schedules. You can specify whether reports are to
display schedules using a DATE7. (that is, 01MAY04) or a DATETIME13. (that is,
01MAY04:12:00) format.
Graphics Report Options
Height
The horizontal slider can be used to specify the default height to be used for all text
displayed in graphics-quality reports. The default value is 1, and valid values range
from 0.1 to 5.
Font
The Font combo box can be used to specify the default font to be used for all text
displayed in graphics-quality reports.
Color
The Color combo box can be used to specify the default color to be used for all text
displayed in graphics-quality reports.
Gantt Chart Patterns
Pressing the Gantt Charts button opens a window where you can specify the colors
and ll patterns of the activity bars drawn on graphics-quality Gantt charts.
The various types of activity bars, along with their respective colors and ll patterns,
are listed in the window. To modify the attributes for a particular activity bar, simply
click on the corresponding color or ll pattern, and a selection window is opened.
From that window, simply select the desired color or ll pattern.
782

Chapter 7. The Projman Application
Network Diagram Patterns
Pressing the Network Diagrams button opens a window where you can specify the
colors and ll patterns of the activity nodes drawn on graphics-quality network dia-
gram reports.
The various types of activity nodes, along with their respective colors and ll patterns,
are listed in the window. To modify the attributes for a particular activity node, simply
click on the corresponding color or ll pattern, and a selection window is opened.
From that window, simply select the desired color or ll pattern.
Title Window
The Title window is used to modify the attributes of report titles.
Text
The Text eld is used to specify the text of the title or footnote. By default, Title1
contains &projname. When the report is generated, the macro variable, &projname,
resolves to the name of the current project. Alternatively, &projdesc can be used to
specify the project description.
Font
Use this selection to specify the font used to draw the text of the title or footnote.
Note that the font specication is used only when producing graphics-quality reports.
Color
Use this selection to specify the color of the text of the title or footnote. Note that the
color specication is used only when producing graphics-quality reports.
Justify
Use this selection to specify whether the text of the title or footnote is to be left-
justied, centered, or right-justied on the page. Note that the justication specica-
tion is used only when producing graphics-quality reports.
Standard Options

783
Height
Use this selection to specify the height of the text of the title or footnote. The default
height is 1, except for the Title1 (which has a default height of 2). Note that the height
specication is only used when producing graphics-quality reports.
Footnote Window
The Footnote window is used to modify the attributes of report footnotes. For de-
scriptions of the options, see the Title Window section on page 782.
Options Window
A reports Options window is used to modify the characteristics of a selected report.
Options differ depending on the type of report that is being modied. All reports fall
into one of the following categories:
Calendar Reports
Gantt Charts
Network Diagrams
Resource Reports
Tabular Listings
Standard Options
The following set of options are common to several different types of reports.
Id
The Id eld displays a unique identier label for the report. This label cannot be
modied.
Name
The Name eld can be used to provide a name for the report. The report name is used
for identication purposes only.
784

Chapter 7. The Projman Application
Identiers
When this button is pressed, a window is opened to enable you to add selections to the
Identier list. Selections are added to the bottom of the list as they are chosen. Items
can be removed from the Identier list by selecting the desired items and pressing the
Remove button.
Identier List
The Identier list contains the list of variables that have been selected to provide
identifying information for the report. For instance, the values of these variables are
used to identify (highlight) records in a tabular report or activity bars on a Gantt chart.
Use the Identiers button to add items to this list.
Sub-Groups
When this button is pressed, a window is opened to enable you to add selections to
the Sub-Group list. Selections are added to the bottom of the list as they are chosen.
Items can be removed from the Sub-Group list by selecting the desired items and
pressing the Remove button.
Sub-Group List
The Sub-Group list contains the list of variables that have been selected to provide
grouping information for the report. For instance, like values of these variables are
used to group records in a tabular report for separate analysis. Similarly, like values
of these variables divide activities into groups for display on separate Gantt charts.
Note that this separation (and any necessary sorting) is done automatically. Use the
Sub-Groups button to add items to this list.
Remove
When this button is pressed, highlighted selections in the Identier and Sub-Group
lists are deleted.
OK
If you press the OK button, the current values displayed in the window are stored and
the window is closed.
Cancel
If you press the Cancel button, all values displayed in the window are returned to
their original values (as when the window was opened) and the window is closed.
View
When this button is pressed, the report is generated. This option is very useful for
testing modications to a report before actually saving the changes.
Macro Variables

785
Edit Source...
When this button is pressed, a window is displayed for modifying the report source
code. Changes to the source code should be made with care as incorrect changes can
disable report options or cause the report to fail entirely. In the Edit Source window,
type ok on the command line to save changes and cancel to cancel.
Macro Variables
This section describes the SAS macro variables that are dened by the Projman appli-
cation during report generation. Many of these macro variables are used in the SAS
source code provided with the standard reports. When you modify the source code of
custom reports, this information may be helpful.
Standard Macro Variables
Name Contents Explanation
&reptname report name Current report name
&projname project name Active project name
&projdesc project description Active project description
&rdformat datetime7. or datetime13. specied by the Formats option
&varlist Variables variable names specied by the Variable list
&ivarlist Identier variable names specied by the Identier list
&byvlist BY + Sub-Group variable names specied by the Sub-Group List
Calendar Reports
Name Contents Explanation
&start start variable name specied by the Schedule option
&nish nish variable name nish corresponding to &start
header=Small, Medium, or Large specied by the Header Size option
&calopts ll if Display All Months is selected
missing if Include Missing Labels is selected
caledata=work.cal workdata= if calendars used in scheduling
&caldata work.shift(drop=holiday workday)
holidata=work.hol if holidays used in scheduling
&calstmt calid calid; if calendars used in scheduling
outstart monday; outnish friday; if Display Weekdays Only is
selected
&holstmt holistart hstart; holidur holidur; if holidays used in scheduling
holin hnish; holiname holiname;
Note that the &caldata, &calstmt, and &holstmt macro variables are not dened un-
less the active projects duration unit is DAY or WEEKDAY.
786

Chapter 7. The Projman Application
Gantt Chart Reports
Name Contents Explanation
&gout gout=work.ggseg graphics catalog specication
&resdict work.resdict resource dictionary data set
&zonevar variable name rst variable in Sub-Group List
&res Lineprinter, Fullscreen or Graphics specied by the Resolution option
caledata=work.cal workdata= if calendars used in scheduling
work.shift(drop=holiday workday)
&gantdata holidata=work.hol if holidays used in scheduling
labeldata=work.labels if Mark Parent Tasks is selected
precdata=work.repttemp if Show Precedence is selected
(where=(obs

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

if Scope option is set to All Resources


resource name if Scope option is set to Selected Resource
&res Lineprinter or Graphics specied by the Resolution option
&interval duration unit specied by the Frequency scheduling option
&mwhere not currently initialized
Tabular Listing Reports
Name Contents Explanation
round if Round values is selected
double if Double space is selected
&prnopts noobs unless Print observation number is selected
label unless Suppress labels is selected
n if Print number of observations is selected
uniform if Format pages uniformly is selected
Calendar Report Options Window
This window provides access to the settings and options available for calendar re-
ports. By changing values in this window, you can create and customize calendar
reports to meet your specic needs. Note that some options may be unavailable if the
active project does not contain the appropriate data. Also, if data unique to a specic
project are required by a report, that report may fail when generated for a different
project.
Note that reports can be generated and viewed to verify the results before any changes
are saved. Access to the source code is also provided.
For a description of standard report options, see the Standard Options section on
page 783.
Calendar Report Options Window

789
Schedule
The setting of the Schedule option indicates which project schedule is to be used to
mark activities on the calendar. You can choose from the actual, baseline, early, late,
and resource-constrained schedules.
Header Size
This option species the type of heading to use in displaying the name of the month
and year on the calendar report. When Small is selected, the month and year are
displayed on one line. For the Medium selection, the month and year are displayed
in a box 4-lines high, while the Large selection will display the month name 7-lines
high (the year is included if space is available).
Display All Months
When selected, this option species that all months between the rst and last activity
start and nish dates, inclusive, are to be displayed (including months that contain no
activities). If this option is not used, months with no activities are omitted from the
report.
Include Missing Labels
When selected, this option species that missing values of identier variables will
appear in the label of an activity. If this option is not selected, missing values are
ignored in labeling activities.
Display Weekdays Only
When selected, this option species that only days from Monday through Friday are
to be displayed in the calendar.
790

Chapter 7. The Projman Application
Gantt Chart Options Window
This window provides access to the settings and options available for Gantt chart
reports. By changing values in this window, you can create and customize Gantt
chart reports to meet your specic needs. Note that some options may be unavailable
if the active project does not contain the appropriate data. Also, if data unique to a
specic project are required by a report, that report may fail when generated for a
different project.
Note that reports can be generated and viewed to verify the results before any changes
are saved. Access to the source code is also provided.
For a description of standard report options, see the Standard Options section on
page 783.
Schedules
The Schedules options provide the capability to control which project schedules are
to be drawn on the Gantt chart. You can choose one or more of the following sched-
ules: actual, baseline, early start, late start, and resource-constrained. Note that at
least one schedule should be selected. If the active project does not have the indi-
cated schedules, the extra specications are ignored when the report is generated.
Resolution
This option is used to specify the resolution of the Gantt chart report. The report can
be produced with either lineprinter, fullscreen, or graphics-quality resolution.
Colors...
By pressing this button, you can access a window containing color options for the
Gantt chart report. These options are used to control the colors of different portions of
the Gantt chart output. Note that these options have no effect unless the Resolution
option is set to produce a graphics-quality report. For more information, see the
Color Options section on page 794.
Chart Control Options

791
Options...
By pressing this button, you can access a window containing additional options for
the Gantt chart report.
Chart Control Options
Horizontal Pages
When the Horizontal Pages option is selected (by activating the check box), the
Gantt chart is scaled so that it spans the specied number of pages in the horizontal di-
rection. The desired number of pages can be adjusted with the horizontal slider. Note
that this option is used only when the report Resolution option is set for graphics-
quality output. Due to intrinsic constraints on the output, the number of generated
pages may not be exactly equal to the amount specied with this option.
Vertical Pages
When the Vertical Pages option is selected (by activating the check box), the Gantt
chart is scaled so that it spans the specied number of pages in the vertical direction.
The desired number of pages can be adjusted with the horizontal slider. Note that
this option is used only when the report Resolution option is set for graphics-quality
output. Due to intrinsic constraints on the output, the number of generated pages may
not be exactly equal to the amount specied with this option.
Compress To One Page
When this option is specied, the Gantt chart is compressed so that it is drawn on one
physical page. Note that this option is ignored unless the report Resolution option is
set for graphics-quality output.
792

Chapter 7. The Projman Application
Proportional Compress
When this option is specied, the Gantt chart is compressed so that it is drawn on
one physical page. This option is the same as the Compress To One Page option
except that the compression of the chart is done proportionally to maintain the correct
aspect ratio. In other words, the amount of horizontal and vertical compression is
equal. Note that this option is used only when the report Resolution option is set for
graphics-quality output.
Fill Pages Completely
When the Gantt chart spans multiple pages, this option causes each page of the Gantt
chart to be lled completely before a new page is started. By default, the pages are
constrained to contain an approximately equal number of activities.
Show Chart Legend
When this option is specied, a concise default legend is displayed at the end of each
page of the Gantt chart.
Suppress Chart Frame
When this option is specied, the vertical boundaries to the left and right of the Gantt
chart are not drawn; only the time axis and a parallel line at the bottom of the chart are
drawn. If this option is not specied, the entire chart is framed. Note that this option
is ignored unless the report Resolution option is set for graphics-quality output.
Draw TimeNow Line
When this option is specied, a vertical reference line is drawn on the time axis at the
timenow date.
Label TimeNow Line
If the Draw TimeNow Line option is specied, selecting this option displays the
value of the timenow date below the timenow line at the bottom of the Gantt chart.
Print Id On Each Page
When the Gantt chart spans multiple pages, selecting this option causes all values in
the Identier list to be displayed on each page of the Gantt chart.
Task Options
Text Height
When text height is specied as h, all text drawn on the Gantt chart (excluding titles
and footnotes) is h times the value of the global text height option, which is speci-
ed in the Report Options window. For more information, see the Report Options
Window section on page 779. Note that this option is used only when the report
Resolution option is set for graphics-quality output.
Task Bar Options

793
Show Job Numbers
When this option is specied, an identifying job number is displayed beside each
activity on the Gantt chart.
Flag Critical Tasks
When selected, this option indicates that critical activities are to be agged as critical
or supercritical. Critical activities are marked CR, and supercritical activities are
marked SC on the left side of the Gantt chart.
Show Precedence
When this option is specied, precedence relationships are drawn on the Gantt chart.
This option is used only when the report Resolution option is set for graphics-quality
output.
Suppress Arrowheads
When the Show Precedence option is specied, selecting this option indicates that
arcs drawn on the Gantt chart should be drawn without arrowheads. This option is
ignored unless the report Resolution option is set for graphics-quality output.
Draw Task Lines
When specied, this option indicates that lines are to be drawn from the left edge of
the Gantt chart to the beginning of the activity schedule bar.
Time Axis Controls
Columns
The horizontal slider is used to specify the number of columns (amount of space) for
drawing each interval on the time axis, where interval is the value indicated with the
Per Interval option. These options can be used to scale the size of the Gantt chart.
Per Interval
The Per Interval combo box indicates the duration unit to use for scaling the size of
the Gantt chart. The Columns option indicates the number of columns (amount of
space) available for drawing each specied interval on the time axis.
Task Bar Options
Show Milestones
When this option is specied, all activities that have zero duration are represented
on the Gantt chart by a milestone symbol. This option is ignored unless the report
Resolution option is set for graphics-quality output.
794

Chapter 7. The Projman Application
Combine Schedules
When this option is specied, the early/late and actual schedule bars of an activity
are concatenated into a single bar on the Gantt chart. A vertical reference line is
automatically drawn at the current timenow date. This timenow line acts to partition
the Gantt chart into two regions; the region to the left of the timenow line reporting
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.
Mark Parent Tasks
When this option is specied, symbols are added to the activity bars of supertasks
on the Gantt charts. These symbols emphasize the parent-child relationship between
the supertask and its subtasks. This option is used only when the report Resolution
option is set for graphics-quality output.
Mark Weekends
When this option is specied, all weekends (or nonworked days during a week) are
marked on the Gantt chart.
Mark Work Breaks
When this option is specied, all work breaks (nonworked periods) during a day are
marked on the Gantt chart. This option automatically activates the Mark Weekends
option.
Color Options
This window is used to set options that control the color of various features of the
Gantt chart report. Note that these options are ignored unless the report Resolution
option is set for graphics-quality output.
Text
The Text combo box can be used to specify the color to use for displaying text that
appears on the Gantt chart. Note that this color specication does not apply to titles,
footnotes or any annotated text.
Network Diagram Options Window

795
Time Axis
The Time Axis combo box can be used to specify the color to use for displaying the
time axis along the top of the Gantt chart. The same color is also used for the frame
around the chart area (where the activity bars are drawn).
Precedence
The Precedence combo box can be used to specify the color to use for drawing the
precedence connections on the Gantt chart. Note that this option is used only when
precedence relationships are to be drawn on the Gantt chart.
Milestones
The Milestone combo box can be used to specify the color to use for drawing any
milestone symbols that appear on the Gantt chart.
Chart Frame
The Chart Frame combo box can be used to specify the background color for the
chart area (where the activity bars are drawn).
Task Lines
The Task Lines combo box can be used to specify the color to use for drawing the
task lines on the Gantt chart. Note that this option is used only when task lines are
to be drawn on the Gantt chart.
Network Diagram Options Window
This window provides access to the settings and options available for network di-
agram reports. By changing values in this window, you can create and customize
reports to meet your specic needs. Note that some options may be unavailable if the
active project does not contain the appropriate data. Also, if data unique to a specic
project are required by a report, that report may fail when generated for a different
project.
Note that reports can be generated and viewed to verify the results before any changes
are saved. Access to the source code is also provided.
For a description of standard report options, see the Standard Options section on
page 783.
796

Chapter 7. The Projman Application
Zone
When the Zone button is pressed, a window is opened to enable you to select a
Zone variable. The selection is displayed on the window. The Zone variable can be
removed by selecting the variable and pressing the Remove button.
Zone Variable
The Zone variable is used to divide the network diagram into horizontal bands or
zones corresponding to the distinct values of the variable. Most projects have at
least one natural classication of the different activities in the project: department,
type of work involved, location of the activity, and so on. By specifying a Zone
variable, you can use this classication to subdivide the network diagram. The zones
are automatically labeled with the Zone variable values and are separated by dividing
lines. Use the Zone button to select a Zone variable.
Remove
When this button is pressed, highlighted selections in the Identier and Zone lists are
deleted.
Resolution
This option is used to specify the resolution of the network diagram report. The report
can be produced with either lineprinter, fullscreen, or graphics-quality resolution.
Observations
This option is used to specify which observations are used to produce the network
diagram. For hierarchical projects, selecting Leaf Tasks Only means that only the
lowest level tasks appear in the network diagram. When All Tasks is specied, all
tasks (regardless of their hierarchical relationship) appear in the network diagram as
separate nodes.
Page/Layout Control Options

797
Colors...
By pressing this button, you can access a window containing color options for the net-
work diagramreport. These options are used to control the colors of different portions
of the network diagram. Note that these options are ignored unless the Resolution
option is set to produce a graphics-quality report. For more information, see the
Color Options section on page 801.
Options...
By pressing this button, you can access a window containing additional options for
the network diagram report.
Page/Layout Control Options
Horizontal Pages
When the Horizontal Pages option is selected (by activating the check box), the
network diagram is scaled so that it spans the specied number of pages in the hor-
izontal direction. The desired number of pages can be adjusted with the horizontal
slider. Note that this option is used only when the report Resolution option is set
for graphics-quality output. Due to intrinsic constraints on the output, the number of
generated pages may not be exactly equal to the amount specied with this option.
Vertical Pages
When the Vertical Pages option is selected (by activating the check box), the network
diagram is scaled so that it spans the specied number of pages in the vertical direc-
tion. The desired number of pages can be adjusted with the horizontal slider. Note
that this option is used only when the report Resolution option is set for graphics-
quality output. Due to intrinsic constraints on the output, the number of generated
pages may not be exactly equal to the amount specied with this option.
798

Chapter 7. The Projman Application
Compress To One Page
When this option is specied, the network diagram is compressed so that it is drawn
on one physical page. Note that this option is ignored unless the report Resolution
option is set for graphics-quality output.
Proportional Compress
When this option is specied, the network diagram is compressed so that it is drawn
on one physical page. This option is the same as the Compress To One Page option
except that the compression of the diagram is done proportionally to maintain the
correct aspect ratio. In other words, the amount of horizontal and vertical compres-
sion is equal. Note that this option is ignored unless the report Resolution option is
set for graphics-quality output.
Spanning Tree Layout
When this option is specied, the nodes in the network diagram are positioned us-
ing a spanning tree. This method typically results in a wider layout than the default.
However, for networks that have totally disjoint pieces, this option separates the net-
work into connected components (or disjoint trees). This option is ignored if a time
axis is being drawn or if the Zone variable is specied.
Automatic Zone Layout
When specied, this option allows automatic zoning (or dividing) of the network
into connected components. This option is equivalent to adding an automatic Zone
variable that associates a tree number for each node. The tree number refers to a
number assigned automatically to each distinct tree of a spanning tree of the network.
Suppress Zone Labels
When this option is selected and a Zone variable is specied, the zone labels and
dividing lines are omitted from the network diagram.
Space Between Zones
When this option is selected and the Zone variable is specied, extra empty space is
placed between consecutive zones.
Draw Border
When this option is specied, a border (or frame) is drawn around the network dia-
gram. This option is ignored if no time axis is being drawn or if no Zone variable is
specied.
Suppress Page Numbers
When this option is selected, no page numbers are drawn in the upper right-hand
corner of a multipage network diagram. By default, pages are numbered from left to
right, top to bottom.
Node Options

799
Node Options
Text Height
When text height is specied as h, all text drawn on the network diagram (excluding
titles and footnotes) is h times the value of the global text height option, which is
specied in the Report Options window. For more information on this window, see
the Report Options Window section on page 779. Note that this option is ignored
unless the report Resolution option is set for graphics-quality output.
Center Id Values
When this option is specied, all values of variables in the Identier list are centered
within each node in the network diagram. By default, character valued variables are
left justied and numeric valued variables are right justied within each node. Note
that this option is ignored unless the report Resolution option is set for graphics-
quality output.
Show Default Vars
When this option is specied, values of the default variables are displayed within
each node. These values include the activity name and any project schedule dates or
oat amounts. If this option is not selected, only values appearing in the Identier list
are displayed.
Label Variables
When this option is specied, short (3-character) labels are displayed in front of the
values that are listed within each node of the network diagram. By default, there are
no labels.
Show Duration
When this option is specied, the duration of each activity is listed within the corre-
sponding node in the network diagram.
Show Progress
When this option is specied, the current status (completed, in-progress, or pending)
is indicated within each node of the network diagram. If the network diagram is cre-
ated with lineprinter or fullscreen resolution, activities in progress are outlined with
the letter P and completed activities are outlined with the letter F; in graphics-quality
resolution, 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. Pending activities are drawn in the default manner.
800

Chapter 7. The Projman Application
Time Scale Options
Schedule
Selecting a schedule indicates that a time axis is to be drawn across the top of the
network diagram and nodes are to be positioned horizontally according to the values
of the selected schedule start times. The minimum and maximum values are used to
determine the time axis. You can choose from the baseline, early, late, and resource-
constrained schedules.
Suppress Time Axis
When this option is selected, no time axis is drawn on the network diagram; however,
nodes are still positioned horizontally according to the Schedule option.
Draw Linear Time Axis
When a time axis is being drawn on the network diagram, the axis is divided up into
even intervals based on the duration unit. By default, only those intervals (columns)
that contain at least one activity are drawn. When this option is specied, all intervals
are drawn. In some cases, this option may cause the network diagram to span many
pages in the horizontal direction.
Show Time Axis Breaks
When this option is specied, breaks in the time axis are indicated by drawing a
jagged break in the time axis line just before the tick mark corresponding to the
break. The time axis is determined by the setting of the Schedule option.
Draw Reference Lines
When this option is specied, a reference line is drawn at every tick mark (column)
along the time axis. Reference lines are vertical lines drawn at specic positions
along the time axis to indicate time intervals. The time axis is determined by the
setting of the Schedule option.
Show Ref. Line Breaks
When this option is specied, breaks in the time axis are indicated by drawing a
zigzag line down the network diagram just before the tick mark corresponding to the
break. The time axis is determined by the setting of the Schedule option.
Arc Options
Draw Separate Arcs
When this option is specied, arcs drawn on the network diagram are allowed to
follow distinct tracks. By default, all segments of the arcs are drawn along a central
track between the nodes, which may cause several arcs to be drawn on top of one
another. If this option is selected, the arcs are drawn so that they do not overlap. Note
that this option is ignored unless the report Resolution option is set for graphics-
quality output.
Color Options

801
Draw Rectangular Arcs
When this option is specied, all arcs are drawn with rectangular corners. By default,
arcs are drawn with rounded corners when the report Resolution option is set for
graphics-quality output.
Show Precedence Type
When this option is specied, arcs are drawn to indicate the type of logical relation-
ship between the activities at either end of the arc. The start and end points of the
arcs are adjusted to represent the specic relationship. By default, all arcs are drawn
out of the right edge of nodes and into the left edge of nodes.
Suppress Arrowheads
When this option is specied, all arcs are drawn without arrowheads.
Draw Open Arrowheads
When this option is selected, the arrowheads on the end of the arcs are not lled. By
default, the arrowheads are lled (solid). Note that this option is ignored unless the
report Resolution option is set for graphics-quality output.
Color Options
This window is used to set options that control the color of various features of the
network diagram. Note that these options are ignored unless the report Resolution
option is set for graphics-quality output.
Arcs
The Arcs combo box can be used to specify the color to use for drawing the connect-
ing lines between the nodes in the network diagram.
Critical Arcs
The Critical Arcs combo box can be used to specify the color to use for drawing the
arcs connecting critical activities in the network diagram.
802

Chapter 7. The Projman Application
Reference Lines
The Reference Lines combo box can be used to specify the color to use for drawing
reference lines on the network diagram. Reference lines are vertical lines drawn at
specic positions along the time axis to indicate time intervals. Note that this option
is used only when a time axis is drawn along the top of the network diagram.
Node Text
The Node Text combo box can be used to specify the color to use for displaying text
that appears within nodes on the network diagram. Note that this color specication
does not apply to titles, footnotes, or any annotated text.
Time Axis
The Time Axis combo box can be used to specify the color to use for displaying the
time axis along the top of the network diagram. The same color is also used for the
frame around the chart area (where the activity bars are drawn). Note that this option
is used only when a time axis is drawn along the top of the network diagram.
Resource Report Options Window
This window provides access to the settings and options available for resource re-
ports. By changing values in this window, you can create and customize reports
to meet your specic needs. Note that some options may be unavailable if the active
project does not contain the appropriate data. Also, if data unique to a specic project
are required by a report, that report may fail when generated for a different project.
Note that reports can be generated and viewed to verify the results before any changes
are saved. Access to the source code is also provided.
For a description of standard report options, see the Standard Options section on
page 783.
Resource
You can use the Resource combo box to select a specic resource for the report. By
default, all resources are used for the report. When a resource is selected and the
Scope option indicates that the selected resource is to be used, the resulting report
contains summarized information for that resource only.
Tabular Listing Options Window

803
Scope
The Scope option indicates whether the report is to utilize data about all project re-
sources or only the resource specied with the Resource option. By default, all
resources are used for the report. When a resource is selected with the Resource
option and Selected Resource is chosen, the resulting report contains summarized
information for the selected resource only.
Resolution
This option is used to specify the resolution of the resource report. The report can be
produced with either lineprinter or graphics quality.
Tabular Listing Options Window
This window provides access to the settings and options available for tabular listing
reports. By changing values in this window, you can create and customize reports
to meet your specic needs. Note that some options may be unavailable if the active
project does not contain the appropriate data. Also, if data unique to a specic project
are required by a report, that report may fail when generated for a different project.
Note that reports can be generated and viewed to verify the results before any changes
are saved. Access to the source code is also provided.
For a description of standard report options, see the Standard Options section on
page 783.
Variables
When this button is pressed, a window is opened to allow selections to be added to the
Variable list. Selections are added to the bottom of the list as they are chosen. Items
can be removed from the Variable list by selecting the desired items and pressing the
Remove button.
804

Chapter 7. The Projman Application
Variable List
The Variable list contains the list of variables that are to be displayed in the tabular
listing report. The information contained in these variables is displayed to the right of
the information provided by the Identier list in the report. Use the Variables button
to add items to this list.
Remove
When this button is pressed, highlighted selections in the Identier, Sub-Group, and
Variable lists are deleted.
Observations
This option enables you to control which observations are used for the tabular list-
ing report. The All selection indicates that all records in the input data set are to be
used, while the Collapse selection indicates that only one observation should be dis-
played for each activity. When activities have multiple successors (as is usually the
case), the input data set contains multiple records for some activities. Thus, when all
observations are used, there can be some duplication in the resulting report.
Options...
By pressing this button, you can access a window containing additional options for
the tabular listing report. These options are used to format the output.
Additional Options
Round values
When you select this option, all numeric variables are rounded to two decimal places.
Values are rounded before summing for totals and subtotals.
Double space
When you select this option, the report is double spaced. If this option is not specied,
the report is single spaced.
Suppress labels
By default, variable labels are displayed instead of the variable names as the col-
umn heading in the tabular listing report. If you choose this option, the labels are
suppressed and the variable names are used instead.
Import Activity Data Set Window

805
Print observation number
When this option is selected, an observation (record) number is displayed for each
observation in the tabular listing report. If the Identier list is not empty, this option
has no effect.
Print number of observations
When this option is selected, the total number of observations (records) in the tabular
listing report is displayed at the end of the report.
Format pages uniformly
When this option is specied, all pages of the tabular listing report are formatted
uniformly. If this option is not specied, some pages may be spaced differently (de-
pending on the data).
Import Activity Data Set Window
This window enables you to import a SAS data set that contains project activity in-
formation. Projman assumes that the selected data set is in the format appropriate for
input to the CPM or PM procedure. For more information, refer to Chapter 2, The
CPM Procedure, or Chapter 6, The PM Procedure.
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 activity data set
is imported, a new project is created.
806

Chapter 7. The Projman Application
Standard Import Options
The following set of options are common to several different import windows.
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 Data Set list.
Data Set
This list contains the names of all SAS data sets that currently reside in the selected
library. When you select the data set that you want to import, the Variables list
is populated automatically. When a data set is selected, some automatic variable
selection may also take place.
Variables
This list contains the names of the variables that currently exist in the selected SAS
data set. To import variable selections, simply select the desired variable or variables
in this list and press the appropriate button.
Import
When all necessary selections have been made, pressing this button causes the se-
lected data set to be imported. If additional selections are required, an attention win-
dow is displayed.
OK
Pressing this button accepts the current selections and closes the window.
Cancel
Pressing this button cancels the current selections and closes the window or aborts
the import process if it is selected in the primary import window.
Reset
Pressing this button causes all variable selections in the current window to be cleared.
Remove
When the Remove check box is selected, pressing a variable button causes the cor-
responding import variable selection to be cleared. You can use the Reset button to
clear all import variable selections in the current window.
Basic Activity Information

807
Secondary Windows
Progress / Baseline
Pressing this button opens a window that enables you to specify variables that contain
activity progress information and baseline schedules. This information is optional.
For information on this window, see the Progress/Baseline Information section on
page 809.
Resources
Pressing this button opens a window that enables you to identify the variables that
contain resource requirement information for the activities. You can also specify
which variable contains the activity work rate. This information is optional. For
information on this window, see the Resource Information section on page 810.
Additional Info
Pressing this button opens a window that enables you to specify variables that contain
information about activity target (alignment) dates, limits on activity delay, activity
priorities for resource scheduling, and activity splitting. This information is optional.
For information on this window, see the Additional Information section on page
811.
Basic Activity Information
This window is used to identify variables that contain basic activity information. For
a description of standard import options, see the Standard Import Options section
on page 806.
808

Chapter 7. The Projman Application
Activity
The Activity variable should contain values that represent the names of the activities
of the project. These names are assumed to be unique for each activity. This variable
can contain either character or numeric values. If Successor variables are specied,
the format must be the same as the Activity variable. An Activity variable is required.
Successors
The Successor variables should contain values that represent the names of the succes-
sor activities of the project. This variable can contain either character or numeric val-
ues. If Successor variables are specied, the format must be the same as the Activity
variable.
Description
The Description variable normally will contain values that provide more detailed in-
formation (that is, longer name) about the activity. This variable can be either char-
acter or numeric.
Project
The Project variable should contain values that represent the names of the parent
(project) activities of the project. In other words, this variable indicates the parent-
child (supertask-subtask) relationship between the activity named in the Project vari-
able and the activity named in the Activity variable. This variable should be in the
same format as the Activity variable.
Duration
The Duration variable should contain values that represent the duration of each
project activity. The unit of duration is assumed to be the same for each activity.
This variable must be numeric.
Lead / Lag
The Lead / Lag variables should contain values that represent the lags (or non-
standard precedence relationships) between the activities specied in the Activity
and Successor variables. Although it is not required, the number of Lead / Lag vari-
ables should match the number of Successor variables. The lag values are required
to follow the same naming convention as that used by the CPM procedure. For more
information, see the LAG= option in the SUCCESSOR Statement section on page
103.
Calendar
The Calendar variable should contain values that represent the name of the calendar
that the activity is to follow. Projman assumes that the calendars will be dened after
the activities are imported. At that time, you can create the calendars manually or
import a calendar data set. This variable can be either character or numeric.
Progress/Baseline Information

809
Details
The Details variables can be used to import non-standard information about the ac-
tivities that is stored in the import data set. For instance, you may want to import
information stored in variables representing the phase of the project or the depart-
ment that is responsible for the activity. These variables can be both character and
numeric.
Progress/Baseline Information
This window is used to identify variables that contain activity progress informa-
tion and baseline schedules. For a description of standard import options, see the
Standard Import Options section on page 806.
Actual Start
The Actual Start variable should contain values that represent the actual start date of
the activity. This variable must be numeric.
Actual Finish
The Actual Finish variable should contain values that represent the actual nish date
of the activity. This variable must be numeric.
% Completed
The Percent Completed variable should contain values representing the percentage
of the activity that is completed. This variable must be numeric and should contain
values between 0 and 100.
810

Chapter 7. The Projman Application
Rem. Duration
The Remaining Duration variable should contain values that represent the amount of
time remaining for an activity that is in progress. This variable must be numeric and
should contain nonnegative values. The unit of duration is assumed to be the same as
that for the Duration variable.
Baseline Start
The Baseline Start variable should contain values that represent the baseline start date
of the activity. This variable must be numeric.
Baseline Finish
The Baseline Finish variable should contain values that represent the baseline nish
date of the activity. This variable must be numeric.
Resource Information
This window is used to identify variables that contain resource requirement informa-
tion. For a description of standard import options, see the Standard Import Options
section on page 806.
Resources
The Resource variables should contain values that indicate the amount of resource
that is needed for a particular activity. For consumable resources, this value represents
the amount of resource needed per unit of duration; for replenishable resources, it
indicates the amount of resource that must be available throughout the duration of the
activity. These variables must be numeric.
Additional Information

811
Work Rate
The Work Rate variable should contain values that indicate the total amount of work
(time) required by one unit of a resource for a particular activity. This variable can
be used to drive the activity duration for each resource required by the activity using
the resource rate specied in the corresponding Resource variable.
Additional Information
This window is used to identify variables that contain additional activity informa-
tion. For a description of standard import options, see the Standard Import Options
section on page 806.
Target Date
The Target Date variable should contain values that represent the date portion of
an activity alignment constraint. For example, an activity must nish on or before
a particular date. The type of alignment constraint is specied in the Target Type
variable. The Target Date variable must be numeric.
Target Type
The Target Type variable should contain values that represent the type portion of
an activity alignment constraint. For example, an activity must nish on or before
a particular date. The date portion of the alignment constraint is specied in the
Target Date variable. The target type values are required to follow the same nam-
ing convention as that used by the CPM procedure. For more information, see the
ALIGNTYPE Statement section on page 85.
812

Chapter 7. The Projman Application
Min Seg. Duration
The MinimumSegment Duration variable should contain values that indicate the min-
imum duration of a single segment of an activity (when activity splitting is allowed).
This variable must be numeric.
Max Num. Segments
The Maximum Number of Segments variable should contain values that indicate the
maximum number of segments into which an activity can be split (when activity
splitting is allowed). This variable must be numeric.
Activity Delay
The Activity Delay variable should contain values that indicate the maximum amount
of time by which an activity can be delayed due to resource unavailability. This
variable must be numeric.
Activity Priority
The Activity Priority variable should contain values that indicate the priority of an
activity (lower values indicate higher priority). The activity priority can be used to
order activities that are waiting for an unavailable resource. This variable must be
numeric.
Import Calendar Data Set Window
This window enables you to import a SAS data set that contains calendar 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 CALEDATA 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 calendar data
set is imported, the appropriate calendars are created.
Note that valid calendar data sets are expected to contain the following standard vari-
ables:

SUN

,

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

ORGANTT macro variable, 20, 442, 450, 490


output, 487
overview, 19, 409
Precedence data set, 411, 423, 453, 474
precedence relationships, 411, 412, 473475,
477480
Schedule data set, 411, 412, 422, 451, 474, 488
scheduling holidays, 501
table of syntax elements, 417
time axis, 410, 456, 464
variables, 453
Workday data set, 411, 422, 424, 457, 458
Gantt View, 706
alignment constraints, 709
display schedule bar, 708
display task information, 708
edit durations, 710
edit lag, 711
hide schedule bar, 708
Subject Index

843
lag calendar, 711
nonstandard precedence relationships, 710, 712,
714
PM procedure, 706
PM Window, 706
progress information, 711
time axis format, 707
time axis units, 708
time increment, 707
time scale, 707
general options
DTREE procedure, 323326
GANTT procedure, 424
NETDRAW procedure, 595601

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

ORGANTT, 442, 450, 490

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

ORNETDR macro variable, 21, 627


output data sets, 583
overview, 20, 21, 583
page format details, 615
restricting number of tracks, 613
rotating the network, 618, 621
saving network layout information, 609
showing activity progress, 614
splitting across pages, 614, 615
syntax skeleton, 590
table of syntax elements, 590
time-axis format, 618, 619
time-scaled networks, 584, 588, 595, 597600,
618620
top-down networks, 618, 621
topological ordering, 612
tree diagrams, 596, 599, 600, 621
using full-screen to modify layout, 617
variables, list of, 610, 611
vertical placement of nodes, 617
zoned networks, 584, 599, 601, 620
848

Subject Index
Network data set
description, 610
list of variables, 610, 611
NETDRAW procedure, 583, 594, 609
network diagrams,
See also NETDRAW procedure
Activity-on-Arc, 67
Activity-on-Node, 67
network layout, NETDRAW procedure
discussion, 611614, 616618
modications for time-scaled networks, 619
modications for zoned networks, 620
use of dynamic programming, 613
nodes on decision tree, 321,
See also chance nodes
See also decision nodes
See also end nodes
nodes on network diagram
coordinates, 612
height, 596, 613, 647
layout, 611
width, 596, 613, 640
noncritical activities
ll pattern for duration of (GANTT), 465
ll pattern for slack time of (GANTT), 465
nonstandard precedence relationships
CPM procedure, 108, 109
example (CPM), 194
GANTT procedure, 411, 412, 473, 474, 477479
Gantt View, 710, 712, 714
graphics example (GANTT), 549
lag calendar, 103, 104, 196, 197
lag duration, 103
lag types, 103
lag variables, 103, 195
specication, CPM procedure, 103, 104
NPV,
See net present value
number of columns, global graphics options
DTREE procedure, 354
number of nodes
horizontal (NETDRAW), 606
vertical (NETDRAW), 606
number of pages
displaying decision tree diagram, 353
displaying network diagram, 599
horizontal (NETDRAW), 604
NETDRAW procedure, 615
vertical (NETDRAW), 607
number of rows, global graphics options
DTREE procedure, 354
number pages
GANTT procedure, 446, 447
numerical precision, DTREE procedure, 357
O
OBSTYPE variable
Resource data set (CPM), 99, 126
OBS

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

macro variable, 18, 22, 149


order of stages
determining, 348
limitations to modifying, 337
modifying, 306, 337, 348
structuring decision problems, 348
order of statements
DTREE procedure, 347
ORFONT font (lled), 472
ORFONTE font (empty), 472
organizational charts
NETDRAW procedure, 621, 674

ORGANTT macro variable, 20, 442, 450, 490

ORNETDR macro variable, 21, 627

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

variable, 427, 455


treatment of nish times, 452
treatment of ID variables, 488
treatment of schedule variables, 451
treatment of SEGMT

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

9.1 Users Guide: Project


Management, please send them to us on a photocopy of this page or send us electronic
mail.
For comments about this book, please return the photocopy to
SAS Publishing
SAS Campus Drive
Cary, NC 27513
E-mail: [email protected]
For suggestions about the software, please return the photocopy to
SAS Institute Inc.
Technical Support Division
SAS Campus Drive
Cary, NC 27513
E-mail: [email protected]

You might also like