Resources

Variable Length Holidays (gantt8)

/****************************************************************/
/*          S A S   S A M P L E   L I B R A R Y                 */
/*                                                              */
/*    NAME: GANTT8                                              */
/*   TITLE: Variable Length Holidays (gantt8)                   */
/* PRODUCT: OR                                                  */
/*  SYSTEM: ALL                                                 */
/*    KEYS: GANTT                                               */
/*   PROCS: CPM, SORT, GANTT                                    */
/*    DATA:                                                     */
/*                                                              */
/* SUPPORT:                             UPDATE:                 */
/*     REF: Example 8 in the GANTT Chapter (PM User's Guide)    */
/*    MISC:                                                     */
/*                                                              */
/****************************************************************/

data widgaoa;
   format task $12.;
   input task & days tail head;
   datalines;
Approve Plan   5   1   2
Drawings      10   2   3
Study Market   5   2   4
Write Specs    5   2   3
Prototype     15   3   5
Mkt. Strat.   10   4   6
Materials     10   5   7
Facility      10   5   7
Init. Prod.   10   7   8
Evaluate      10   8   9
Test Market   15   6   9
Changes        5   9  10
Production     0  10  11
Marketing      0   6  12
Dummy          0   8   6
;

data details;
   format task $12. dept $13. descrpt $30.;
   input task & dept & descrpt & ;
   label dept = "Department"
         descrpt = "Activity Description";
   datalines;
Approve Plan  Planning       Finalize and Approve Plan
Drawings      Engineering    Prepare Drawings
Study Market  Marketing      Analyze Potential Markets
Write Specs   Engineering    Write Specifications
Prototype     Engineering    Build Prototype
Mkt. Strat.   Marketing      Develop Marketing Concept
Materials     Manufacturing  Procure Raw Materials
Facility      Manufacturing  Prepare Manufacturing Facility
Init. Prod.   Manufacturing  Initial Production Run
Evaluate      Testing        Evaluate Product In-House
Test Market   Testing        Mail Product to Sample Market
Changes       Engineering    Engineering Changes
Production    Manufacturing  Begin Full Scale Production
Marketing     Marketing      Begin Full Scale Marketing
Dummy         .              Production Milestone
;

data widgeta;
   merge widgaoa details;
   run;


data holidays;
   format holiday holifin date7.;
   input holiday & date7. holifin & date7. holidur;
   datalines;
24dec03  27dec03  4
01jan04  .        .
;


 * schedule the project subject to holidays;
proc cpm data=widgeta holidata=holidays out=sched1
         date='1dec03'd interval=day;
   tailnode tail;
   headnode head;
   duration days;
   id task dept descrpt;
   holiday  holiday / holidur=(holidur);
   run;

 * sort the schedule by the early start date ;
proc sort;
   by e_start;
   run;

* set up pattern statements;
pattern1 c=green v=s;
pattern2 c=green v=e;
pattern3 c=red v=s;
pattern4 c=magenta v=e;
pattern5 c=magenta v=s;
pattern6 c=cyan v=s;
pattern7 c=black v=e;

 * plot the schedule;
title h=2 f='Thorndale AMT' 'Gantt Example 8';
title2 h=1.5 f='Thorndale AMT' 'Variable Length Holidays: INTERVAL = DAY';
proc gantt holidata=holidays data=sched1 ;
   chart / holiday=(holiday) holidur=(holidur) font='Thorndale AMT'
           dur=days interval=day pcompress;
   id task;
   run;

 * schedule the project subject to holidays;
proc cpm data=widgeta holidata=holidays out=sched2
         date='1dec03'd interval=weekday;
   tailnode tail;
   headnode head;
   duration days;
   id task dept descrpt;
   holiday holiday / holidur=(holidur);
   run;

    * sort the schedule by the early start date ;

proc sort;
   by e_start;
   run;

title2 h=1.5 f='Thorndale AMT' 'Variable Length Holidays: INTERVAL=WEEKDAY';

proc gantt holidata=holidays data=sched2;
   chart / holiday=(holiday) holidur=(holidur)
           font='Thorndale AMT'
           height=1.4
           interval=weekday
           dur=days
           pcompress;
   id task;
   run;

 * schedule the project subject to holidays;
proc cpm data=widgeta holidata=holidays out=sched3
         date='1dec03'd interval=workday;
   tailnode tail;
   headnode head;
   duration days;
   id task dept descrpt;
   holiday holiday / holidur=(holidur);
   run;


 * sort the schedule by the early start date ;

proc sort;
   by e_start;
   run;

title2 h=1.5 f='Thorndale AMT' 'Variable Length Holidays: INTERVAL = WORKDAY';

proc gantt holidata=holidays data=sched3;
   chart / holiday=(holiday) holidur=(holidur)
           dur=days interval=workday
           font='Thorndale AMT'
           mininterval=dthour markbreak
           mindate='29dec03:09:00:00'dt
           maxdate='03jan04:00:00:00'dt
           pcompress height=1.5;
   id task;
   run;