The Microsoft Project Conversion Macros

Example 4.6: Exporting Calendars and Holidays

This example demonstrates the capability of the %SASTOMSP macro to handle multiple calendars within a project. Each activity is associated with one of four available calendars. Each calendar is customized to incorporate various workday shift patterns. In addition, there is a holiday data set that is also appropriately associated with a calendar. The four different calendars are defined as follows:

The following data set contains the activity information:
  
 data actdat; 
    format activities $12. s1-s3 $12. cal $8.; 
    input activities & days s1 & s2 & s3 & cal &; 
    datalines; 
 Approve Plan   5  Drawings      Study Market  Write Specs  DEFAULT 
 Drawings      10  Prototype     .             .            DEFAULT 
 Study Market   5  Mkt. Strat.   .             .            DEFAULT 
 Write Specs    5  Prototype     .             .            ENG_CAL 
 Prototype     15  Materials     Facility      .            OVT_CAL 
 Mkt. Strat.   10  Test Market   Marketing     .            DEFAULT 
 Materials     10  Init. Prod.   .             .            DEFAULT 
 Facility      10  Init. Prod.   .             .            DEFAULT 
 Init. Prod.   10  Test Market   Marketing     Evaluate     DEFAULT 
 Evaluate      10  Changes       .             .            DEFAULT 
 Test Market   15  Changes       .             .            DEFAULT 
 Changes        5  Production    .             .            DEFAULT 
 Production     0  .             .             .            PROD_CAL 
 Marketing      0  .             .             .            DEFAULT 
 ;
 

The next three data sets specify the work shift patterns, calendars, and holidays, respectively:
  
 data wrkdat; 
    input fullday time8. halfday time8. ovtday time8. 
          d1 time8. d2 time8. d3 time8.; 
    format fullday halfday ovtday d1 d2 d3 time6.; 
    datalines; 
 08:00   08:00   08:00   .       08:00   . 
 16:00   12:00   18:00   06:00   18:00   06:00 
 .       .       .       08:00   20:00   08:00 
 .       .       .       18:00   .       18:00 
 .       .       .       20:00   .       . 
 .       .       .       .       .       . 
 ;
 

  
 data caldat; 
    input  cal $ _sun_ $ _mon_$ _tue_$  _wed_$ _thu_$ _fri_$ _sat_ $; 
    datalines; 
 DEFAULT  holiday fullday fullday fullday fullday fullday holiday 
 OVT_CAL  holiday ovtday  ovtday  ovtday  ovtday  ovtday  halfday 
 PROD_CAL holiday d2      d1      d1      d1      d1      d3 
 ENG_CAL  .       .       .       .       .       .       . 
 ;
 

  
 data holdat; 
    format holiday holifin date7.; 
    input holiday & date7. holifin & date7. holidur cal $; 
    datalines; 
 08Dec06  .        7  ENG_CAL 
 24Dec06  26Dec06  .  . 
 01Jan07  01Jan07  .  . 
 ;
 

You can view the resulting project schedule in the PM window with the following call:
  
    proc pm date='01Dec06'd data=actdat 
        calendar=caldat holidata=holdat 
        workday=wrkdat 
        daylength='08:00't; 
        activity activities; 
        duration days; 
        successor s1 s2 s3; 
        calid cal; 
        holiday holiday / holifin = holifin holidur=holidur; 
    run;
 

The resulting PM window is shown in Figure 4.15.



fig5n.gif (207618 bytes)

Figure 4.15: PM Window

To convert the preceding data to an MDB file that includes the calendar and holiday information, you can use the following call to %SASTOMSP:

  
    filename mspref "c:\msproj\sasmsp3.mdb"; 
    %sastomsp(mdbfile=mspref, 
              actds=actdat, calds=caldat, 
              holds=holdat, workds=wrkdat, 
              _date='1Dec06'd, 
              _daylength='08:00't, 
              _activity=activities, 
              _dur=days, 
              _successor=s1 s2 s3, 
              _calid=cal, 
              _holistart=holiday, _holiend=holifin, _holidur=holidur)
 

The resulting MS Project Window is shown in Figure 4.16. The schedule is the same as the one produced by the PM procedure.



fig6n.gif (238192 bytes)

Figure 4.16: MS Project Window

Previous Page | Next Page | Top of Page