Chapter Contents


The CALENDAR Procedure

Example 6: Calculating a Schedule Based on Completion of Predecessor Tasks

Procedure features:
CALID statement
FIN statement
VAR statement
Other features:

Automating Your Scheduling Task with SAS/OR Software
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

  1. create an activities data set that contains activities with durations. (You can indicate nonwork days, weekly work schedules, and workshifts with holidays, calendar, and workshift data sets.)

  2. indicate which activities are successors to others (precedence relationships).

  3. define resource limitations if you want them considered in the schedule.

  4. 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, workshifts, 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.

Highlights of This Example
This example

This example features PROC CPM's ability to calculate a schedule that

See Also
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, Version 6, First Edition.

 Note about code
options nodate pageno=1 linesize=132 pagesize=60;

 Note about code
data grant;
   input jobnum Task $ 4-22 Days Succ1 $ 27-45 aldate : date7. altype $
         _cal_ $;
   format aldate date7.;
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.
 Note about code
data nowork;
   format holista date7. holifin date7.;
   input holista : date7. holifin : date7. name $ 17-32 _cal_ $;
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
 Note about code
proc cpm data=grant
   activity task;
   successor succ1;
   duration days;
   calid _cal_;
   id task;
   aligndate aldate;
   aligntype altype;
   holiday holista / holifin=holifin;
 Note about code
proc print data=gcpm1;
   title 'Data Set GCPM1, Created with PROC CPM';

 Note about code
proc sort data=gcpm1;
   by e_start;
 Note about code
proc calendar data=gcpm1
   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';


The Data Set GCPM1
PROC PRINT displays the observations in GCPM1, showing the scheduling calculations created by PROC CPM. [HTML Output]
 [Listing Output]

Schedule Calendar Based on Output from PROC CPM
PROC CALENDAR created this schedule calendar by using the S_START and S_FINISH dates that were calculated by PROC CPM. The activities on July 24th and August 14th, because they are milestones, do not delay the start of a successor activity. Note that Site Visit occurs on July 18, the same day that Analyze Exp 1 occurs. To prevent this overallocation of resources, you can use resource constrained scheduling, available in SAS/OR software. [HTML Output]
 [Listing Output]

Chapter Contents



Top of Page

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