Procedure features: |
PROC CALENDAR statement options:
|
CALEDATA= |
|
DATETIME |
|
WORKDATA= | |
CALID statement:
|
_CAL_ variable |
|
OUTPUT=SEPARATE option | |
DUR statement |
OUTSTART
statement |
OUTFIN statement |
|
This example
-
produces separate output pages for each calendar in a
single PROC
step
-
schedules activities around holidays
-
displays an 8-hour day, 5 1/2-day week
-
uses separate work patterns and holidays for
each calendar.
This example and Multiple Schedule Calendars with Atypical Work Shifts (Combined and Mixed Output) use the
same input data for multiple calendars to produce different output.
The only differences in these programs are how the activities data set is
sorted and how the OUTPUT= option is set.
To print ... |
Sort the activities data set by ... |
And set OUTPUT= to |
See Example |
Separate pages for each calendar |
calendar ID and starting date |
SEPARATE |
3, 8 |
All activities on the same page and identify each calendar |
starting date |
COMBINE |
4, 2 |
All activities on the same page and NOT identify each calendar |
starting date |
MIX |
4 |
|
libname well 'SAS-library'; |
|
data well.act;
input task & $16. dur : 5. date : datetime16. _cal_ $ cost;
datalines;
Drill Well 3.50 01JUL96:12:00:00 CAL1 1000
Lay Power Line 3.00 04JUL96:12:00:00 CAL1 2000
Assemble Tank 4.00 05JUL96:08:00:00 CAL1 1000
Build Pump House 3.00 08JUL96:12:00:00 CAL1 2000
Pour Foundation 4.00 11JUL96:08:00:00 CAL1 1500
Install Pump 4.00 15JUL96:14:00:00 CAL1 500
Install Pipe 2.00 19JUL96:08:00:00 CAL1 1000
Erect Tower 6.00 20JUL96:08:00:00 CAL1 2500
Deliver Material 2.00 01JUL96:12:00:00 CAL2 500
Excavate 4.75 03JUL96:08:00:00 CAL2 3500
; |
|
data well.hol;
input date date. holiday $ 11-25 _cal_ $;
datalines;
09JUL96 Vacation CAL2
04JUL96 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 nodate pageno=1 linesize=132 pagesize=60; |
|
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; |
Separate Output for Multiple Schedule Calendars
Well Drilling Work Schedule: Separate Calendars 1
............................................................ _cal_=CAL1 ............................................................
-------------------------------------------------------------------------------------------------------------------------------
| |
| July 1996 |
| |
|-----------------------------------------------------------------------------------------------------------------------------|
| Monday | Tuesday | Wednesday | Thursday | Friday | Saturday |
|--------------------+--------------------+--------------------+--------------------+--------------------+--------------------|
| 1 | 2 | 3 | 4 | 5 | 6 |
| | | |****Independence****| | |
| | | | | | |
| | | | | | |
| | | | |+Assemble Tank/$1,0>| |
| | | | |+Lay Power Line/$2,>| |
|+====================Drill Well/$1,000.00====================>| |<Drill Well/$1,000.+| |
|--------------------+--------------------+--------------------+--------------------+--------------------+--------------------|
| 8 | 9 | 10 | 11 | 12 | 13 |
| | | | | | |
| | | | | | |
| | | | | | |
|+===========================Build Pump House/$2,000.00============================+| | |
|<=============================Assemble Tank/$1,000.00=============================+| | |
|<=======Lay Power Line/$2,000.00========+| |+=======Pour Foundation/$1,500.00=======>| |
|--------------------+--------------------+--------------------+--------------------+--------------------+--------------------|
| 15 | 16 | 17 | 18 | 19 | 20 |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
|+=========================================Install Pump/$500.00=========================================+| |
|<=================Pour Foundation/$1,500.00==================+| |+Install Pipe/$1,00>| |
|--------------------+--------------------+--------------------+--------------------+--------------------+--------------------|
| 22 | 23 | 24 | 25 | 26 | 27 |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
|+========================================Erect Tower/$2,500.00=========================================>| |
|<========Install Pipe/$1,000.00=========+| | | | |
|--------------------+--------------------+--------------------+--------------------+--------------------+--------------------|
| 29 | 30 | 31 | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
|<Erect Tower/$2,500+| | | | | |
-------------------------------------------------------------------------------------------------------------------------------
Well Drilling Work Schedule: Separate Calendars 2
............................................................ _cal_=CAL2 ............................................................
-------------------------------------------------------------------------------------------------------------------------------
| |
| July 1996 |
| |
|-----------------------------------------------------------------------------------------------------------------------------|
| Monday | Tuesday | Wednesday | Thursday | Friday | Saturday |
|--------------------+--------------------+--------------------+--------------------+--------------------+--------------------|
| 1 | 2 | 3 | 4 | 5 | 6 |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | |+===============================Excavate/$3,500.00================================>|
|+==================Deliver Material/$500.00==================+| | | |
|--------------------+--------------------+--------------------+--------------------+--------------------+--------------------|
| 8 | 9 | 10 | 11 | 12 | 13 |
| |******Vacation******| | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
|<Excavate/$3,500.00>| |<Excavate/$3,500.00+| | | |
|--------------------+--------------------+--------------------+--------------------+--------------------+--------------------|
| 15 | 16 | 17 | 18 | 19 | 20 |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
|--------------------+--------------------+--------------------+--------------------+--------------------+--------------------|
| 22 | 23 | 24 | 25 | 26 | 27 |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
|--------------------+--------------------+--------------------+--------------------+--------------------+--------------------|
| 29 | 30 | 31 | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
-------------------------------------------------------------------------------------------------------------------------------
|
|
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.