Example 6.5 Simple %SASTOMSP Conversion

This example demonstrates how to convert a simple project from SAS to Microsoft Project. The data set Activity is created using the following SAS DATA step:

data activity;
   format activity succ1 $8.;
   input activity dur succ1;
   datalines;
Design    5  Develop
Develop  10  Document
Develop  10  Test
Document  6  Ship
Test      8  Ship
Ship      0  .
;

You can display this project in the PM procedure with the following SAS statements:

proc pm data=activity;    
    act activity;
    succ succ1;
    duration dur;
run;

The resulting PM window is shown in Output 6.5.1. Note that the project starts at time 0, and there are no time units.

Output 6.5.1: PM Window

PM Window


To convert the project specified by a SAS data set to an MDB file that is readable by Microsoft Project, you use the %SASTOMSP macro. You need to use the MDBFILE= parameter to specify the location and name of the MDB file to be created. For example, the following statement converts the project specified by the SAS data set Activity to the MDB file 'C:$\backslash $MSPROJ$\backslash $sasmsp1a.mdb':

   filename mspref "C:\MSPROJ\sasmsp1a.mdb";
   %sastomsp(mdbfile=mspref);

Note that several parameters are omitted since the variable names in the data set Activity are identical to the corresponding default parameters of the conversion macro (see the section Default Values). Output 6.5.2 shows the resulting project schedule as viewed in Microsoft Project.

Output 6.5.2: Microsoft Project Window

Microsoft Project Window


The schedule seen in Output 6.5.1 (the PM window) is represented in terms of the time interval (days) while that in Output 6.5.2 (the MS Project window) has dates. The PM procedure does not use dates if none are specified, so the project is scheduled to begin at time 0 and end at time 23. However, Microsoft Project schedules projects by using dates. Since no start date is specified, the conversion macro uses the current day as the default starting date.

To create a project schedule that is consistent across both the PM procedure and Microsoft Project, you need to add an additional option in both the PM invocation and the %SASTOMSP macro statement. In the PM invocation, you need to add the DATE= option to start the project on a given date. In the following example, the project is started on December 15, 2006:

proc pm data=activity date='15Dec06'd;
   act activity;
   succ succ1;
   duration dur; 
run;

For the call to %SASTOMSP, you specify this same starting date by using the _DATE= parameter:

   filename mspref "C:\MSPROJ\sasmsp1b.mdb";
   %sastomsp(mdbfile=mspref, _date='15Dec06'd);

The resulting windows are shown in Output 6.5.3 and Output 6.5.4.

Output 6.5.3: PM Window

PM Window


Output 6.5.4: Microsoft Project Window

Microsoft Project Window