Resources

Getting Started Example (evm0)

/***************************************************************/
/*                                                             */
/*          S A S   S A M P L E   L I B R A R Y                */
/*                                                             */
/*    NAME: evm0                                               */
/*   TITLE: Getting Started Example (evm0)                     */
/* PRODUCT: OR                                                 */
/*  SYSTEM: ALL                                                */
/*    KEYS: OR                                                 */
/*   PROCS: CPM, GANTT, NETDRAW, PRINT, SQL                    */
/*    DATA:                                                    */
/*                                                             */
/* SUPPORT:                             UPDATE:                */
/*     REF:                                                    */
/*    MISC: Example from the Getting Started section of the    */
/*          Earned Value Management Macros chapter of Project  */
/*          Management                                         */
/*                                                             */
/***************************************************************/

/*

Please see documentation for setting up the macros.

*/

 /***************************************************************
  *                                                             *
  * Analysis: Generating Periodic Data Sets                     *
  *                                                             *
  ***************************************************************/

  /* List activities */

data softin;
   input Project  $10.
         Activity $11.
         Description $22.
         Duration
         Succesr1 $9.
         Succesr2 $9.;
   datalines;
          SWPROJ     Software project       .
DEBUG     RECODE     Recoding               5  DOCEDREV  QATEST
DOC       DOCEDREV   Doc. Edit and Revise  10  PROD
DOC       PRELDOC    Prel. Documentation   15  DOCEDREV  QATEST
MISC      MEETMKT    Meet Marketing         0  RECODE
MISC      PROD       Production             1
SWPROJ    DEBUG      Debug & Code Fixes     .
SWPROJ    DOC        Doc. Subproject        .
SWPROJ    MISC       Miscellaneous          .
SWPROJ    TEST       Test Subproject        .
TEST      QATEST     QA Test Approve       10  PROD
TEST      TESTING    Initial Testing       20  RECODE
;


proc print data=softin;
    title 'Software Schedule Input';
    var Project Activity Description Duration Succesr1 Succesr2;
run;

goptions hpos=100 vpos=70;
title;

/* Produce project network diagram */

data softabridged;
   set softin;
   if activity ne 'SWPROJ' and project ne 'SWPROJ' then output;
run;

proc netdraw data=softabridged out=ndout graphics;
   actnet/act=activity
   id=(description)
   nodefid
   nolabel
   succ=(succesr1 succesr2)
   lwidth=2
   coutline=black
   ctext=black
   carcs=black
   cnodefill=ltgray
   zone=project
   zonespace
   htext=3 pcompress
   centerid;
run;

goptions reset=all;

/* Produce work breakdown structure graphic */

%evg_wbs_chart(
   structure=softin,
   activity=activity,
   project=project
);

title;

/* Schedule the project */

proc cpm data=softin
         out=software
         interval=day
         date='01mar10'd;
   id description;
   project project / addwbs;
   activity activity;
   duration duration;
   successor succesr1 succesr2;
run;

/* Sort the schedule output by wbs code */

proc sort data=software;
   by wbs_code;
run;

proc print data=software;
    title 'Planned Schedule';
    var activity wbs_code e_start e_finish l_start l_finish;
run;

goptions reset=symbol;
goptions reset=pattern;
pattern1 value=R1 color=B REPEAT=1;
pattern2 value=E color=GR REPEAT=1;
pattern3 value=S color=R REPEAT=1;
pattern4 value=X1 color=P REPEAT=1;
pattern5 value=E color=BR REPEAT=1;
pattern6 value=L1 color=GR REPEAT=1;
pattern7 value=R1 color=G REPEAT=1;
pattern8 value=X1 color=Y REPEAT=1;
pattern9 value=E color=B REPEAT=1;

title h=4pct 'Project Master Schedule';
title2 h=3pct;
proc gantt data=software;
   chart / mininterval=week pcompress
      height=1.3
      skip=2
      activity=activity
      nojobnum
      successor=(succesr1 succesr2)
      scale=10
      duration=duration;
      id description wbs_code;
run;

/* Rename and label schedule data set variables */

data software;
   set software;
   keep project activity duration description
        e_start e_finish wbs_code succesr1 succesr2;
   rename e_start = Start
          e_finish = Finish;
   label wbs_code = 'WBS Code'
         e_start = 'Start'
         e_finish = 'Finish';
   if duration eq . then duration = proj_dur;
run;


proc print data=software label;
   title 'Planned Schedule';
   var activity wbs_code description duration Start Finish;
run;

/* Input rates */

data rates;
   input Activity $11.
         Rate;
   datalines;
SWPROJ       5
RECODE       6
PRELDOC      4
DOCEDREV     4
MEETMKT      .
PROD         2
TEST         1
DOC          1
MISC         1
DEBUG        1
TESTING      3
QATEST       4
;


proc print data=rates;
   title 'Planned Rates';
run;

