Using the COMPRESS option (gantt5)
/****************************************************************/
/* S A S S A M P L E L I B R A R Y */
/* */
/* NAME: GANTT5 */
/* TITLE: Using the COMPRESS option (gantt5) */
/* PRODUCT: OR */
/* SYSTEM: ALL */
/* KEYS: GANTT */
/* PROCS: CPM, SORT, GANTT */
/* DATA: */
/* */
/* SUPPORT: UPDATE: */
/* REF: Example 5 in the GANTT Chapter (PM User's Guide) */
/* MISC: */
/* */
/****************************************************************/
title h=2 'Gantt Example 5';
title2 h=1.5 'Using the COMPRESS Option';
/* 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 target;
format task $12. target date7.;
input task & target & date7.;
datalines;
Approve Plan .
Drawings .
Study Market .
Write Specs 23dec03
Prototype 15jan04
Mkt. Strat. 31dec03
Materials .
Facility .
Init. Prod. .
Evaluate .
Test Market .
Changes .
Production .
Marketing .
;
data widgett;
merge widget target;
run;
proc cpm data=widgett date='1dec03'd;
activity task;
successor succ1-succ3;
duration days;
id target;
run;
* sort the schedule by the early start date ;
proc sort;
by e_start;
run;
* specify the device on which you want the chart printed;
goptions htext=1.1 hpos=110 vpos=40;
* set up required pattern and symbol statements;
pattern1 c=green v=s;
pattern2 c=green v=e;
pattern3 c=red v=s;
symbol c=black v=plus;
* plot the schedule on one page;
proc gantt;
chart target / dur=days cmile=cyan
ctext=blue caxis=cyan
compress;
id task;
run;