Multiproject Scheduling (cpme23)
/****************************************************************/
/* S A S S A M P L E L I B R A R Y */
/* */
/* NAME: CPME23 */
/* TITLE: Multiproject Scheduling (cpme23) */
/* PRODUCT: OR */
/* SYSTEM: ALL */
/* KEYS: CPM */
/* PROCS: CPM */
/* DATA: */
/* */
/* SUPPORT: UPDATE: */
/* REF: Example 23 from the CPM Chapter (PM User's Guide) */
/* MISC: */
/* */
/****************************************************************/
data survey;
input id $ 1-20
activity $ 22-30
duration
succ1 $ 35-43
succ2 $ 44-51
succ3 $ 53-60
project $ 62-70;
label project = 'Project Phase'
id = 'Description';
datalines;
Plan Survey plan sur 4 hire per design q Plan
Hire Personnel hire per 5 trn per Prepare
Design Questionnaire design q 3 trn per select h print q Plan
Train Personnel trn per 3 Prepare
Select Households select h 3 Prepare
Print Questionnaire print q 4 Prepare
Conduct Survey cond sur 10 analyze Implement
Analyze Results analyze 6 Implement
Plan Plan 6 Survey
Prepare Prepare 8 Implement Survey
Implement Implement 18 Survey
Survey Project Survey .
;
data holidata;
format hol date7.;
hol = '09apr04'd;
run;
title 'Survey Project';
title2 'Activity Data Set SURVEY';
proc print data=survey;
run;
title2 'Holiday Data Set HOLIDATA';
proc print data=holidata;
run;
proc cpm data=survey date='29mar04'd out=survout1
interval=weekday holidata=holidata;
activity activity;
successor succ1-succ3;
duration duration;
id id;
holiday hol;
project project / orderall addwbs;
run;
proc sort;
by es_asc;
run;
title 'Conducting a Market Survey';
title2 'Early and Late Start Schedule';
proc print;
run;
data gant;
length id $26.;
set survout1;
if proj_lev=1 then id=" "||id;
else if proj_lev=2 then id=" "||id;
run;
goptions hpos=80 vpos=43;
title c=black h=2 'Conducting a Market Survey';
title2 c=black h=1.5 'Project Schedule';
pattern1 c=green v=s; /* duration of a non-critical activity */
pattern2 c=green v=e; /* slack time for a noncrit. activity */
pattern3 c=red v=s; /* duration of a critical activity */
pattern4 c=magenta v=e; /* slack time for a supercrit. activity */
pattern5 c=magenta v=s; /* duration of a supercrit. activity */
pattern6 c=cyan v=s; /* actual duration of an activity */
pattern7 c=black v=e; /* break due to a holiday */
proc gantt graphics data=gant holidata=holidata;
chart / holiday=(hol)
interval=weekday
skip=2 height=1.8
nojobnum
compress noextrange
activity=activity succ=(succ1-succ3)
cprec=cyan cmile=magenta
caxis=black;
id id;
run;
title 'Market Survey';
title2 'Summary Schedule';
proc print data=survout1;
where proj_lev=1;
id activity;
var proj_dur duration e_start--t_float;
run;
title 'Market Survey';
title2 'Sub-Project Schedule';
proc print data=survout1;
where substr(WBS_CODE,1,3) = "0.1";
id activity;
var project--activity duration e_start--t_float;
run;
proc cpm data=survey date='29mar04'd out=survout2
interval=weekday holidata=holidata
fbdate='10may04'd; /* project finish date */
activity activity;
successor succ1-succ3;
duration duration;
id id;
holiday hol;
project project / orderall addwbs;
run;
title 'Market Survey';
title2 'Summary Schedule: FBDATE Option';
proc print data=survout2;
where proj_lev=1; /* First level subprojects */
id activity;
var proj_dur duration e_start--t_float;
run;
proc cpm data=survey date='29mar04'd out=survout3
interval=weekday holidata=holidata fbdate='10may04'd;
activity activity;
successor succ1-succ3;
duration duration;
id id;
holiday hol;
project project / orderall addwbs sepcrit;
run;
title 'Market Survey';
title2 'Summary Schedule: FBDATE and SEPCRIT Options';
proc print data=survout3;
where proj_lev=1;
id activity;
var proj_dur duration e_start--t_float;
run;
proc cpm data=survey date='29mar04'd out=survout4
interval=weekday holidata=holidata fbdate='10may04'd;
activity activity;
successor succ1-succ3;
duration duration;
id id;
holiday hol;
project project / orderall addwbs useprojdur;
run;
title 'Market Survey';
title2 'Summary Schedule: FBDATE and USEPROJDUR Options';
proc print data=survout4;
where proj_lev=1;
id activity;
var proj_dur duration e_start--t_float;
run;
data gant4;
length id $26.;
set survout4;
if proj_lev=1 then id=" "||id;
else if proj_lev=2 then id=" "||id;
run;
proc sort;
by es_asc;
run;
goptions hpos=80 vpos=43;
title h=2 'Market Survey';
title2 h=1.5 'Project Schedule: FBDATE and USEPROJDUR Options';
proc gantt graphics data=gant4 holidata=holidata;
chart / holiday=(hol)
interval=weekday
skip=2 scale=1.5 height=1.8
nojobnum
compress noextrange
activity=activity succ=(succ1-succ3)
cprec=cyan cmile=magenta
caxis=black
;
id id;
run;
data survey2;
format aldate date7.;
set survey;
if activity="Implement" then do;
altype="fle";
aldate='5may04'd;
end;
run;
proc cpm data=survey2 date='29mar04'd out=survout5
interval=weekday holidata=holidata
fbdate='10jun04'd;
activity activity;
successor succ1-succ3;
duration duration;
id id;
holiday hol;
project project / orderall addwbs sepcrit useprojdur;
aligntype altype;
aligndate aldate;
run;
title 'Market Survey';
title2 'USEPROJDUR option and Alignment date';
proc print;
where proj_lev=1;
id activity;
var proj_dur duration e_start--t_float;
run;