/***********************************************************************************
* This program is taken from the following book. If using please cite it as: *
* Emrouznejad, A. and W. Ho (2012). Applied Operations Research with SAS, *
* CRC Press: Taylor Francis Ltd, ISBN: 9781439841303. *
* For details please visit: http://www.sas-or.com. *
************************************************************************************/
* A SAS procedure for project network of type Activity-On-Node: solution to exercise 3.8.;
%let _title=’A project network: Activity-On-Node Format: solution to exercise 4.2.’;
option nodate;
%let _data=’c:/sasor/Data4_2_exercise.txt’;
%let _activity=task;
%let _duration=days;
* The data handling macro;
%macro data;
* Import text tab delimited data file to SAS data file;
proc import
datafile=&_data
out=dpert
dbms=tab
replace;
getnames=yes;
run;
data dpert;
set dpert;
days=(Opti+4*most+pessi)/6;
variance=((Opti-pessi)/6)**2;
run;
%mend data;
* The model building macro;
%macro model;
proc cpm
out=pertout;
activity &_activity;
duration &_duration;
successor succ1 succ2 succ3;
run;
%put &_ORCPM_;
%mend model;
* The report writing macro;
%macro report;
data pertout1 ;
merge dpert pertout;
by task;
run;
data pertout2 (where=(T_float=0));
merge dpert pertout;
by task;
run;
title &_title;
proc print
data =pertout1 ;
run;
proc print
data =pertout2 ;
sum T_float;
sum days;
sum variance;
run;
%mend report;
%macro orpert;
%data;
%model;
%report;
%mend orpert;
%orpert;
/****************************************************************************
******************************END of the program*****************************
****************************************************************************/