Previous Page | Next Page

The CALENDAR Procedure

Example 3: Multiple Schedule Calendars with Atypical Work Shifts (Separated Output)


Procedure features:

PROC CALENDAR statement options:

CALEDATA=

DATETIME

WORKDATA=

CALID statement:

_CAL_ variable

OUTPUT=SEPARATE option

DUR statement

OUTSTART statement

OUTFIN statement


This example


Producing Different Output for Multiple Calendars

This example and Multiple Schedule Calendars with Atypical Work Shifts (Combined and Mixed 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

 Note about code
libname well 'SAS-library';
 Note about code
data well.act;
   input task & $16. dur : 5. date : datetime16.  _cal_ $ cost;
   datalines;
Drill Well          3.50  01JUL96:12:00:00  CAL1   1000
Lay Power Line      3.00  04JUL96:12:00:00  CAL1   2000
Assemble Tank       4.00  05JUL96:08:00:00  CAL1   1000
Build Pump House    3.00  08JUL96:12:00:00  CAL1   2000
Pour Foundation     4.00  11JUL96:08:00:00  CAL1   1500
Install Pump        4.00  15JUL96:14:00:00  CAL1    500
Install Pipe        2.00  19JUL96:08:00:00  CAL1   1000
Erect Tower         6.00  20JUL96:08:00:00  CAL1   2500
Deliver Material    2.00  01JUL96:12:00:00  CAL2    500
Excavate            4.75  03JUL96:08:00:00  CAL2   3500
;
 Note about code
data well.hol;
   input date date. holiday $ 11-25 _cal_ $;
   datalines;
09JUL96   Vacation            CAL2
04JUL96   Independence        CAL1
;
 Note about code
data well.cal;
   input _sun_ $ _sat_ $ _mon_ $ _tue_ $ _wed_ $ _thu_ $
         _fri_ $ _cal_ $;
   datalines;
Holiday Holiday  Workday Workday Workday Workday Workday CAL1
Holiday Halfday  Workday Workday Workday Workday Workday CAL2
;
 Note about code
data well.wor;
   input halfday time5.;
   datalines;
08:00
12:00
;
 Note about code
proc sort data=well.act;
   by _cal_ 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=separate;
 Note about code
   start date;
   dur dur;
 Note about code
   holistart date;
   holivar holiday;
 Note about code
   outstart Monday;
   outfin Saturday;
 Note about code
   title1 'Well Drilling Work Schedule: Separate Calendars';
   format cost dollar9.2;
run;

Output: Listing

Separate Output for Multiple Schedule Calendars

                                          Well Drilling Work Schedule: Separate Calendars                                          1

............................................................ _cal_=CAL1 ............................................................

  -------------------------------------------------------------------------------------------------------------------------------
  |                                                                                                                             |
  |                                                         July  1996                                                          |
  |                                                                                                                             |
  |-----------------------------------------------------------------------------------------------------------------------------|
  |       Monday       |      Tuesday       |     Wednesday      |      Thursday      |       Friday       |      Saturday      |
  |--------------------+--------------------+--------------------+--------------------+--------------------+--------------------|
  |          1         |          2         |          3         |          4         |          5         |          6         |
  |                    |                    |                    |****Independence****|                    |                    |
  |                    |                    |                    |                    |                    |                    |
  |                    |                    |                    |                    |                    |                    |
  |                    |                    |                    |                    |+Assemble Tank/$1,0>|                    |
  |                    |                    |                    |                    |+Lay Power Line/$2,>|                    |
  |+====================Drill Well/$1,000.00====================>|                    |<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========+|                    |+=======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+|                    |                    |                    |                    |                    |
  -------------------------------------------------------------------------------------------------------------------------------
                                          Well Drilling Work Schedule: Separate Calendars                                          2

............................................................ _cal_=CAL2 ............................................................

  -------------------------------------------------------------------------------------------------------------------------------
  |                                                                                                                             |
  |                                                         July  1996                                                          |
  |                                                                                                                             |
  |-----------------------------------------------------------------------------------------------------------------------------|
  |       Monday       |      Tuesday       |     Wednesday      |      Thursday      |       Friday       |      Saturday      |
  |--------------------+--------------------+--------------------+--------------------+--------------------+--------------------|
  |          1         |          2         |          3         |          4         |          5         |          6         |
  |                    |                    |                    |                    |                    |                    |
  |                    |                    |                    |                    |                    |                    |
  |                    |                    |                    |                    |                    |                    |
  |                    |                    |                    |                    |                    |                    |
  |                    |                    |+===============================Excavate/$3,500.00================================>|
  |+==================Deliver Material/$500.00==================+|                    |                    |                    |
  |--------------------+--------------------+--------------------+--------------------+--------------------+--------------------|
  |          8         |          9         |         10         |         11         |         12         |         13         |
  |                    |******Vacation******|                    |                    |                    |                    |
  |                    |                    |                    |                    |                    |                    |
  |                    |                    |                    |                    |                    |                    |
  |                    |                    |                    |                    |                    |                    |
  |                    |                    |                    |                    |                    |                    |
  |<Excavate/$3,500.00>|                    |<Excavate/$3,500.00+|                    |                    |                    |
  |--------------------+--------------------+--------------------+--------------------+--------------------+--------------------|
  |         15         |         16         |         17         |         18         |         19         |         20         |
  |                    |                    |                    |                    |                    |                    |
  |                    |                    |                    |                    |                    |                    |
  |                    |                    |                    |                    |                    |                    |
  |                    |                    |                    |                    |                    |                    |
  |                    |                    |                    |                    |                    |                    |
  |                    |                    |                    |                    |                    |                    |
  |--------------------+--------------------+--------------------+--------------------+--------------------+--------------------|
  |         22         |         23         |         24         |         25         |         26         |         27         |
  |                    |                    |                    |                    |                    |                    |
  |                    |                    |                    |                    |                    |                    |
  |                    |                    |                    |                    |                    |                    |
  |                    |                    |                    |                    |                    |                    |
  |                    |                    |                    |                    |                    |                    |
  |                    |                    |                    |                    |                    |                    |
  |--------------------+--------------------+--------------------+--------------------+--------------------+--------------------|
  |         29         |         30         |         31         |                    |                    |                    |
  |                    |                    |                    |                    |                    |                    |
  |                    |                    |                    |                    |                    |                    |
  |                    |                    |                    |                    |                    |                    |
  |                    |                    |                    |                    |                    |                    |
  |                    |                    |                    |                    |                    |                    |
  |                    |                    |                    |                    |                    |                    |
  -------------------------------------------------------------------------------------------------------------------------------

Previous Page | Next Page | Top of Page