Exporting Resource-Constrained Schedules (mspsas8)
/***************************************************************/
/* */
/* S A S S A M P L E L I B R A R Y */
/* */
/* NAME: mspsas8 */
/* TITLE: Exporting Resource-Constrained Schedules (mspsas8) */
/* PRODUCT: OR */
/* SYSTEM: ALL */
/* KEYS: OR */
/* PROCS: PM, SAS/ACCESS */
/* DATA: */
/* */
/* SUPPORT: UPDATE: */
/* REF: */
/* MISC: Example 8 from the The Microsoft Project */
/* Conversion Macros chapter of Project Management */
/* */
/***************************************************************/
/***************************************************************
In this example, a project is scheduled subject to resource
constraints.
***************************************************************/
/***************************************************************
In this example we use a file reference mspref to specify
the path and file name of the mdb file to be created by the
macro %SASTOMSP.
filename mspref "C:\MSPROJ\sasmsp4a.mdb";
You may want to change it to a file name you want.
If you don't define mspref as a sas file reference, a file
mspref.mdb will be created in the default path of the OUTFILE=
option of PROC EXPORT. In many cases, this default path is
'C:\Documents and Settings\username\'. See the documentation
for details.
***************************************************************/
data activity;
format task succ1 $8.;
input task dur succ1 engineer writer tester;
datalines;
Design 5 Develop 1 . 1
Develop 10 Document 1 . 1
Develop 10 Test 1 . 1
Document 6 Ship 1 1 .
Test 8 Ship 1 . 1
Ship 0 . . . .
;
data resources;
format obstype $8.;
input obstype date: date7. engineer writer tester;
datalines;
reslevel 15Dec06 . . 1
reslevel 18Dec06 1 . .
reslevel 30Dec06 . 1 .
;
proc pm data=activity
date='15Dec06'd
resin=resources;
act task;
succ succ1;
duration dur;
resource engineer writer tester / period=date;
run;
%sastomsp(mdbfile=mspref,
resds=resources,
_activity=task,
_date='15Dec06'd,
_resobstype=obstype,
_resource=engineer writer tester,
_resperiod=date);
/***************************************************************
Microsoft Project only displays the resource-constrained
schedule. To get a comparison view like PROC PM, you can
save the output schedule of PROC PM and specify the
scheduleds= parameter in the call to %SASTOMSP, as follows.
****************************************************************/
/***************************************************************
In this example we use a file reference mspref to specify
the path and file name of the mdb file to be created by the
macro %SASTOMSP.
filename mspref "C:\MSPROJ\sasmsp4b.mdb";
You may want to change it to a file name you want.
If you don't define mspref as a sas file reference, a file
mspref.mdb will be created in the default path of the OUTFILE=
option of PROC EXPORT. In many cases, this default path is
'C:\Documents and Settings\username\'. See the documentation
for details.
***************************************************************/
proc pm data=activity
date='15Dec06'd
resin=resources out=schedule;
act task;
succ succ1;
duration dur;
resource engineer writer tester / period=date;
run;
filename mspref "C:\MSPROJ\sasmsp4b.mdb";
%sastomsp(mdbfile=mspref,
resds=resources,
scheduleds=schedule,
_activity=task,
_date='15Dec06'd,
_resobstype=obstype,
_resource=engineer writer tester,
_resperiod=date);
/***************************************************************
After this You can manually set Microsoft Project to display
the schedules in the Gantt Chart. See SAS documentation
The Microsoft Project Conversion Macros for more details.
****************************************************************/