Round Trip between SAS and Microsoft Project (mspsae09)

/*******************************************************************/
/*                                                                 */
/*             S A S   S A M P L E   L I B R A R Y                 */
/*                                                                 */
/*    NAME: mspsae09                                               */
/*   TITLE: Round Trip between SAS and Microsoft Project (mspsae09)*/
/* PRODUCT: OR                                                     */
/*  SYSTEM: ALL                                                    */
/*    KEYS: OR                                                     */
/*   PROCS: PM, SAS/ACCESS                                         */
/*    DATA:                                                        */
/*                                                                 */
/* SUPPORT:                             UPDATE:                    */
/*     REF:                                                        */
/*    MISC: Example 9 from the The Microsoft Project               */
/*          Conversion Macros chapter of Project Management        */
/*                                                                 */
/*******************************************************************/



/*******************************************************************

 This example demonstrates how to convert a Microsoft Project (MSP)
 database file into SAS using the %MSPTOSAS macro, then convert the
 file back to MSP using the %SASTOMSP macro.

 *******************************************************************/


%msptosas(mdbfile=!SASROOT\or\sasmisc\mspsas1.mdb,
library=C:\MSPROJ, version=98)


/*******************************************************************

 After the successful run, seven data sets and one callpm.sas file
 have been generated. The following SAS code can be found either in
 the callpm.sas file or in the SAS log.

libname mspout "C:\MSPROJ";
PROC PM data = mspout.activity project=mspout.prefs
     caledata = mspout.calendar
     workdata = mspout.workday
     out=mspout.schedule
     interval=dtday
     date="17DEC06:08:00:00"dt
     daylength=" 8:00"t
     suppressobswarn
     setfinishmilestone;
activity ACTID;
successor SUCCUID / LAG = LAG;
duration DURATION;
project PNTUID;
id ACTIVITY ACTUID;
RUN;

 By taking the parameters from the preceding PM invocation, you can
 specify the values in the following %SASTOMSP call. The %SASTOMSP
 macro converts the project back into Microsoft Project format.

 *******************************************************************/


/*******************************************************************
 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\sasmsp5.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.

 *******************************************************************/

filename mspref "C:\MSPROJ\sasmsp5.mdb";
%sastomsp(library=C:\MSPROJ, mdbfile=mspref,
          actds=activity, calds=calendar, workds=workday,
          scheduleds=schedule, _interval=dtday,
          _date="17DEC06:08:00:00"dt, _daylength=" 8:00"t,
          _activity=ACTUID, _successor=SUCCUID,
          _lag=LAG, _dur=DURATION, _project=PNTUID,
          _id=ACTIVITY ACTUID)