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 first 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.
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 define 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='2dec91:07:00'dt
interval=dtday daylength='08:30't
calendar=calendar;
activity task;
succ succ1 succ2 succ3;
duration days;
holiday holiday / holifin=(holifin);
run;
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 |
L_START |
L_FINISH |
T_FLOAT |
F_FLOAT |
1 |
Approve Plan |
5.5 |
02DEC91:07:00:00 |
07DEC91:11:14:59 |
02DEC91:07:00:00 |
07DEC91:11:14:59 |
0.0 |
0.0 |
2 |
Drawings |
10.0 |
07DEC91:11:15:00 |
19DEC91:11:14:59 |
07DEC91:11:15:00 |
19DEC91:11:14:59 |
0.0 |
0.0 |
3 |
Anal. Market |
5.0 |
07DEC91:11:15:00 |
13DEC91:11:14:59 |
16JAN92:11:15:00 |
22JAN92:11:14:59 |
30.0 |
0.0 |
4 |
Write Specs |
4.5 |
07DEC91:11:15:00 |
12DEC91:15:29:59 |
14DEC91:07:00:00 |
19DEC91:11:14:59 |
5.5 |
5.5 |
5 |
Prototype |
15.0 |
19DEC91:11:15:00 |
10JAN92:11:14:59 |
19DEC91:11:15:00 |
10JAN92:11:14:59 |
0.0 |
0.0 |
6 |
Mkt. Strat. |
10.0 |
13DEC91:11:15:00 |
28DEC91:11:14:59 |
22JAN92:11:15:00 |
03FEB92:11:14:59 |
30.0 |
30.0 |
7 |
Materials |
10.0 |
10JAN92:11:15:00 |
22JAN92:11:14:59 |
10JAN92:11:15:00 |
22JAN92:11:14:59 |
0.0 |
0.0 |
8 |
Facility |
10.0 |
10JAN92:11:15:00 |
22JAN92:11:14:59 |
10JAN92:11:15:00 |
22JAN92:11:14:59 |
0.0 |
0.0 |
9 |
Init. Prod. |
10.0 |
22JAN92:11:15:00 |
03FEB92:11:14:59 |
22JAN92:11:15:00 |
03FEB92:11:14:59 |
0.0 |
0.0 |
10 |
Evaluate |
10.0 |
03FEB92:11:15:00 |
14FEB92:11:14:59 |
08FEB92:11:15:00 |
20FEB92:11:14:59 |
5.0 |
5.0 |
11 |
Test Market |
15.0 |
03FEB92:11:15:00 |
20FEB92:11:14:59 |
03FEB92:11:15:00 |
20FEB92:11:14:59 |
0.0 |
0.0 |
12 |
Changes |
5.0 |
20FEB92:11:15:00 |
26FEB92:11:14:59 |
20FEB92:11:15:00 |
26FEB92:11:14:59 |
0.0 |
0.0 |
13 |
Production |
0.0 |
26FEB92:11:15:00 |
26FEB92:11:15:00 |
26FEB92:11:15:00 |
26FEB92:11:15:00 |
0.0 |
0.0 |
14 |
Marketing |
0.0 |
03FEB92:11:15:00 |
03FEB92:11:15:00 |
26FEB92:11:15:00 |
26FEB92:11:15:00 |
20.0 |
20.0 |
|
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 |
L_START |
L_FINISH |
T_FLOAT |
F_FLOAT |
1 |
Approve Plan |
5.5 |
02DEC91:08:00:00 |
07DEC91:11:59:59 |
02DEC91:08:00:00 |
07DEC91:11:59:59 |
0.0 |
0.0 |
2 |
Drawings |
10.0 |
09DEC91:08:00:00 |
20DEC91:11:59:59 |
09DEC91:08:00:00 |
20DEC91:11:59:59 |
0.0 |
0.0 |
3 |
Anal. Market |
5.0 |
09DEC91:08:00:00 |
13DEC91:15:59:59 |
21JAN92:08:00:00 |
27JAN92:11:59:59 |
30.0 |
0.0 |
4 |
Write Specs |
4.5 |
09DEC91:08:00:00 |
13DEC91:11:59:59 |
16DEC91:08:00:00 |
20DEC91:11:59:59 |
5.5 |
5.5 |
5 |
Prototype |
15.0 |
20DEC91:12:00:00 |
14JAN92:11:59:59 |
20DEC91:12:00:00 |
14JAN92:11:59:59 |
0.0 |
0.0 |
6 |
Mkt. Strat. |
10.0 |
14DEC91:08:00:00 |
31DEC91:11:59:59 |
27JAN92:12:00:00 |
07FEB92:15:59:59 |
30.0 |
30.0 |
7 |
Materials |
10.0 |
14JAN92:12:00:00 |
27JAN92:11:59:59 |
14JAN92:12:00:00 |
27JAN92:11:59:59 |
0.0 |
0.0 |
8 |
Facility |
10.0 |
14JAN92:12:00:00 |
27JAN92:11:59:59 |
14JAN92:12:00:00 |
27JAN92:11:59:59 |
0.0 |
0.0 |
9 |
Init. Prod. |
10.0 |
27JAN92:12:00:00 |
07FEB92:15:59:59 |
27JAN92:12:00:00 |
07FEB92:15:59:59 |
0.0 |
0.0 |
10 |
Evaluate |
10.0 |
08FEB92:08:00:00 |
20FEB92:15:59:59 |
14FEB92:12:00:00 |
27FEB92:11:59:59 |
5.0 |
5.0 |
11 |
Test Market |
15.0 |
08FEB92:08:00:00 |
27FEB92:11:59:59 |
08FEB92:08:00:00 |
27FEB92:11:59:59 |
0.0 |
0.0 |
12 |
Changes |
5.0 |
27FEB92:12:00:00 |
04MAR92:15:59:59 |
27FEB92:12:00:00 |
04MAR92:15:59:59 |
0.0 |
0.0 |
13 |
Production |
0.0 |
05MAR92:08:00:00 |
05MAR92:08:00:00 |
05MAR92:08:00:00 |
05MAR92:08:00:00 |
0.0 |
0.0 |
14 |
Marketing |
0.0 |
08FEB92:08:00:00 |
08FEB92:08:00:00 |
05MAR92:08:00:00 |
05MAR92:08:00:00 |
20.0 |
20.0 |
|
Suppose now that you want to schedule work on a five-and-a-half day
week (five 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 define
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 specifies 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='2dec91'd
interval=day
workday=workdat calendar=caldat;
activity task;
succ succ1 succ2 succ3;
duration days;
holiday holiday / holifin=(holifin);
run;
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 define 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 specifications.
To visualize the breaks in the work schedule created by these
specifications, 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 20, 1991 to December 28, 1991. 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='20dec91:08:00'dt;
e_finish='28dec91:23:59:59'dt;
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;
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 20 20 21 21 21 22
Calendar 08:00 16:00 00:00 08:00 16:00 00:00
-+-------+-------+-------+-------+-------+-
Schedule Breaks |<-------****************----*************|
-+-------+-------+-------+-------+-------+-
|
DEC DEC DEC DEC DEC DEC DEC DEC
22 22 22 23 23 23 24 24
00:00 08:00 16:00 00:00 08:00 16:00 00:00 08:00
-+-------+-------+-------+-------+-------+-------+-------+-
|********************************--------****************-|
-+-------+-------+-------+-------+-------+-------+-------+-
|
DEC DEC DEC DEC DEC DEC DEC DEC
24 24 25 25 25 26 26 26
08:00 16:00 00:00 08:00 16:00 00:00 08:00 16:00
-+-------+-------+-------+-------+-------+-------+-------+-
|--------*************************************************|
-+-------+-------+-------+-------+-------+-------+-------+-
|
DEC DEC DEC DEC DEC DEC DEC DEC
26 27 27 27 28 28 28 29
16:00 00:00 08:00 16:00 00:00 08:00 16:00 00:00
-+-------+-------+-------+-------+-------+-------+-------+-
|****************************************----*************|
-+-------+-------+-------+-------+-------+-------+-------+-
|
|
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.