Previous Page | Next Page

The CALENDAR Procedure

Overview: CALENDAR Procedure


What Does the CALENDAR Procedure Do?

The CALENDAR procedure displays data from a SAS data set in a monthly calendar format. You can produce a schedule calendar, which schedules events around holidays and nonwork periods, or you can produce a summary calendar, which summarizes data and displays only one-day events and holidays. When you use PROC CALENDAR you can

PROC CALENDAR also contains features that are specifically designed to work with PROC CPM in SAS/OR software, a project management scheduling tool.


What Types of Calendars Can PROC CALENDAR Produce?


Simple Schedule Calendar

The following output illustrates the simplest kind of schedule calendar that you can produce. This calendar output displays activities that are planned by a banking executive. The following statements produce Simple Schedule Calendar.

options nodate pageno=1 linesize=132 pagesize=60;

proc calendar data=allacty;
   start date;
   dur long;
run;

For the activities data set shown that is in this calendar, see Schedule Calendar with Holidays: 5-Day Default.

Simple Schedule Calendar

 Note about figure
                                                           The SAS System                                                          1

  -------------------------------------------------------------------------------------------------------------------------------
  |                                                                                                                             |
  |                                                         July  1996                                                          |
  |                                                                                                                             |
  |-----------------------------------------------------------------------------------------------------------------------------|
  |     Sunday      |     Monday      |     Tuesday     |    Wednesday    |    Thursday     |     Friday      |    Saturday     |
  |-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------|
  |                 |        1        |        2        |        3        |        4        |        5        |        6        |
  |                 |                 |                 |                 |                 |                 |                 |
  |                 |                 |                 |                 |                 |                 |                 |
  |                 |                 |                 |                 |                 |                 |                 |
  |                 |                 |                 |                 |                 |                 |                 |
  |                 |                 |                 |+=Interview/JW==+|                 |                 |                 |
  |                 |+Dist. Mtg./All=+|+====Mgrs. Meeting/District 6=====+|                 |+VIP Banquet/JW=+|                 |
  |-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------|
  |        7        |        8        |        9        |       10        |       11        |       12        |       13        |
  |                 |                 |                 |                 |                 |                 |                 |
  |                 |                 |                 |                 |                 |                 |                 |
  |                 |                 |                 |                 |                 |                 |                 |
  |                 |                 |                 |                 |+Planning Counci+|+=Seminar/White=+|                 |
  |                 |+==================Trade Show/Knox==================+|+====Mgrs. Meeting/District 7=====+|                 |
  |                 |+================================Sales Drive/District 6=================================+|                 |
  |-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------|
  |       14        |       15        |       16        |       17        |       18        |       19        |       20        |
  |                 |                 |                 |                 |                 |                 |                 |
  |                 |                 |                 |                 |                 |                 |                 |
  |                 |                 |                 |                 |                 |                 |                 |
  |                 |                 |                 |                 |+NewsLetter Dead+|+Co. Picnic/All=+|                 |
  |                 |                 |+==Dentist/JW===+|+Bank Meeting/1s+|+Planning Counci+|+=Seminar/White=+|                 |
  |                 |+================================Sales Drive/District 7=================================+|                 |
  |-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------|
  |       21        |       22        |       23        |       24        |       25        |       26        |       27        |
  |                 |                 |                 |                 |                 |                 |                 |
  |                 |                 |                 |                 |                 |                 |                 |
  |                 |                 |                 |                 |                 |                 |                 |
  |                 |                 |                 |                 |                 |                 |                 |
  |                 |                 |                 |+=Birthday/Mary=+|+======Close Sale/WYGIX Co.=======+|                 |
  |                 |+===============Inventors Show/Melvin===============+|+Planning Counci+|                 |                 |
  |-----------------+-----------------+-----------------+-----------------+-----------------+-----------------+-----------------|
  |       28        |       29        |       30        |       31        |                 |                 |                 |
  |                 |                 |                 |                 |                 |                 |                 |
  |                 |                 |                 |                 |                 |                 |                 |
  |                 |                 |                 |                 |                 |                 |                 |
  |                 |                 |                 |                 |                 |                 |                 |
  |                 |                 |                 |                 |                 |                 |                 |
  |                 |                 |                 |                 |                 |                 |                 |
  -------------------------------------------------------------------------------------------------------------------------------

