Resources

Producing Web Enabled Gantt Charts (gantt26)

/****************************************************************/
/*          S A S   S A M P L E   L I B R A R Y                 */
/*                                                              */
/*    NAME: GANTT26                                             */
/*   TITLE: Producing Web Enabled Gantt Charts (gantt26)        */
/* PRODUCT: OR                                                  */
/*  SYSTEM: ALL                                                 */
/*    KEYS: GANTT                                               */
/*   PROCS: CPM, SORT, GANTT                                    */
/*    DATA:                                                     */
/*                                                              */
/* SUPPORT:                             UPDATE:                 */
/*     REF: Example 26 in the GANTT Chapter (PM User's Guide)   */
/*    MISC: See note below for hosts MVS and CMS                */
/*                                                              */
/****************************************************************/

%filename(b, Gantt_Sum, htm);

ods html body=b(url="Gantt_Sum.htm");

/* On hosts MVS and CMS the gpath= option should be added   */
/* to the above command line with a valid path name.        */

data lanact;
   format act $30. succ $30. parent $20.;
   input act & succ & parent & days;
   datalines;
Measure Current Volume     Forecast Future Volume     NEEDS ASSESSMENT       2
Literature Survey          Manufacturer Demos         MARKET SURVEY          5
Determine Current Users    Forecast Future Needs      NEEDS ASSESSMENT       2
Forecast Future Volume     Prepare Network Spec       NEEDS ASSESSMENT       2
Manufacturer Demos         Identify Vendors           MARKET SURVEY          5
Forecast Future Needs      Prepare Network Spec       NEEDS ASSESSMENT       2
Identify Vendors           .                          MARKET SURVEY          2
Prepare Network Spec       .                          NEEDS ASSESSMENT       2
Prepare RFQ                Evaluate Vendor Responses  VENDOR SELECTION       4
Prepare Cable Plan         Procure Cable              SITE PREPARATION       4
Evaluate Vendor Responses  Notify Final Candidate     VENDOR SELECTION      15
Procure Cable              Install Cable              SITE PREPARATION      22
Notify Final Candidate     Negotiate Price/Config     VENDOR SELECTION       1
Install Cable              .                          SITE PREPARATION      10
Negotiate Price/Config     Prepare Purchase Order     VENDOR SELECTION       3
Prepare Purchase Order     .                          VENDOR SELECTION       1
Server Functional Spec     Server Detail Design       SPECIAL HARDWARE       5
Procure LAN Hardware       Receive Network Hardware   NETWORK INSTALLATION  25
Server Detail Design       Server Coding              SPECIAL HARDWARE      10
Receive Network Hardware   Install LAN Hardware       NETWORK INSTALLATION   4
Server Coding              Test Server Code           SPECIAL HARDWARE      10
Install LAN Hardware       Test Network               NETWORK INSTALLATION   7
Test Server Code           Install/Integrate Server   SPECIAL HARDWARE       5
Test Network               .                          NETWORK INSTALLATION   5
Install/Integrate Server   .                          SPECIAL HARDWARE       2
BEGIN PROCUREMENT          NEEDS ASSESSMENT           .                      .
BEGIN PROCUREMENT          MARKET SURVEY              .                      .
NEEDS ASSESSMENT           VENDOR SELECTION           .                      .
NEEDS ASSESSMENT           SITE PREPARATION           .                      .
MARKET SURVEY              Prepare Network Spec       .                      .
VENDOR SELECTION           NETWORK INSTALLATION       .                      .
VENDOR SELECTION           SPECIAL HARDWARE           .                      .
SITE PREPARATION           Install LAN Hardware       .                      .
NETWORK INSTALLATION       NETWORK AVAILABLE          .                      .
SPECIAL HARDWARE           NETWORK AVAILABLE          .                      .
;


proc sort data=lanact;
   by act;
   run;

proc cpm data=lanact out=lanout
         expand interval=workday date='03nov03'd;
   parent parent / wbs eso;
   activity act;
   duration days;
   successor succ;
   run;

data lanweb;
   set lanout;
   length webvar $500;
   length webvar2 $500;
   /* WEBVAR is for the top-level summary chart */
   webvar='alt='|| quote(
     'Activity: '||trim(left(act))||'0D'x||
     '-----------------------'||'0D'x||
     'Early Start: '||put(e_start,  datetime.)||'0D'x||
     'Early Finish:'||put(e_finish, datetime.)||'0D'x||
     'Late Start:  '||put(l_start,  datetime.)||'0D'x||
     'Late Finish: '||put(l_finish, datetime.) )||
     ' HREF=#W'||trim(wbs_code)  /* link to the anchors */
     ;

   /* WEBVAR2 is for the detailed charts */
   webvar2='alt='|| quote(
     'Activity: '||trim(left(act))||'0D'x||
     '-----------------------'||'0D'x||
     'Early Start: '||put(e_start,  datetime.)||'0D'x||
     'Early Finish:'||put(e_finish, datetime.)||'0D'x||
     'Late Start:  '||put(l_start,  datetime.)||'0D'x||
     'Late Finish: '||put(l_finish, datetime.) )
     ;
   run;


proc sort data=lanweb;
   by wbs_code;
   run;

ods listing close;

goptions reset=all device=gif;


/* Create the Summary Gantt Chart with Drill Down Action */
title1 h=2 'Gantt Example 26';
title2 h=1.5 'Project Summary Gantt Chart';


/* set up required pattern and symbol statements; */
pattern1 c=green v=s;
pattern2 c=green v=e;
pattern3 c=red   v=s;
goptions cback=white htext=1.1;

proc gantt data=lanweb;
  id act wbs_code;
  where proj_lev=1;
  label act='SUBPROJECT' wbs_code='WBS CODE';
  chart / pcompress nojobnum scale=2.5
          mindate='30oct03'd maxdate='29feb04'd
          cprec=black duration=days mininterval=week
          ref='30oct03:00:00'dt to '01mar04:00:00'dt by dtmonth
          reflabel
          html=webvar
          act=act succ=succ;
  run;

/* Define the macro to generate the detail charts */
%macro gandet(wbs);
ods html anchor="W&wbs." device=gif;
title1 h=2 'Gantt Example 26';
title2 h=1.5 "Detail Gantt Chart for WBS=&wbs.";

/* set up required pattern and symbol statements; */
pattern1 c=green v=s;
pattern2 c=green v=e;
pattern3 c=red   v=s;
goptions cback=white;

proc gantt data=lanweb;
  id act wbs_code;
  where index(wbs_code,"&wbs.")=1;
  label act='SUBPROJECT' wbs_code='WBS CODE';
  chart / pcompress nojobnum scale=2.5
          mindate='30oct03'd maxdate='29feb04'd
          cprec=black duration=days mininterval=week
          ref='30oct03:00:00'dt to '01mar04:00:00'dt by dtmonth
          reflabel html=webvar2
          act=act succ=succ;
  run;
%mend;

/* Generate each of the detail Gantt Charts */
%gandet(0.1);
%gandet(0.2);
%gandet(0.3);
%gandet(0.4);
%gandet(0.5);
%gandet(0.6);

ods html close;