Chapter Contents |
Previous |
Next |
The CALENDAR Procedure |
PROC CALENDAR <option(s)>; |
To do this | Use this option | |
---|---|---|
Specify data sets containing | ||
weekly work schedules | CALEDATA= | |
activities | DATA= | |
holidays | HOLIDATA= | |
unique shift patterns | WORKDATA= | |
Control printing | ||
display all months, even if no activities exist | FILL | |
define characters used for outlines, dividers, and so on | FORMCHAR= | |
specify the type of heading for months | HEADER= | |
specify how to show missing values | MISSING | |
suppress the display of Saturdays and Sundays | WEEKDAYS | |
Specify time or duration | ||
specify that START and FIN variables are in DATETIME format | DATETIME | |
specify the number of hours in a standard work day | DAYLENGTH= | |
specify the units of the DUR and HOLIDUR variables | INTERVAL= | |
Control summary information | ||
identify variables in the calendar | LEGEND | |
specify the type of mean to calculate | MEANTYPE= |
Options |
Default: | If you omit the CALEDATA= option, PROC CALENDAR uses a default work schedule, as described in The Default Calendars . |
Tip: | A calendar data set is useful if you are using multiple calendars or a nonstandard work schedule. |
See also: | Calendar Data Set |
Featured in: | Multiple Schedule Calendars with Atypical Workshifts (Separated Output) |
Default: | If you omit the DATA= option, the most recently created SAS data set is used. |
See also: | Activities Data Set |
Featured in: | All examples. See Examples |
Default: | If you omit the DATETIME option, PROC CALENDAR assumes that the START and FIN values are in the DATE. format. |
Featured in: | Multiple Schedule Calendars with Atypical Workshifts (Separated Output) |
Default: | 24 if INTERVAL=DAY (the default), 8 if INTERVAL=WORKDAY. |
Restriction: | DAYLENGTH= applies only to schedule calendars. |
Interaction: | If you specify the DAYLENGTH= option and the calendar data set contains a D_LENGTH variable, PROC CALENDAR uses the DAYLENGTH= value only when the D_LENGTH value is missing. |
Interaction: | When INTERVAL=DAY and you have no CALEDATA= data set, specifying a DAYLENGTH= value has no effect. |
Tip: | The DAYLENGTH= option is useful when you
use the DUR statement and your work schedule contains days of varying lengths,
for example, a 5 1/2-day work week. In a work week with varying day lengths, you need to set a standard day length to use in calculating duration times. For example, an activity with a duration of 3.0 workdays lasts 24 hours if DAYLENGTH=8:00 or 30 hours if DAYLENGTH=10:00. |
Tip: | Instead of specifying the DAYLENGTH= option, you can specify the length of the working day by using a D_LENGTH variable in the CALEDATA= data set. If you use this method, you can specify different standard day lengths for different calendars. |
See also: | Calendar Data Set for more information on setting the length of the standard workday |
Default: | If you do not specify FILL, PROC CALENDAR prints only months that contain activities. (Months that contain only holidays are not printed.) |
Featured in: | Schedule Calendar, Blank or with Holidays |
Default: | Omitting (position(s)) is the same as specifying all 20 possible system formatting characters, in order. |
Range: | PROC CALENDAR uses 17 of the 20 formatting characters that SAS provides. Formatting Characters Used by PROC CALENDAR shows the formatting characters that PROC CALENDAR uses. Formatting Characters in PROC CALENDAR Output illustrates their use in PROC CALENDAR output. |
formchar(12 13)='*-'These new settings change the activity line from this:
+=================ACTIVITY===============+to this:
*------------------ACTIVITY--------------*
formchar(3,7)='2D7C'x
See also: | For information on which hexadecimal codes to use for which characters, consult the documentation for your hardware. |
Position | Default | Used to draw | |
---|---|---|---|
1 | | | vertical bar | |
2 | - | horizontal bar | |
3 | - | cell: upper left corner | |
4 | - | cell: upper middle intersection | |
5 | - | cell: upper right corner | |
6 | | | cell: middle left cell side | |
7 | + | cell: middle middle intersection | |
8 | | | cell: middle right cell side | |
9 | - | cell: lower left corner | |
10 | - | cell: lower middle intersection | |
11 | - | cell: lower right corner | |
12 | + | activity start and finish | |
13 | = | activity line | |
16 | / | activity separator | |
18 | < | activity continuation from | |
19 | > | activity continuation to | |
20 | * | holiday marker |
Formatting Characters in PROC CALENDAR Output
Default: | MEDIUM |
Interaction: | Displaying holidays on a calendar requires a holidays data set and a HOLISTART statement. A HOLIVAR statement is recommended for naming holidays. HOLIDUR is required if any holiday lasts longer than one day. |
Tip: | The holidays data set does not require sorting. |
See also: | Holidays Data Set |
Featured in: | All examples. See Examples |
Default: | DAY |
Interaction: | In the absence of a CALEDATA= data set, PROC CALENDAR uses the work schedule defined in a default calendar. |
Interaction: | The WEEKDAYS option automatically sets the INTERVAL= value to WORKDAY. |
See also: | Calendars and Multiple Calendars and Calendar Data Set for more information on the INTERVAL= option and the specification of working days; The Default Calendars |
Featured in: | Schedule Calendar, Blank or with Holidays |
Restriction: | LEGEND applies only to summary calendars. |
Interaction: | If you use the SUM and MEAN statements, the legend box also contains SUM and MEAN values. |
Featured in: | Multiple Summary Calendars with Atypical Workshifts (Separated Output) |
Default: | NOBS |
Restriction: | MEANTYPE= applies only to summary calendars. |
Interaction: | Normally, PROC CALENDAR displays all days for each month. However, it may omit some days if you use the OUTSTART statement with the OUTDUR or OUTFIN statement. |
Featured in: | Summary Calendar with MEAN Values By Observation |
Default: | If you omit MISSING, days without activities contain no values. |
Default: | If you do not specify MISSING, PROC CALENDAR ignores missing values in labeling activities. |
See also: | Missing Values in Input Data Sets for more information on missing values |
Default: | If you omit WEEKDAYS, the calendar displays all seven days. |
Tip: | The WEEKDAYS option is an alternative to using the combination of INTERVAL=WORKDAY and the OUTSTART and OUTFIN statements, as shown here: |
Illustration of Formatting Characters in PROC CALENDAR Output
proc calendar weekdays; start date; run; proc calendar interval=workday; start date; outstart monday; outfin friday; run;
Featured in: | Schedule Calendar with Holidays -- 5-Day Default |
Tip: | The workdays data set is useful in conjunction with the calendar data set. |
See also: | Workdays Data Set and Calendar Data Set |
Featured in: | Multiple Schedule Calendars with Atypical Workshifts (Separated Output) |
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.