Previous Page | Next Page

The CALENDAR Procedure

Example 4: Multiple Schedule Calendars with Atypical Work Shifts (Combined and Mixed Output)


Procedure features:

PROC CALENDAR statement options:

CALEDATA=

DATETIME

WORKDATA=

CALID statement:

_CAL_ variable

OUTPUT=COMBINE option

OUTPUT=MIXED option

DUR statement

OUTSTART statement

OUTFIN statement

Data sets:

WELL.ACT, WELL.HOL, WELL.CAL, WEL.WOR.


This example


Two Programs and Two Pieces of Output

This example creates both combined and mixed output. Producing combined or mixed calendar output requires only one change to a PROC CALENDAR step: the setting of the OUTPUT= option in the CALID statement. Combined output is produced first, then mixed output.


Producing Different Output for Multiple Calendars

This example and Multiple Schedule Calendars with Atypical Work Shifts (Separated Output) use the same input data for multiple calendars to produce different output. The only differences in these programs are how the activities data set is sorted and how the OUTPUT= option is set.

To print ... Sort the activities data set by ... And set OUTPUT= to See Example
Separate pages for each calendar calendar ID and starting date SEPARATE 3, 8
All activities on the same page and identify each calendar starting date COMBINE 4, 2
All activities on the same page and NOT identify each calendar starting date MIX 4


Program for Combined Calendars

 Note about code
libname well 'SAS-library';
 Note about code
proc sort data=well.act;
   by date;
run;
 Note about code
options nodate pageno=1 linesize=132 pagesize=60;
 Note about code
proc calendar data=well.act
              holidata=well.hol
              caledata=well.cal
              workdata=well.wor
              datetime;
 Note about code
   calid _cal_ / output=combine;
 Note about code
   start date;
   dur dur;
 Note about code
   holistart date;
   holivar holiday;
 Note about code
   title1 'Well Drilling Work Schedule: Combined Calendars';
   format cost dollar9.2;
run;

Output for Combined Calendars

Multiple Schedule Calendars with Atypical Work Shifts (Combined Output)

                                          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+|                |                |                |                |                |
 |         |                |                |                |                |                |                |                |
 |         |                |                |                |                |                |                |                |
 |         |                |                |                |                |                |                |                |
 |         |                |                |                |                |                |                |                |
 ----------------------------------------------------------------------------------------------------------------------------------

Program for Mixed Calendars

To produce mixed output instead of combined, use the same program and change the setting of the OUTPUT= option to OUTPUT=MIX:

proc calendar data=well.act
              holidata=well.hol
              caledata=well.cal
              workdata=well.wor
              datetime;
   calid _cal_ / output=mix;   
   start date;
   dur dur;
   holistart date;
   holivar holiday;
   outstart Monday;
   outfin Saturday;
   title1 'Well Drilling Work Schedule: Mixed Calendars';
   format cost dollar9.2;
run;


Output for Mixed Calendars

Multiple Schedule Calendar with Atypical Work Shifts (Mixed Output)

                                            Well Drilling Work Schedule: Mixed Calendars                                           1

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

Previous Page | Next Page | Top of Page