%eva_planned_value(
     plansched=software,      /* schedule data */
     activity=activity,
     start=start,
     finish=finish,
     duration=duration,
     budgetcost=rates,        /* cost data */
     rate=rate
);

proc print data=pv label;
   title 'Daily Planned Value';
   var _time_ _PV_Rate_;
   label _time_='Date';
run;

/* Updated schedule input */

data softact;
   input Activity $11.
         Start : date7.
         Finish : date7.
         Percent
   ;
   format Start Finish date7.;
   datalines;
MEETMKT    01MAR10 01MAR10 100
PRELDOC    01MAR10 14MAR10 100
TESTING    01MAR10     .    80
;


proc sort data=softact;
   by activity;
run;

proc print data=softact label;
   title 'Actual Dates and Percentage Complete';
   var activity start finish percent;
   label activity='Activity'
         start='Start'
         finish='Finish'
         percent='Percent';
run;

/* Integrate status information with  original schedule input */

proc sql;
   create table softupd as
      select project, softin.activity, duration,
             start, finish, percent, succesr1,
             succesr2, description
         from softin left join softact
         on softin.activity = softact.activity
         order by 1, 2
   ;
quit;

proc print data=softupd;
    title 'Schedule Input March 25';
    var Project Activity Duration Start Finish Percent Succesr1 Succesr2;
run;

/* Produce updated schedule */

title;

proc cpm data=softupd
         out=software25
         interval=day
         date='01mar10'd;
   id description percent;
   project project / addwbs;
   activity activity;
   duration duration;
   actual / as=start af=finish pctcomp=percent timenow='25MAR10'd;
   successor succesr1 succesr2;
run;

/* Compare original schedule with updated schedule */

proc sort data=software25;
   by wbs_code;
run;

data s25;
   set software25;
run;

data sw;
   set software;
run;

proc sort data=s25;
   by activity;
run;

proc sort data=sw;
   by activity;
run;

data sws25;
   merge s25 sw;
      by activity;
run;

proc sort data=sws25;
   by wbs_code;
run;

proc print data=sws25 label;
   title 'Software Schedule as of March 25';
   var activity wbs_code start finish e_start e_finish percent;
   label wbs_code='WBS Code'
         start='Planned Start'
         finish='Planned Finish'
         e_start='Start'
         e_finish='Finish'
         percent='Percent';
run;

/* Rename variables E_START and E_FINISH */

data software25;
   set software25;
   keep project activity e_start e_finish percent wbs_code duration;
   rename e_start = Start
          e_finish = Finish;
   label wbs_code = 'WBS Code'
         e_start = 'Start'
         e_finish = 'Finish';
run;


/* Updated rates */

data rates25;
   input Activity $12.
         Rate
         ;
   datalines;
PRELDOC     5
RECODE      5
TESTING     4
;


proc print data=rates25;
   title 'Actual Rates Day 25';
   var activity rate;
run;

title;

%eva_earned_value(
    revisesched=software25, /* revised schedule */
    activity=activity,
    start=start,
    finish=finish,
    actualcost=rates25,     /* actual costs */
    rate=rate
);

proc print data=ev label;
    title 'Daily Earned Value and Revised Cost';
    var _time_ _EV_Rate_ _AC_Rate_;
    label _time_='Date';
run;

proc sql;
   create table pvev as
       select EV._TIME_, PV._PV_Rate_, EV._EV_Rate_, EV._AC_Rate_
           from PV right join EV on PV._TIME_=EV._TIME_;
quit;

proc print data=pvev label;
   title 'Daily Planned Value, Earned Value, and Revised Cost';
   label _TIME_='DATE'
         _PV_Rate_='PV Rate'
         _EV_Rate_='EV Rate'
         _AC_Rate_='AC Rate';
run;

proc sql;
   drop table pvev;
quit;

/***************************************************************
 *                                                             *
 *  Analysis: Results                                          *
 *                                                             *
 ***************************************************************/


%eva_metrics(timenow='25MAR10'd);


/* List contents of %EVA_METRICS output data sets */

proc print data=summary label;
    title 'Earned Value Summary Statistics';
run;

proc print data=metrics label;
    title 'Earned Value Cumulative Periodic Metrics';
    title2 'Values, Costs, Variances and Indices';
    label _time_ = 'Date';
run;

%eva_task_metrics(
    plansched=software,
    revisesched=software25,
    activity=activity,
    start=start,
    finish=finish,
    budgetcost=rates,
    actualcost=rates25,
    rate=rate,
    aggregate=Y,
    timenow='25MAR10'd
);

/***************************************************************
 *                                                             *
 *  Charts                                                     *
 *                                                             *
 ***************************************************************/

%evg_variance_plot;

%evg_gantt_chart(
        plansched=software,
        revisesched=software25,
        duration=duration,
        start=start,
        finish=finish,
        activity=activity,
        timenow='25MAR10'd,
        id=wbs cv sv cpi spi,
        height=3,
        scale=20
);

%evg_index_plot;

%evg_cost_plot;

%evg_schedule_plot;