Procedure features: |
PROC CALENDAR statement |
CALID
statement |
FIN statement |
VAR statement |
|
Other features: |
PROC CPM step |
PROC SORT step |
|
When changes occur to a schedule, you have to adjust the activity
starting dates manually if you use PROC CALENDAR to produce a schedule calendar.
Alternatively, you can use PROC CPM in SAS/OR software to reschedule work
when dates change. Even more important, you can provide only an initial starting
date for a project and let PROC CPM calculate starting dates for activities,
based on identified successor tasks, that is, tasks that cannot begin until
their predecessors end.
In order to use PROC CPM, you must
-
create an activities data set that contains activities with durations.
(You can indicate nonwork days, weekly work schedules, and work shifts with
holidays, calendar, and work-shift data sets.)
-
indicate which activities are successors to others (precedence
relationships).
-
define resource limitations if you want them considered
in the schedule.
-
provide an initial starting date.
PROC CPM can process your data to generate a data set that contains
the start and end dates for each activity. PROC CPM schedules the activities,
based on the duration information, weekly work patterns, work shifts, as well
as holidays and nonwork days that interrupt the schedule. You can generate
several views of the schedule that is computed by PROC CPM, from a simple
listing of start and finish dates to a calendar, a Gantt chart, or a network
diagram.
This example
-
calculates a project schedule containing multiple calendars (PROC
CPM)
-
produces a listing of the PROC CPM output data set (PROC PRINT)
-
displays the schedule in calendar format (PROC
CALENDAR).
This example features PROC CPM's ability to calculate a schedule that
-
is based on an initial starting
date
-
applies different non-work periods to different calendars, such
as personal vacation days to each employee's schedule
-
includes milestones (activities with a duration of 0).
This example introduces users of PROC CALENDAR to more advanced SAS
scheduling tools. For an introduction to project management tasks and tools
and several examples, see Project Management Using the SAS System.
For more examples, see SAS/OR Software: Project Management Examples. For complete reference documentation, see
SAS/OR User's Guide: Project Management.
|
options nodate pageno=1 linesize=132 pagesize=60; |
|
data grant;
input jobnum Task $ 4-22 Days Succ1 $ 27-45 aldate : date7. altype $
_cal_ $;
format aldate date7.;
datalines;
1 Run Exp 1 11 Analyze Exp 1 . . Student
2 Analyze Exp 1 5 Send Report 1 . . Prof.
3 Send Report 1 0 Run Exp 2 . . Prof.
4 Run Exp 2 11 Analyze Exp 2 . . Student
5 Analyze Exp 2 4 Send Report 2 . . Prof.
6 Send Report 2 0 Write Final Report . . Prof.
7 Write Final Report 4 Send Final Report . . Prof.
8 Send Final Report 0 . . Student
9 Site Visit 1 18jul96 ms Prof.
; |
|
data nowork;
format holista date7. holifin date7.;
input holista : date7. holifin : date7. name $ 17-32 _cal_ $;
datalines;
04jul96 04jul96 Independence Day Prof.
02sep96 02sep96 Labor Day Prof.
04jul96 04jul96 Independence Day Student
02sep96 02sep96 Labor Day Student
15jul96 16jul96 PROF Vacation Prof.
15aug96 16aug96 STUDENT Vacation Student
; |
|
proc cpm data=grant
date='01jul96'd
interval=weekday
out=gcpm1
holidata=nowork;
activity task;
successor succ1;
duration days;
calid _cal_;
id task;
aligndate aldate;
aligntype altype;
holiday holista / holifin=holifin;
run; |
|
proc print data=gcpm1;
title 'Data Set GCPM1, Created with PROC CPM';
run; |
|
proc sort data=gcpm1;
by e_start;
run; |
|
proc calendar data=gcpm1
holidata=nowork
interval=workday;
start e_start;
fin e_finish;
calid _cal_ / output=combine;
holistart holista;
holifin holifin;
holivar name;
var task;
title 'Schedule for Experiment X-15';
title2 'Professor and Student Schedule';
run; |
The Data Set GCPM1
|
Data Set GCPM1, Created with PROC CPM 1
Obs Task Succ1 Days _cal_ E_START E_FINISH L_START L_FINISH T_FLOAT F_FLOAT
1 Run Exp 1 Analyze Exp 1 11 Student 01JUL96 16JUL96 01JUL96 16JUL96 0 0
2 Analyze Exp 1 Send Report 1 5 Prof. 17JUL96 23JUL96 17JUL96 23JUL96 0 0
3 Send Report 1 Run Exp 2 0 Prof. 24JUL96 24JUL96 24JUL96 24JUL96 0 0
4 Run Exp 2 Analyze Exp 2 11 Student 24JUL96 07AUG96 24JUL96 07AUG96 0 0
5 Analyze Exp 2 Send Report 2 4 Prof. 08AUG96 13AUG96 08AUG96 13AUG96 0 0
6 Send Report 2 Write Final Report 0 Prof. 14AUG96 14AUG96 14AUG96 14AUG96 0 0
7 Write Final Report Send Final Report 4 Prof. 14AUG96 19AUG96 14AUG96 19AUG96 0 0
8 Send Final Report 0 Student 20AUG96 20AUG96 20AUG96 20AUG96 0 0
9 Site Visit 1 Prof. 18JUL96 18JUL96 18JUL96 18JUL96 0 0
| |
Schedule Calendar Based on Output from PROC CPM
|
Schedule for Experiment X-15 2
Professor and Student Schedule
------------------------------------------------------------------------------------------------------------------------
| |
| July 1996 |
| |
|----------------------------------------------------------------------------------------------------------------------|
| Sunday | Monday | Tuesday | Wednesday | Thursday | Friday | Saturday |
----------+----------------+----------------+----------------+----------------+----------------+----------------+----------------|
| | | 1 | 2 | 3 | 4 | 5 | 6 |
|.........|................|................|................|................|................|................|................|
| PROF. | | | | |Independence Day| | |
|.........|................|................|................|................|................|................|................|
| STUDENT | |+===================Run Exp 1====================>|Independence Day|<==Run Exp 1===>| |
| | | | | | | | |
| | | | | | | | |
|---------+----------------+----------------+----------------+----------------+----------------+----------------+----------------|
| | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
|.........|................|................|................|................|................|................|................|
| STUDENT | |<====================================Run Exp 1=====================================>| |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
|---------+----------------+----------------+----------------+----------------+----------------+----------------+----------------|
| | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
|.........|................|................|................|................|................|................|................|
| PROF. | |*PROF Vacation**|*PROF Vacation**| |+==Site Visit==+| | |
| | | | |+=================Analyze Exp 1==================>| |
|.........|................|................|................|................|................|................|................|
| STUDENT | |<===========Run Exp 1===========+| | | | |
| | | | | | | | |
|---------+----------------+----------------+----------------+----------------+----------------+----------------+----------------|
| | 21 | 22 | 23 | 24 | 25 | 26 | 27 |
|.........|................|................|................|................|................|................|................|
| PROF. | |<=========Analyze Exp 1=========+|+Send Report 1=+| | | |
|.........|................|................|................|................|................|................|................|
| STUDENT | | | |+===================Run Exp 2====================>| |
| | | | | | | | |
| | | | | | | | |
|---------+----------------+----------------+----------------+----------------+----------------+----------------+----------------|
| | 28 | 29 | 30 | 31 | | | |
|.........|................|................|................|................|................|................|................|
| STUDENT | |<===================Run Exp 2====================>| | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
---------------------------------------------------------------------------------------------------------------------------------- Schedule for Experiment X-15 3
Professor and Student Schedule
------------------------------------------------------------------------------------------------------------------------
| |
| August 1996 |
| |
|----------------------------------------------------------------------------------------------------------------------|
| Sunday | Monday | Tuesday | Wednesday | Thursday | Friday | Saturday |
----------+----------------+----------------+----------------+----------------+----------------+----------------+----------------|
| | | | | | 1 | 2 | 3 |
|.........|................|................|................|................|................|................|................|
| STUDENT | | | | |<===========Run Exp 2===========>| |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
|---------+----------------+----------------+----------------+----------------+----------------+----------------+----------------|
| | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
|.........|................|................|................|................|................|................|................|
| PROF. | | | | |+=========Analyze Exp 2=========>| |
|.........|................|................|................|................|................|................|................|
| STUDENT | |<===================Run Exp 2====================+| | | |
| | | | | | | | |
| | | | | | | | |
|---------+----------------+----------------+----------------+----------------+----------------+----------------+----------------|
| | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
|.........|................|................|................|................|................|................|................|
| PROF. | | | |+===============Write Final Report===============>| |
| | |<=========Analyze Exp 2=========+|+Send Report 2=+| | | |
|.........|................|................|................|................|................|................|................|
| STUDENT | | | | |STUDENT Vacation|STUDENT Vacation| |
| | | | | | | | |
|---------+----------------+----------------+----------------+----------------+----------------+----------------+----------------|
| | 18 | 19 | 20 | 21 | 22 | 23 | 24 |
|.........|................|................|................|................|................|................|................|
| PROF. | |<Write Final Re+| | | | | |
|.........|................|................|................|................|................|................|................|
| STUDENT | | |+Send Final Rep+| | | | |
| | | | | | | | |
| | | | | | | | |
|---------+----------------+----------------+----------------+----------------+----------------+----------------+----------------|
| | 25 | 26 | 27 | 28 | 29 | 30 | 31 |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
----------------------------------------------------------------------------------------------------------------------------------
| |
|
|
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.