| The CALENDAR Procedure |
| Procedure features: |
| |||||||||
| Other features: |
|
This example
produces a summary calendar
displays holidays
produces sum and mean values by business day (observation) for three variables
prints a legend and uses variable labels
uses picture formats to display values.
| MEAN Values by Number of Days |
To produce MEAN values based on the number of days in the calendar month, use MEANTYPE=NDAYS. By default, MEANTYPE=NOBS, which calculates the MEAN values according to the number of days for which data exists.
| Program |
| |
data closed; input date date. holiday $ 11-25; datalines; 26DEC96 Repairs 27DEC96 Repairs 30DEC96 Repairs 31DEC96 Repairs 24DEC96 Christmas Eve 25DEC96 Christmas ; |
| |
proc sort data=meals; by date; run; |
| |
proc format; picture bfmt other = '000 Brkfst'; picture lfmt other = '000 Lunch '; picture dfmt other = '000 Dinner'; run; |
| |
options nodate pageno=1 linesize=132 pagesize=60; |
| |
proc calendar data=meals holidata=closed; start date; |
| |
holistart date; holiname holiday; |
| |
title 'Meals Served in Company Cafeteria'; title2 'Mean Number by Business Day'; run; |
| Output: Listing |
Summary Calendar with MEAN Values by Observation
Meals Served in Company Cafeteria 1
Mean Number by Business Day
--------------------------------------------------------------------------------------------
| |
| December 1996 |
| |
|------------------------------------------------------------------------------------------|
| Sunday | Monday | Tuesday | Wednesday | Thursday | Friday | Saturday |
|------------+------------+------------+------------+------------+------------+------------|
| 1 | 2 | 3 | 4 | 5 | 6 | 7 |
| | | | | | | |
| | 123 Brkfst | 188 Brkfst | 123 Brkfst | 200 Brkfst | 176 Brkfst | |
| | 234 Lunch | 188 Lunch | 183 Lunch | 267 Lunch | 165 Lunch | |
| | 238 Dinner | 198 Dinner | 176 Dinner | 243 Dinner | 177 Dinner | |
|------------+------------+------------+------------+------------+------------+------------|
| 8 | 9 | 10 | 11 | 12 | 13 | 14 |
| | | | | | | |
| | 178 Brkfst | 165 Brkfst | 187 Brkfst | 176 Brkfst | 187 Brkfst | |
| | 198 Lunch | 176 Lunch | 176 Lunch | 187 Lunch | 187 Lunch | |
| | 187 Dinner | 187 Dinner | 231 Dinner | 222 Dinner | 123 Dinner | |
|------------+------------+------------+------------+------------+------------+------------|
| 15 | 16 | 17 | 18 | 19 | 20 | 21 |
| | | | | | | |
| | 176 Brkfst | 156 Brkfst | 198 Brkfst | 178 Brkfst | 165 Brkfst | |
| | 165 Lunch | . | 143 Lunch | 198 Lunch | 176 Lunch | |
| | 177 Dinner | 167 Dinner | 167 Dinner | 187 Dinner | 187 Dinner | |
|------------+------------+------------+------------+------------+------------+------------|
| 22 | 23 | 24 | 25 | 26 | 27 | 28 |
| | |Christmas Ev|*Christmas**|**Repairs***|**Repairs***| |
| | 187 Brkfst | | | | | |
| | 187 Lunch | | | | | |
| | 123 Dinner | | | | | |
|------------+------------+------------+------------+------------+------------+------------|
| 29 | 30 | 31 | | | | |
| |**Repairs***|**Repairs***| | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
--------------------------------------------------------------------------------------------
-------------------------------------
| | Sum | Mean |
| | | |
| Breakfasts Served | 2763 | 172.69 |
| Lunches Served | 2830 | 188.67 |
| Dinners Served | 2990 | 186.88 |
-------------------------------------
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.