Advanced Schedule Calendar

The following output is an advanced schedule calendar produced by PROC CALENDAR. The statements that create this calendar

For an explanation of the program that produces this calendar, see Multiple Schedule Calendars with Atypical Work Shifts (Combined and Mixed Output).

Advanced Schedule Calendar

                                          Well Drilling Work Schedule: Combined Calendars                                          1

           ------------------------------------------------------------------------------------------------------------------------
           |                                                                                                                      |
           |                                                      July  1996                                                      |
           |                                                                                                                      |
           |----------------------------------------------------------------------------------------------------------------------|
           |     Sunday     |     Monday     |    Tuesday     |   Wednesday    |    Thursday    |     Friday     |    Saturday    |
 ----------+----------------+----------------+----------------+----------------+----------------+----------------+----------------|
 |         |                |        1       |        2       |        3       |        4       |        5       |        6       |
 |.........|................|................|................|................|................|................|................|
 | CAL1    |                |                |                |                |**Independence**|+Assemble Tank/>|                |
 |         |                |                |                |                |                |+Lay Power Line>|                |
 |         |                |+==============Drill Well/$1,000.00==============>|                |<Drill Well/$1,+|                |
 |.........|................|................|................|................|................|................|................|
 | CAL2    |                |                |                |+=======================Excavate/$3,500.00========================>|
 |---------+----------------+----------------+----------------+----------------+----------------+----------------+----------------|
 |         |        7       |        8       |        9       |       10       |       11       |       12       |       13       |
 |.........|................|................|................|................|................|................|................|
 | CAL1    |                |+===================Build Pump House/$2,000.00====================+|                |                |
 |         |                |<=====================Assemble Tank/$1,000.00=====================+|                |                |
 |         |                |<===Lay Power Line/$2,000.00====+|                |+===Pour Foundation/$1,500.00===>|                |
 |.........|................|................|................|................|................|................|................|
 | CAL2    |                |<Excavate/$3,50>|****Vacation****|<Excavate/$3,50+|                |                |                |
 |---------+----------------+----------------+----------------+----------------+----------------+----------------+----------------|
 |         |       14       |       15       |       16       |       17       |       18       |       19       |       20       |
 |.........|................|................|................|................|................|................|................|
 | CAL1    |                |+===============================Install Pump/$500.00===============================+|                |
 |         |                |<===========Pour Foundation/$1,500.00============+|                |+Install Pipe/$>|                |
 |         |                |                |                |                |                |                |                |
 |         |                |                |                |                |                |                |                |
 |         |                |                |                |                |                |                |                |
 |---------+----------------+----------------+----------------+----------------+----------------+----------------+----------------|
 |         |       21       |       22       |       23       |       24       |       25       |       26       |       27       |
 |.........|................|................|................|................|................|................|................|
 | CAL1    |                |+==============================Erect Tower/$2,500.00===============================>|                |
 |         |                |<====Install Pipe/$1,000.00=====+|                |                |                |                |
 |         |                |                |                |                |                |                |                |
 |         |                |                |                |                |                |                |                |
 |         |                |                |                |                |                |                |                |
 |---------+----------------+----------------+----------------+----------------+----------------+----------------+----------------|
 |         |       28       |       29       |       30       |       31       |                |                |                |
 |.........|................|................|................|................|................|................|................|
 | CAL1    |                |<Erect Tower/$2+|                |                |                |                |                |
 |         |                |                |                |                |                |                |                |
 |         |                |                |                |                |                |                |                |
 |         |                |                |                |                |                |                |                |
 |         |                |                |                |                |                |                |                |
 ----------------------------------------------------------------------------------------------------------------------------------

