CALENDAR Procedure

Requirements: You must use a START statement.

For schedule calendars, you must also use a DUR or a FIN statement.

Tips: If you use a DUR or FIN statement, then PROC CALENDAR produces a schedule calendar.

ODSTIP

You can use the FORMAT, LABEL, and WHERE statements as well as any global statements.

Syntax

PROC CALENDAR <option(s)>;
START variable;
BY <DESCENDING> variable-1
<…<DESCENDING> variable-n>
<NOTSORTED>;
CALID variable
</ OUTPUT=COMBINE|MIX|SEPARATE>;
DUR variable;
FIN variable;
HOLISTART variable;
HOLIDUR variable;
HOLIFIN variable;
HOLIVAR variable;
MEAN variable(s) </ FORMAT=format-name>;
OUTSTART day-of-week;
OUTDUR number-of-days;
OUTFIN day-of-week;
SUM variable(s) </ FORMAT=format-name>;
VAR variable(s);

Table of Procedure Tasks

Statement Task Example
PROC CALENDAR Statement Display data from a SAS data set in a monthly calendar format Ex. 1, Ex. 3, Ex. 4, Ex. 5, Ex. 6, Ex. 8
BY Statement Process activities separately for each BY group, producing a separate calendar for each value of the BY variable  
CALID Statement Process activities in groups defined by the values of a calendar identifier variable Ex. 2, Ex. 3, Ex. 4, Ex. 6, Ex. 7, Ex. 8
DUR Statement Specify the variable that contains the duration of each activity Ex. 1, Ex. 2, Ex. 3, Ex. 4, Ex. 5
FIN Statement Specify the variable in the activities data set that contains the finishing date of each activity Ex. 6
HOLIDUR Statement Specify the variable in the holidays data set that contains the duration of each holiday for a schedule calendar Ex. 1, Ex. 5
HOLIFIN Statement Specify the variable in the holidays data set that contains the finishing date of each holiday  
HOLISTART Statement Specify a variable in the holidays data set that contains the starting date of each holiday Ex. 1, Ex. 5
HOLIVAR Statement Specify a variable in the holidays data set whose values are used to label the holidays Ex. 1, Ex. 5
MEAN Statement Specify numeric variables in the activities data set for which mean values are to be calculated for each month  
OUTDUR Statement Specify in days the length of the week to be displayed  
OUTFIN Statement Specify the last day of the week to display in the calendar Ex. 3, Ex. 4, Ex. 8
OUTSTART Statement Specify the starting day of the week to display in the calendar Ex. 3, Ex. 4, Ex. 8
START Statement Specify the variable in the activities data set that contains the starting date of each activity Ex. 1
SUM Statement Specify numeric variables in the activities data set to total for each month Ex. 8
VAR Statement Specify the variables that you want to display for each activity Ex. 6