Resources

Software Development Project (cpm0)

 /****************************************************************/
 /*          S A S   S A M P L E   L I B R A R Y                 */
 /*                                                              */
 /*    NAME: CPM0                                                */
 /*   TITLE: Software Development Project (cpm0)                 */
 /* PRODUCT: OR                                                  */
 /*  SYSTEM: ALL                                                 */
 /*    KEYS: CPM                                                 */
 /*   PROCS: CPM                                                 */
 /*    DATA:                                                     */
 /*                                                              */
 /* SUPPORT:                             UPDATE:                 */
 /*     REF: Examples from the Getting Started & Details sections*/
 /*          (PM User's Guide)                                   */
 /*    MISC:                                                     */
 /*                                                              */
 /****************************************************************/
data software;
   format Descrpt $20. Activity $8.
          Succesr1-Succesr2 $8. ;
   input Descrpt & Duration Activity $
         Succesr1 $ Succesr2 $ ;
   datalines;
Initial Testing       20  TESTING   RECODE    .
Prel. Documentation   15  PRELDOC   DOCEDREV  QATEST
Meet Marketing        1   MEETMKT   RECODE    .
Recoding              5   RECODE    DOCEDREV  QATEST
QA Test Approve       10  QATEST    PROD      .
Doc. Edit and Revise  10  DOCEDREV  PROD      .
Production            1   PROD      .         .
;

proc cpm data=software
         out=intro1
         interval=day
         date='01mar04'd;
   id descrpt;
   activity activity;
   duration duration;
   successor succesr1 succesr2;
run;

title 'Project Schedule';
proc print data=intro1;
run;

 /****************************************************************/
 /*          S A S   S A M P L E   L I B R A R Y                 */
 /*                                                              */
 /*    NAME: CPMNAOA                                             */
 /*   TITLE: Software Project : Activity on Arc Representation   */
 /* PRODUCT: OR                                                  */
 /*  SYSTEM: ALL                                                 */
 /*    KEYS: CPM                                                 */
 /*   PROCS: CPM                                                 */
 /*    DATA:                                                     */
 /*                                                              */
 /* SUPPORT:                             UPDATE:                 */
 /*     REF: Program used to generate the Activity-on-Arc        */
 /*          representation in the "Getting Started" section     */
 /*    MISC:                                                     */
 /*                                                              */
 /****************************************************************/


data softaoa ;
   input activity $ 1-8
       tail head _x_ _y_;
 datalines;
TESTING   1   2  1  1
RECODE    2   3  4  1
PRELDOC   1   3  1  1
Dummy     3   4  7  1
DOCEDREV  4   5  9  3
QATEST    3   5  7  1
PROD      5   6  10 1
          6   .  13 1
;

proc netdraw nodisplay data=softaoa out=netout;
   actnet / act=tail succ=head;
   run;

data netin;
   set netout;
   if _y_ < 1 then _y_= 3;
   run;

data anno;
   /* Set up required variable lengths, etc. */
   length function color style   $8;
   length xsys ysys hsys         $1;
   length when position          $1;
   length text                   $8;
   xsys     = '2';
   ysys     = '2';
   hsys     = '4';
   when     = 'a';
   function = 'label   ';
   size = 1.2;
   position = '5';
   x=2.5;  y=1.2;  text='MEETMKT'; output;
   x=2.5;  y= .9;  text='TESTING'; output;
   x=5.5;  y=1.2;  text='RECODE';  output;
   x=4;    y=3.2;  text='PRELDOC'; output;
   x=8.5;  y=1.2;  text='QATEST';  output;
   x=11.5; y=1.2;  text='PROD';    output;
   position=6;
   x= 7.6; y=3.2;  text='Dummy';   output;
   x= 9.6; y=2;    text='DOCEDREV';output;
   run;

pattern1 v=e c=green;
title h=2 'Software Project';
proc netdraw graphics data=netin anno=anno;
   actnet / pcompress;
   run;

 /****************************************************************/
 /*          S A S   S A M P L E   L I B R A R Y                 */
 /*                                                              */
 /*    NAME: CPMNAON                                             */
 /*   TITLE: Activity-on-Node Network Diagram                    */
 /* PRODUCT: OR                                                  */
 /*  SYSTEM: ALL                                                 */
 /*    KEYS: CPM                                                 */
 /*   PROCS: CPM, GANTT                                          */
 /*    DATA:                                                     */
 /*                                                              */
 /* SUPPORT:                             UPDATE:                 */
 /*     REF: Program used to generate the Activity-on-Node       */
 /*          representation in the "Getting Started" section     */
 /*    MISC:                                                     */
 /*                                                              */
 /****************************************************************/



