Chapter Contents

Previous

Next
The CALENDAR Procedure

Example 4: Multiple Schedule Calendars with Atypical Workshifts (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:
There are input data sets .

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 Workshifts (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-data-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;
   title1 'Well Drilling Work Schedule: Combined Calendars';
   format cost dollar9.2;

 Note about code
   calid _cal_ / output=combine;


 Note about code
   start date;
   dur dur;



 Note about code
   holistart date;
   holivar holiday;
run;


Output for Combined Calendars

Multiple Schedule Calendars with Atypical Workshifts (Combined Output)
[HTML Output]
 [Listing Output]


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 Workshifts (Mixed Output)
[HTML Output]  [Listing Output]


Chapter Contents

Previous

Next

Top of Page

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