Chapter Contents

Previous

Next
The CALENDAR Procedure

Example 3: Multiple Schedule Calendars with Atypical Workshifts (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 Workshifts (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-data-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;
   title1 'Well Drilling Work Schedule: Separate Calendars';
   format cost dollar9.2;
run;


Output

Separate Output for Multiple Schedule Calendars
[HTML Output]  [Listing Output]


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.