data software;
   input descrpt  $char20.
         duration 23-24
         activity $ 27-34
         succesor $ 37-44
         _x_ _y_ ;
   datalines;
Initial Testing       20  TESTING   RECODE    1  1
Meet Marketing        1   MEETMKT   RECODE    1  2
Prel. Documentation   15  PRELDOC   DOCEDREV  1  3
Prel. Documentation   15  PRELDOC   QATEST    1  3
Recoding              5   RECODE    DOCEDREV  2  2
Recoding              5   RECODE    QATEST    2  2
QA Test Approve       10  QATEST    PROD      3  3
Doc. Edit and Revise  10  DOCEDREV  PROD      3  1
Production            1   PROD                4  2
;

pattern1 v=e c=green;
title h=2 'Software Project';
proc netdraw graphics data=software;
   actnet / act=activity succ=(succesor)
            pcompress;
run;

 /****************************************************************/
 /*          S A S   S A M P L E   L I B R A R Y                 */
 /*                                                              */
 /*    NAME: CPMDET                                              */
 /*   TITLE: Example for the Details section                     */
 /* PRODUCT: OR                                                  */
 /*  SYSTEM: ALL                                                 */
 /*    KEYS: CPM                                                 */
 /*   PROCS: CPM                                                 */
 /*    DATA:                                                     */
 /*                                                              */
 /* SUPPORT:                             UPDATE:                 */
 /*     REF: Program used to generate the Line-Printer Gantt     */
 /*          charts in the "Multiple Calendars" section          */
 /*    MISC:                                                     */
 /*                                                              */
 /****************************************************************/
data workdata;
   input s1 s2 s3;
   informat s1 s2 s3 time6.;
   format s1 s2 s3 time6.;
   datalines;
7:00  .     7:00
11:00 08:00 11:00
12:00 .     .
16:00 .     .
;

proc print;
run;

data caledata;
   input _cal_  _sun_ $ _mon_  $ _tue_ $ _fri_ $
         _sat_ $ d_length time6.;
   format d_length time6.;
   datalines;
1 holiday  s1  s1  s2  s3  8:00
2 holiday . . . holiday    .
3 .       . . . .          .
;
proc print;
run;
data ex;
   input _cal_ start datetime16. finish datetime16.;
   format start finish datetime16.;
   datalines;
0 22dec03:00:00    04feb04:00:00
1 22dec03:00:00    04feb04:00:00
2 22dec03:00:00    04feb04:00:00
3 22dec03:00:00    04feb04:00:00
;

data holiday;
   input holista date9. holidur holifin date9. _cal_;
   format holista holifin date7.;
   datalines;
24dec03  .  26dec03  .
01jan04  1  .        1
19jan04  .  .        2
29jan04  3  .        2
29jan04  3  .        3
;

options ls=101 ps=30 formdlim='';
title 'Christmas and New Year Holidays';
proc gantt data=ex lp
           holidata=holiday workdata=workdata calendar=caledata;
     chart / es=start ef=finish daystart='09:00't daylength='08:00't
     interval=dtday mininterval=dthour markbreak increment=12
     holiday=(holista) holidur=(holidur) holifin=(holifin)  holichar='*'
     nolegend nojobnum skip=0 mindate='22dec03'd maxdate='2jan04'd;
     id _cal_;
run;
options ls=101 ps=30 formdlim='';
title 'Vacation Times for Calendars 2 and 3';
proc gantt data=ex (firstobs=3) lp
           holidata=holiday workdata=workdata calendar=caledata;
     chart / es=start ef=finish daystart='09:00't daylength='08:00't
     interval=dtday mininterval=dthour markbreak increment=12
     holiday=(holista) holidur=(holidur) holifin=(holifin) holichar='*'
     nolegend nojobnum skip=0 mindate='18jan04'd maxdate='3feb04'd;
     id _cal_;
run;