The Microsoft Project Conversion Macros

Example 4.4: 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 Figure 4.10. Note that the project starts at time 0, and there are no time units.





fig1.gif (107462 bytes)

Figure 4.10: 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:\backslashmsproj\backslashsasmsp1a.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"). Figure 4.11 shows the resulting project schedule as viewed in Microsoft Project.



fig2.gif (9151 bytes)

Figure 4.11: Microsoft Project Window

The schedule seen in Figure 4.10 (the PM window) is represented in terms of the time interval (days) while that in Figure 4.11 (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 Figure 4.12 and Figure 4.13.



fig3.gif (110633 bytes)

Figure 4.12: PM Window



fig4.gif (135005 bytes)

Figure 4.13: Microsoft Project Window

Previous Page | Next Page | Top of Page