Marking Holidays (gantt3)
/****************************************************************/
/* S A S S A M P L E L I B R A R Y */
/* */
/* NAME: GANTT3 */
/* TITLE: Marking Holidays (gantt3) */
/* PRODUCT: OR */
/* SYSTEM: ALL */
/* KEYS: GANTT */
/* PROCS: CPM, SORT, GANTT */
/* DATA: */
/* */
/* SUPPORT: UPDATE: */
/* REF: Example 3 of the GANTT Chapter (PM User's Guide) */
/* MISC: */
/* */
/****************************************************************/
options ps=60 ls=80;
title h=2 'Gantt Example 3';
title2 'Marking Holidays';
/* Activity-on-Node representation of the project */
data widget;
format task $12. succ1-succ3 $12. ;
input task & days succ1 & succ2 & succ3 & ;
datalines;
Approve Plan 5 Drawings Study Market Write Specs
Drawings 10 Prototype . .
Study Market 5 Mkt. Strat. . .
Write Specs 5 Prototype . .
Prototype 15 Materials Facility .
Mkt. Strat. 10 Test Market Marketing .
Materials 10 Init. Prod. . .
Facility 10 Init. Prod. . .
Init. Prod. 10 Test Market Marketing Evaluate
Evaluate 10 Changes . .
Test Market 15 Changes . .
Changes 5 Production . .
Production 0 . . .
Marketing 0 . . .
;
data holidays;
format holiday holifin date7.;
input holiday & date7. holifin & date7. holidur;
datalines;
24dec03 26dec03 4
01jan04 . .
;
* schedule the project subject to holidays;
proc cpm data=widget holidata=holidays
out=saveh date='1dec03'd ;
activity task;
succ succ1 succ2 succ3;
duration days;
holiday holiday / holifin=(holifin);
run;
* sort the schedule by the early start date ;
proc sort;
by e_start;
run;
* print the schedule;
proc print data=saveh;
var task days e_start e_finish l_start l_finish
t_float f_float;
run;
* set up pattern statements and graphics options;
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;
goptions vpos=42 htext=1;
* plot the schedule;
proc gantt holidata=holidays data=saveh;
chart / holiday=(holiday) holiend=(holifin);
id task;
run;