Resources

Multiple Projects (intpm6)

/****************************************************************/
/*          S A S   S A M P L E   L I B R A R Y                 */
/*                                                              */
/*    NAME: INTPM6                                              */
/*   TITLE: Multiple Projects (intpm6)                          */
/* PRODUCT: OR                                                  */
/*  SYSTEM: ALL                                                 */
/*    KEYS:                                                     */
/*   PROCS: NETDRAW                                             */
/*    DATA:                                                     */
/*                                                              */
/* SUPPORT:                             UPDATE:                 */
/*     REF: Example 6 from the chapter, Introduction to Project */
/*           Management.                                        */
/*    MISC:                                                     */
/*                                                              */
/****************************************************************/

data book;
   input id $ 1-16 task $ 20-23 dur succ $ 29-32
         editor  artist;
   datalines;
Preliminary Edit   PEDT  1  REV   1   .
Preliminary Edit   PEDT  1  GRPH  1   .
Revise Book        REV   2  CEDT  1   .
Graphics           GRPH  3  CEDT  .   1
Copyedit Book      CEDT  1  PRF   1   .
Proofread Book     PRF   1  PRNT  1   .
Print Book         PRNT  2        .   .
;


pattern1 v=e c=red;
title c=black h=2.5 'Publishing a Book';
title2 c=black h=1.5 'Network Template';
proc netdraw data=book graphics;
   actnet / act=task succ=succ font='Albany AMT'
            id=(id dur) nodefid nolabel
            carcs=green  htext=1.5 pcompress
            xbetween=3 boxht=4 novcenter vmargin=5;
   run;

data book1;
   length act $6. succ $6.;
   set book;
   subproj = "Book 1";
   act = "B1"||task;
   if succ ^= " " then succ = "B1"||succ;
   run;

data book2;
   length act $6. succ $6.;
   set book;
   subproj = "Book 2";
   act  = "B2"||task;
   if act = "B2PEDT" then dur = 2;
   if succ ^= " "    then succ = "B2"||succ;
   run;


title 'Publishing Book 1';
proc print data=book1;
   var subproj task act succ id dur editor artist;
   run;

title 'Publishing Book 2';
proc print data=book2;
   var subproj task act succ id dur editor artist;
   run;

data books;
   set book1 book2;
   if subproj = "Book 1" then priority = 1;
   else priority = 2;
   run;

data resource;
   input avdate & date7. editor artist;
   format avdate date7.;
   datalines;
1jan03   1   1
;


title 'Publishing Books 1 and 2';
proc print data=books;
   var subproj priority task act succ id dur editor artist;
   run;

title 'Resources Available';
proc print data=resource;
   run;

proc cpm data=books resin=resource
         out=bookschd resout=booksout
         date='1jan03'd interval=week
         addact;
   act      act;
   dur      dur;
   succ     succ;
   resource editor artist / per=avdate avp rcp
                            rule=actprty actprty=priority
                            delayanalysis;
   id       id task;
   project  subproj;
   run;

title 'Schedule for Project BOOKS';
proc print data=bookschd;
   run;

title 'Resource Usage for Project BOOKS';
proc print data=booksout;
   run;

goptions hpos=98 vpos=60;

pattern1 v=e c=green;
pattern2 v=e c=red;

title c=black h=4 'Schedule for Project Books';
proc netdraw data=bookschd(where=(proj_dur=.)) graphics;
   actnet / act=act succ=succ
            id=(task) nodefid nolabel
            xbetween=8 htext=3 pcompress
            zone=subproj zonepat zonespace
            align=s_start separatearcs;
   label subproj = 'Subproject';
   run;

proc pm data=books resin=resource
        out=pmsched resout=pmrout
        date='1jan03'd interval=week;
   act      act;
   dur      dur;
   succ     succ;
   resource editor artist / per=avdate
                            avp rcp
                            rule=actprty
                            actprty=priority
                            delayanalysis;
   id       id task;
   project  subproj;
   run;