/***********************************************************************************
* 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 4.1.;
%let _title=’A project network: Activity-On-Node Format: Critical Path ,Analysis, solution to exercise 4.1.’;
%let dcpm=’c:/sasor/Data4_1_exercise.txt’;
%let _activity=task;
%let _duration=days;
option nodate;
* The data handling macro;
%macro data;
* Import text tab delimited data file to SAS data file;
proc import
datafile=&dcpm
out=dcpm
dbms=tab
replace;
getnames=yes;
run;
%mend data;
* The model building macro;
%macro model;
proc cpm
out=cpmout1;
activity &_activity;
duration &_duration;
successor succ1 succ2 succ3;
run;
%put &_ORCPM_;
%mend model;
%macro report;
data cpmout (where=(T_float=0));
set cpmout1;
run;
title &_title;
proc print
data =cpmout1 ;
run;
title &_title;
proc print
data =cpmout ;
sum &_duration;
run;
%mend report;
* Invoke PROC CPM to schedule the project specifying
* the ACTIVITY, DURATION and SUCCESSOR variables;
%macro orcpm;
%data;
%model;
%report;
%mend orcpm;
%orcpm;
/****************************************************************************
******************************END of the program*****************************
****************************************************************************/