The CALENDAR Procedure

# Example 7: Summary Calendar with MEAN Values By Observation

Procedure features:
CALID statement:
 _CAL_ variable OUTPUT=SEPARATE option
FORMAT statement
LABEL statement
MEAN statement
SUM statement
Other features:
PROC FORMAT:
 PICTURE statement

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.

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 exist.

 ```data meals; input date : date7. Brkfst Lunch Dinner; datalines; 02Dec96 123 234 238 03Dec96 188 188 198 04Dec96 123 183 176 05Dec96 200 267 243 06Dec96 176 165 177 09Dec96 178 198 187 10Dec96 165 176 187 11Dec96 187 176 231 12Dec96 176 187 222 13Dec96 187 187 123 16Dec96 176 165 177 17Dec96 156 . 167 18Dec96 198 143 167 19Dec96 178 198 187 20Dec96 165 176 187 23Dec96 187 187 123 ;```
 ```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;```

 ``` sum brkfst lunch dinner / format=4.0; mean brkfst lunch dinner / format=6.2; label brkfst = 'Breakfasts Served' lunch = ' Lunches Served' dinner = ' Dinners Served'; format brkfst bfmt. lunch lfmt. dinner dfmt.; title 'Meals Served in Company Cafeteria'; title2 'Mean Number by Business Day'; run;```

Summary Calendar with MEAN Values by Observation