libname well 'SAS-library';
data well.act;
input task & $16. dur : 5. date : datetime16. _cal_ $ cost;
datalines;
Drill Well 3.50 01JUL02:12:00:00 CAL1 1000
Lay Power Line 3.00 04JUL02:12:00:00 CAL1 2000
Assemble Tank 4.00 05JUL02:08:00:00 CAL1 1000
Build Pump House 3.00 08JUL02:12:00:00 CAL1 2000
Pour Foundation 4.00 11JUL02:08:00:00 CAL1 1500
Install Pump 4.00 15JUL02:14:00:00 CAL1 500
Install Pipe 2.00 19JUL02:08:00:00 CAL1 1000
Erect Tower 6.00 20JUL02:08:00:00 CAL1 2500
Deliver Material 2.00 01JUL02:12:00:00 CAL2 500
Excavate 4.75 03JUL02:08:00:00 CAL2 3500
;
data well.hol;
input date date. holiday $ 11-25 _cal_ $;
datalines;
09JUL02 Vacation CAL2
04JUL02 Independence CAL1
;
data well.cal;
input _sun_ $ _sat_ $ _mon_ $ _tue_ $ _wed_ $ _thu_ $
_fri_ $ _cal_ $;
datalines;
Holiday Holiday Workday Workday Workday Workday Workday CAL1
Holiday Halfday Workday Workday Workday Workday Workday CAL2
;
data well.wor;
input halfday time5.;
datalines;
08:00
12:00
;
proc sort data=well.act;
by _cal_ date;
run;
options formchar="|----|+|---+=|-/\<>*";
proc calendar data=well.act
holidata=well.hol
caledata=well.cal
workdata=well.wor
datetime;
calid _cal_ / output=separate;
start date;
dur dur;
holistart date;
holivar holiday;
outstart Monday;
outfin Saturday;
title1 'Well Drilling Work Schedule: Separate Calendars';
format cost dollar9.2;
run;
Program Description
data well.act;
input task & $16. dur : 5. date : datetime16. _cal_ $ cost;
datalines;
Drill Well 3.50 01JUL02:12:00:00 CAL1 1000
Lay Power Line 3.00 04JUL02:12:00:00 CAL1 2000
Assemble Tank 4.00 05JUL02:08:00:00 CAL1 1000
Build Pump House 3.00 08JUL02:12:00:00 CAL1 2000
Pour Foundation 4.00 11JUL02:08:00:00 CAL1 1500
Install Pump 4.00 15JUL02:14:00:00 CAL1 500
Install Pipe 2.00 19JUL02:08:00:00 CAL1 1000
Erect Tower 6.00 20JUL02:08:00:00 CAL1 2500
Deliver Material 2.00 01JUL02:12:00:00 CAL2 500
Excavate 4.75 03JUL02:08:00:00 CAL2 3500
;