Simple Summary Calendar

The following output shows a simple summary calendar that displays the number of meals served daily in a hospital cafeteria:

options nodate pageno=1 linesize=132 pagesize=60;

proc calendar data=meals;
   start date;
   sum brkfst lunch dinner;
   mean brkfst lunch dinner;
run;

In a summary calendar, each piece of information for a given day is the value of a variable for that day. The variables can be either numeric or character, and you can format them as necessary. You can use the SUM and MEAN options to calculate sums and means for any numeric variables. These statistics appear in a box below the calendar, as shown in the following output. The data set that is shown in this calendar is created in Summary Calendar with MEAN Values By Observation.

Simple Summary Calendar

                                                           The SAS System                                                          1

             ----------------------------------------------------------------------------------------------------------
             |                                                                                                        |
             |                                             December  1996                                             |
             |                                                                                                        |
             |--------------------------------------------------------------------------------------------------------|
             |    Sunday    |    Monday    |   Tuesday    |  Wednesday   |   Thursday   |    Friday    |   Saturday   |
             |--------------+--------------+--------------+--------------+--------------+--------------+--------------|
             |       1      |       2      |       3      |       4      |       5      |       6      |       7      |
             |              |              |              |              |              |              |              |
             |              |          123 |          188 |          123 |          200 |          176 |              |
             |              |          234 |          188 |          183 |          267 |          165 |              |
             |              |          238 |          198 |          176 |          243 |          177 |              |
             |--------------+--------------+--------------+--------------+--------------+--------------+--------------|
             |       8      |       9      |      10      |      11      |      12      |      13      |      14      |
             |              |              |              |              |              |              |              |
             |              |          178 |          165 |          187 |          176 |          187 |              |
             |              |          198 |          176 |          176 |          187 |          187 |              |
             |              |          187 |          187 |          231 |          222 |          123 |              |
             |--------------+--------------+--------------+--------------+--------------+--------------+--------------|
             |      15      |      16      |      17      |      18      |      19      |      20      |      21      |
             |              |              |              |              |              |              |              |
             |              |          176 |          156 |          198 |          178 |          165 |              |
             |              |          165 |            . |          143 |          198 |          176 |              |
             |              |          177 |          167 |          167 |          187 |          187 |              |
             |--------------+--------------+--------------+--------------+--------------+--------------+--------------|
             |      22      |      23      |      24      |      25      |      26      |      27      |      28      |
             |              |              |              |              |              |              |              |
             |              |          187 |              |              |              |              |              |
             |              |          187 |              |              |              |              |              |
             |              |          123 |              |              |              |              |              |
             |--------------+--------------+--------------+--------------+--------------+--------------+--------------|
             |      29      |      30      |      31      |              |              |              |              |
             |              |              |              |              |              |              |              |
             |              |              |              |              |              |              |              |
             |              |              |              |              |              |              |              |
             |              |              |              |              |              |              |              |
             ----------------------------------------------------------------------------------------------------------

                                            --------------------------------------------
                                            |          |      Sum      |     Mean      |
                                            |          |               |               |
                                            | Brkfst   |          2763 |       172.688 |
                                            | Lunch    |          2830 |       188.667 |
                                            | Dinner   |          2990 |       186.875 |
                                            --------------------------------------------

Advanced Scheduling and Project Management Tasks

For more complex scheduling tasks, consider using the CPM procedure in SAS/OR software. PROC CALENDAR requires that you specify the starting date of each activity. When the beginning of one task depends on the completion of others and a date slips in a schedule, recalculating the schedule can be time-consuming. Instead of manually recalculating dates, you can use PROC CPM to calculate dates for project activities based on an initial starting date, activity durations, and which tasks are identified as successors to others. For an example, see Calculating a Schedule Based on Completion of Predecessor Tasks.

Previous Page | Next Page | Top of Page