Procedure features: |
PROC CALENDAR statement options:
|
CALID statement:
|
_CAL_ variable |
|
OUTPUT=SEPARATE option | |
OUTSTART statement |
OUTFIN
statement |
SUM statement |
|
Data sets: |
|
This example
-
produces a summary calendar
for multiple calendars in a single
PROC step
-
prints the calendars on separate pages
-
displays holidays
-
uses separate work patterns, work shifts, and holidays for
each
calendar
This example produces separate output for multiple calendars. To produce
combined or mixed output for this data, you need to change only two things:
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 |
![Note about code](../../../../common/63294/HTML/default/images/snbut.gif) |
libname well 'SAS-library';
run; |
![Note about code](../../../../common/63294/HTML/default/images/snbut.gif) |
proc sort data=well.act;
by _cal_ date;
run; |
![Note about code](../../../../common/63294/HTML/default/images/snbut.gif) |
options nodate pageno=1 linesize=132 pagesize=60; |
![Note about code](../../../../common/63294/HTML/default/images/snbut.gif) |
proc calendar data=well.act
holidata=well.hol
datetime legend; |
![Note about code](../../../../common/63294/HTML/default/images/snbut.gif) |
calid _cal_ / output=separate; |
![Note about code](../../../../common/63294/HTML/default/images/snbut.gif) |
start date;
holistart date;
holivar holiday; |
![Note about code](../../../../common/63294/HTML/default/images/snbut.gif) |
sum cost / format=dollar10.2; |
![Note about code](../../../../common/63294/HTML/default/images/snbut.gif) |
outstart Monday;
outfin Saturday; |
![Note about code](../../../../common/63294/HTML/default/images/snbut.gif) |
title 'Well Drilling Cost Summary';
title2 'Separate Calendars';
format cost dollar10.2;
run; |
Separated Output for Multiple Summary Calendars
Well Drilling Cost Summary 1
Separate Calendars
............................................................ _cal_=CAL1 ............................................................
-------------------------------------------------------------------------------------------------------------------
| |
| July 1996 |
| |
|-----------------------------------------------------------------------------------------------------------------|
| Monday | Tuesday | Wednesday | Thursday | Friday | Saturday |
|------------------+------------------+------------------+------------------+------------------+------------------|
| 1 | 2 | 3 | 4 | 5 | 6 |
| | | |***Independence***| | |
| Drill Well | | | Lay Power Line | Assemble Tank | |
| 3.5 | | | 3 | 4 | |
| $1,000.00 | | | $2,000.00 | $1,000.00 | |
|------------------+------------------+------------------+------------------+------------------+------------------|
| 8 | 9 | 10 | 11 | 12 | 13 |
| | | | | | |
| Build Pump House | | | Pour Foundation | | |
| 3 | | | 4 | | |
| $2,000.00 | | | $1,500.00 | | |
|------------------+------------------+------------------+------------------+------------------+------------------|
| 15 | 16 | 17 | 18 | 19 | 20 |
| | | | | | |
| Install Pump | | | | Install Pipe | Erect Tower |
| 4 | | | | 2 | 6 |
| $500.00 | | | | $1,000.00 | $2,500.00 |
|------------------+------------------+------------------+------------------+------------------+------------------|
| 22 | 23 | 24 | 25 | 26 | 27 |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
|------------------+------------------+------------------+------------------+------------------+------------------|
| 29 | 30 | 31 | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
-------------------------------------------------------------------------------------------------------------------
-------------------------
| Legend | Sum |
| | |
| task | |
| dur | |
| cost | $11,500.00 |
-------------------------
Well Drilling Cost Summary 2
Separate Calendars
............................................................ _cal_=CAL2 ............................................................
-------------------------------------------------------------------------------------------------------------------
| |
| July 1996 |
| |
|-----------------------------------------------------------------------------------------------------------------|
| Monday | Tuesday | Wednesday | Thursday | Friday | Saturday |
|------------------+------------------+------------------+------------------+------------------+------------------|
| 1 | 2 | 3 | 4 | 5 | 6 |
| | | | | | |
| Deliver Material | | Excavate | | | |
| 2 | | 4.75 | | | |
| $500.00 | | $3,500.00 | | | |
|------------------+------------------+------------------+------------------+------------------+------------------|
| 8 | 9 | 10 | 11 | 12 | 13 |
| |*****Vacation*****| | | | |
| | | | | | |
| | | | | | |
| | | | | | |
|------------------+------------------+------------------+------------------+------------------+------------------|
| 15 | 16 | 17 | 18 | 19 | 20 |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
|------------------+------------------+------------------+------------------+------------------+------------------|
| 22 | 23 | 24 | 25 | 26 | 27 |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
|------------------+------------------+------------------+------------------+------------------+------------------|
| 29 | 30 | 31 | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
-------------------------------------------------------------------------------------------------------------------
-------------------------
| Legend | Sum |
| | |
| task | |
| dur | |
| cost | $4,000.00 |
-------------------------
![](../../../../common/63294/HTML/default/images/spacer.gif) |
![](../../../../common/63294/HTML/default/images/spacer.gif) |
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.