Using the HEIGHT= and HTOFF= options (gantte17)

/****************************************************************/
/*          S A S   S A M P L E   L I B R A R Y                 */
/*                                                              */
/*    NAME: GANTTE17                                            */
/*   TITLE: Using the HEIGHT= and HTOFF= options (gantte17)     */
/* PRODUCT: OR                                                  */
/*  SYSTEM: ALL                                                 */
/*    KEYS: GANTT                                               */
/*   PROCS: CPM, SORT, GANTT                                    */
/*    DATA:                                                     */
/*                                                              */
/* SUPPORT:                             UPDATE:                 */
/*     REF: Example 17 in the GANTT Chapter (PM User's Guide)   */
/*    MISC:                                                     */
/*                                                              */
/****************************************************************/

title 'Gantt Example 17';

 /* Activity-on-Node representation of the project */
data widgr19;
   format Task $12. succ $12. ;
   input Task & days succ & prodman hrdware minseg;
   datalines;
Approve Plan    5  Drawings       1  .  .
Approve Plan    5  Study Market   1  .  .
Approve Plan    5  Write Specs    1  .  .
Drawings       10  Prototype      .  1  1
Study Market    5  Mkt. Strat.    .  .  .
Write Specs     5  Prototype      .  .  .
Prototype      15  Materials      1  .  .
Prototype      15  Facility       1  .  .
Mkt. Strat.    10  Test Market    1  .  1
Mkt. Strat.    10  Marketing      1  .  1
Materials      10  Init. Prod.    .  .  .
Facility       10  Init. Prod.    .  .  .
Init. Prod.    10  Test Market    1  .  .
Init. Prod.    10  Marketing      1  .  .
Init. Prod.    10  Evaluate       1  .  .
Evaluate       10  Changes        1  .  .
Test Market    15  Changes        .  .  .
Changes         5  Production     .  .  .
Production      0  .              1  .  .
Marketing       0  .              .  .  .
;

data widgrin;
   format per date7.;
   input  per & date7. otype $ prodman hrdware;
   datalines;
.         restype  1  1
01dec03   reslevel 1  1
10dec03   reslevel .  0
12dec03   reslevel .  1
;

data holdata;
   format hol date7.;
   input hol & date7.;
   datalines;
25dec03
01jan04
;

proc cpm date='01dec03'd data=widgr19  out=spltschd
     holidata=holdata resin=widgrin resout=spltrout
     interval=weekday collapse;
   activity task;
   duration days;
   successor succ;
   holiday hol;
   resource prodman hrdware / period=per obstype=otype
                              minsegmtdur=minseg
                              rcs avl;

   id task;
   run;

proc sort data=spltschd;
   by e_start;

* set up required pattern statements;

pattern1 c=blue v=s;   /* duration of a non-critical activity   */
pattern2 c=blue v=e;   /* slack time for a noncrit. activity    */
pattern3 c=red v=s;    /* duration of a critical activity       */
pattern4 c=red v=e;    /* slack time for a supercrit. activity  */
pattern5 c=red v=r2;   /* duration of a supercrit. activity     */
pattern6 c=cyan v=s;   /* actual duration of an activity        */
pattern7 c=blue v=r1;  /* break due to a holiday                */
pattern8 c=red v=x1;   /* resource schedule of activity         */
pattern9 c=blue v=s;   /* baseline schedule of activity         */

* set vpos to 50 and hpos to 100;
goptions vpos=50 hpos=100;

title2 'Using the HEIGHT= and HTOFF= options';

* draw Gantt chart using height and htoff equal to 2;
proc gantt graphics data=spltschd holidata=holdata;
   chart / holiday=(hol) dur=days compress cmile=green caxis=black
           height=2 htoff=2;
   id task;
   run;